diff options
author | FormerLurker <hochgebe@gmail.com> | 2020-11-08 21:38:27 +0300 |
---|---|---|
committer | FormerLurker <hochgebe@gmail.com> | 2020-11-08 21:38:27 +0300 |
commit | 2ce62496fc67d131d65bcfddb550156f6cd4c438 (patch) | |
tree | 5c9349827fa08439e6adf12a40fc851acd591a04 /GcodeProcessorLib/CMakeLists.txt | |
parent | 5eb4453aed430b3c5f336030c9a6eeb6e8ed18eb (diff) |
Add git tag to version.h, improve version display in console apps.
Diffstat (limited to 'GcodeProcessorLib/CMakeLists.txt')
-rw-r--r-- | GcodeProcessorLib/CMakeLists.txt | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/GcodeProcessorLib/CMakeLists.txt b/GcodeProcessorLib/CMakeLists.txt index fbfdd1a..1dfca4e 100644 --- a/GcodeProcessorLib/CMakeLists.txt +++ b/GcodeProcessorLib/CMakeLists.txt @@ -59,12 +59,20 @@ execute_process( # get the most recent tagged version execute_process( - COMMAND git describe --tags + COMMAND git describe WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} OUTPUT_VARIABLE GIT_TAGGED_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE ) +# get the tag for the current branch +execute_process( + COMMAND git describe --abbrev=0 + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} + OUTPUT_VARIABLE GIT_TAG + OUTPUT_STRIP_TRAILING_WHITESPACE +) + # get the build date string(TIMESTAMP BUILD_DATE "%Y-%m-%dT%H:%M:%SZ" UTC) # get the copyright date |