Skip to content

Commit

Permalink
CMake: Fix reading version file on Windows (#2001)
Browse files Browse the repository at this point in the history
  • Loading branch information
dweindl authored Feb 20, 2023
1 parent e9bf767 commit 8caee5c
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions cmake/version.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,5 @@ get_filename_component(CMAKE_PARENT_LIST_DIR ${CMAKE_PARENT_LIST_FILE}
DIRECTORY)
get_filename_component(CMAKE_PARENT_LIST_DIR ${CMAKE_PARENT_LIST_DIR} DIRECTORY)

execute_process(
COMMAND sh -c "cat version.txt | tr -d '\n'"
WORKING_DIRECTORY "${CMAKE_PARENT_LIST_DIR}"
OUTPUT_VARIABLE PROJECT_VERSION)
file(STRINGS "${CMAKE_PARENT_LIST_DIR}/version.txt" PROJECT_VERSION)
message(DEBUG "Version number: ${PROJECT_VERSION}")

0 comments on commit 8caee5c

Please sign in to comment.