Skip to content

Commit

Permalink
Support VERSION check when luvi added with add_subdirectory()
Browse files Browse the repository at this point in the history
When the project is added as a cmake subproject the VERSION file
is under CMAKE_CURRENT_SOURCE_DIR and not CMAKE_SOURCE_DIR.
  • Loading branch information
oz-rw authored and squeek502 committed Feb 16, 2024
1 parent 0b5b86f commit b85da58
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit b85da58

Please sign in to comment.