Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FormerLurker/ArcWelderLib.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFormerLurker <hochgebe@gmail.com>2020-11-08 21:38:27 +0300
committerFormerLurker <hochgebe@gmail.com>2020-11-08 21:38:27 +0300
commit2ce62496fc67d131d65bcfddb550156f6cd4c438 (patch)
tree5c9349827fa08439e6adf12a40fc851acd591a04 /GcodeProcessorLib
parent5eb4453aed430b3c5f336030c9a6eeb6e8ed18eb (diff)
Add git tag to version.h, improve version display in console apps.
Diffstat (limited to 'GcodeProcessorLib')
-rw-r--r--GcodeProcessorLib/CMakeLists.txt10
-rw-r--r--GcodeProcessorLib/version.generated.h.in1
-rw-r--r--GcodeProcessorLib/version.h1
3 files changed, 11 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
diff --git a/GcodeProcessorLib/version.generated.h.in b/GcodeProcessorLib/version.generated.h.in
index 1b20014..ec3cd38 100644
--- a/GcodeProcessorLib/version.generated.h.in
+++ b/GcodeProcessorLib/version.generated.h.in
@@ -5,6 +5,7 @@
#define GIT_BRANCH "@GIT_BRANCH@"
#define GIT_COMMIT_HASH "@GIT_COMMIT_HASH@"
#define GIT_TAGGED_VERSION "@GIT_TAGGED_VERSION@"
+#define GIT_TAG "@GIT_TAG@"
#define BUILD_DATE "@BUILD_DATE@"
#define COPYRIGHT_DATE "@BUILD_YEAR@"
#define AUTHOR "Brad Hochgesang"
diff --git a/GcodeProcessorLib/version.h b/GcodeProcessorLib/version.h
index 5195b4c..9226f12 100644
--- a/GcodeProcessorLib/version.h
+++ b/GcodeProcessorLib/version.h
@@ -4,6 +4,7 @@
#define GIT_BRANCH "Unknown"
#define GIT_COMMIT_HASH "Unknown"
#define GIT_TAGGED_VERSION "Unknown"
+ #define GIT_TAG "Unknown"
#define BUILD_DATE "Unknown"
#define COPYRIGHT_DATE "2020"
#define AUTHOR "Brad Hochgesang"