2019-09-18 20:40:16 +02:00
|
|
|
project(libversion)
|
2019-03-11 10:36:02 +01:00
|
|
|
add_library(version STATIC "version.c")
|
|
|
|
execute_process(COMMAND bash ./generate-version-string.sh
|
|
|
|
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
|
|
|
OUTPUT_VARIABLE GIT_VER)
|
2019-08-26 00:05:45 +02:00
|
|
|
execute_process(COMMAND bash ./generate-git-commit-string.sh
|
|
|
|
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
|
|
|
OUTPUT_VARIABLE GIT_COMMIT)
|
|
|
|
message("Commit: ${GIT_COMMIT}")
|
|
|
|
message("Version: ${GIT_VER}")
|
|
|
|
target_compile_definitions(version PRIVATE PROJECT_GIT_VERSION=${GIT_VER} PROJECT_GIT_COMMIT=${GIT_COMMIT})
|