summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-02-13 19:22:41 (GMT)
committerBrad King <brad.king@kitware.com>2020-02-13 19:22:53 (GMT)
commit0df30dbdbf9c28905ce424a1cfbeb5101c9ea0b0 (patch)
tree3533d7238a714a96ded1b0379c1594ff253e016c
parent0027f7bfcf544d50527a9939b7991f538bb9fd80 (diff)
downloadCastXML-0df30dbdbf9c28905ce424a1cfbeb5101c9ea0b0.zip
CastXML-0df30dbdbf9c28905ce424a1cfbeb5101c9ea0b0.tar.gz
CastXML-0df30dbdbf9c28905ce424a1cfbeb5101c9ea0b0.tar.bz2
Version: Drop git describe commit count from version number
Revise the logic from commit 60dc8284 (Version: Update version scheme to distinguish release and dev versions, 2019-04-11, v0.2.0~2) to drop the `-<count>` portion of the version number. This makes the version string the same for versions built from a Git source tree and from a tarball.
-rw-r--r--src/Version.cmake10
1 files changed, 1 insertions, 9 deletions
diff --git a/src/Version.cmake b/src/Version.cmake
index 202d0e8..80da6e5 100644
--- a/src/Version.cmake
+++ b/src/Version.cmake
@@ -46,15 +46,7 @@ if(git_info MATCHES "^([0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]?[0-9a-f]
# If this is not the exact commit of a release, add dev info.
if(NOT "${git_subject}" MATCHES "^[Cc]ast[Xx][Mm][Ll] ${CastXML_VERSION}$")
- set(git_suffix "-g${git_hash}")
- if(COMMAND _git)
- # Use version suffix computed by 'git describe' if this version has been tagged.
- _git(describe --tags --match "v${CastXML_VERSION}" HEAD)
- if(_git_out MATCHES "^v${CastXML_VERSION}(-[0-9]+-g[0-9a-f]+)?$")
- set(git_suffix "${CMAKE_MATCH_1}")
- endif()
- endif()
- set(CastXML_VERSION "${CastXML_VERSION}${git_suffix}")
+ set(CastXML_VERSION "${CastXML_VERSION}-g${git_hash}")
endif()
# If this is a work tree, check whether it is dirty.