Sync git version generation
This commit is contained in:
parent
dce47d506d
commit
9fe8450571
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue