From b85da58f2549a519486a7296f5b836a8f6a64880 Mon Sep 17 00:00:00 2001 From: oz-rw <127842933+oz-rw@users.noreply.github.com> Date: Wed, 14 Feb 2024 12:24:40 +0100 Subject: [PATCH] Support VERSION check when luvi added with add_subdirectory() When the project is added as a cmake subproject the VERSION file is under CMAKE_CURRENT_SOURCE_DIR and not CMAKE_SOURCE_DIR. --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e673c252..7aa6eaa5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -44,8 +44,8 @@ if(CMAKE_COMPILER_IS_GNUCC) add_definitions( -Wno-unused-function) endif() -if (EXISTS "${CMAKE_SOURCE_DIR}/VERSION") - file (STRINGS "${CMAKE_SOURCE_DIR}/VERSION" LUVI_VERSION) +if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/VERSION") + file (STRINGS "${CMAKE_CURRENT_SOURCE_DIR}/VERSION" LUVI_VERSION) message("-- Found luvi version: ${LUVI_VERSION}") else() exec_program(