Report the branch & state rather than last tag in dev version string.

This commit is contained in:
Michael James Gratton 2017-02-07 21:52:48 +11:00
parent 86665944f6
commit b1493275e5

View file

@ -1,12 +1,12 @@
if (VERSION MATCHES "-dev$")
find_package(Git QUIET)
if (GIT_FOUND)
execute_process(COMMAND ${GIT_EXECUTABLE} describe --tags
execute_process(COMMAND ${GIT_EXECUTABLE} describe --all --long --dirty
WORKING_DIRECTORY ${SRC_DIR}
OUTPUT_VARIABLE "GIT_VERSION"
OUTPUT_STRIP_TRAILING_WHITESPACE
ERROR_QUIET)
string(REGEX REPLACE "^geary-([0-9\\.]*)-([0-9]*)-(.*)" "\\1+\\2~\\3" GIT_VERSION "${GIT_VERSION}")
string(REGEX REPLACE "^heads\\/(.*)-0-(g.*)$" "\\1~\\2" GIT_VERSION "${GIT_VERSION}")
set(VERSION ${GIT_VERSION})
endif()
endif()