aboutsummaryrefslogtreecommitdiff
path: root/cmake/ComputeVersion.cmake
diff options
context:
space:
mode:
authorMarvin W <git@larma.de>2019-12-18 02:38:35 +0100
committerMarvin W <git@larma.de>2019-12-18 02:38:35 +0100
commit9fe8450571e49aaf376d07b379968c575bc0445c (patch)
tree18c9865185f58e1ebf12bcaf05df3527c49e0d8b /cmake/ComputeVersion.cmake
parentdce47d506de9cc8ebef45d9616fa4e93b2b7c5eb (diff)
downloaddino-9fe8450571e49aaf376d07b379968c575bc0445c.tar.gz
dino-9fe8450571e49aaf376d07b379968c575bc0445c.zip
Sync git version generation
Diffstat (limited to 'cmake/ComputeVersion.cmake')
-rw-r--r--cmake/ComputeVersion.cmake7
1 files changed, 4 insertions, 3 deletions
diff --git a/cmake/ComputeVersion.cmake b/cmake/ComputeVersion.cmake
index 3a962671..9ea38aaa 100644
--- a/cmake/ComputeVersion.cmake
+++ b/cmake/ComputeVersion.cmake
@@ -71,8 +71,9 @@ function(_compute_version_from_git)
set(VERSION_IS_RELEASE 1)
else ()
set(VERSION_IS_RELEASE 0)
- if (git_describe MATCHES "g([0-9a-f]+)$")
- set(VERSION_COMMIT_HASH "${CMAKE_MATCH_1}")
+ if (git_describe MATCHES "-([0-9]+)-g([0-9a-f]+)$")
+ set(VERSION_TAG_OFFSET "${CMAKE_MATCH_1}")
+ set(VERSION_COMMIT_HASH "${CMAKE_MATCH_2}")
endif ()
execute_process(
COMMAND "${GIT_EXECUTABLE}" show --format=%cd --date=format:%Y%m%d -s
@@ -89,7 +90,7 @@ function(_compute_version_from_git)
set(VERSION_COMMIT_DATE "${git_time}")
endif ()
if (NOT VERSION_IS_RELEASE)
- set(VERSION_SUFFIX ".git${VERSION_COMMIT_DATE}.${VERSION_COMMIT_HASH}")
+ set(VERSION_SUFFIX "~git${VERSION_TAG_OFFSET}.${VERSION_COMMIT_DATE}.${VERSION_COMMIT_HASH}")
else (NOT VERSION_IS_RELEASE)
set(VERSION_SUFFIX "")
endif (NOT VERSION_IS_RELEASE)