1
0
mirror of https://github.com/clementine-player/Clementine synced 2024-12-18 04:19:55 +01:00

Oops - add the git revision information even when forced

This commit is contained in:
David Sansome 2012-02-28 19:33:14 +00:00
parent d21cd0edd7
commit 50c0cd78a3

View File

@ -121,6 +121,7 @@ endif(CLEMENTINE_VERSION_PRERELEASE)
# Add git revision # Add git revision
if(FORCE_GIT_REVISION) if(FORCE_GIT_REVISION)
set(GIT_REV ${FORCE_GIT_REVISION}) set(GIT_REV ${FORCE_GIT_REVISION})
set(GIT_INFO_RESULT 0)
else(FORCE_GIT_REVISION) else(FORCE_GIT_REVISION)
find_program(GIT_EXECUTABLE git) find_program(GIT_EXECUTABLE git)
@ -130,25 +131,25 @@ else(FORCE_GIT_REVISION)
OUTPUT_VARIABLE GIT_REV OUTPUT_VARIABLE GIT_REV
ERROR_QUIET ERROR_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE) OUTPUT_STRIP_TRAILING_WHITESPACE)
endif()
endif()
if(${GIT_INFO_RESULT} EQUAL 0) if(${GIT_INFO_RESULT} EQUAL 0)
string(REGEX REPLACE "^(.+)-([0-9]+)-(g[a-f0-9]+)$" "\\1;\\2;\\3" string(REGEX REPLACE "^(.+)-([0-9]+)-(g[a-f0-9]+)$" "\\1;\\2;\\3"
GIT_PARTS ${GIT_REV}) GIT_PARTS ${GIT_REV})
if(NOT GIT_PARTS) if(NOT GIT_PARTS)
message(FATAL_ERROR "Failed to parse git revision string '${GIT_REV}'") message(FATAL_ERROR "Failed to parse git revision string '${GIT_REV}'")
endif(NOT GIT_PARTS) endif(NOT GIT_PARTS)
list(LENGTH GIT_PARTS GIT_PARTS_LENGTH) list(LENGTH GIT_PARTS GIT_PARTS_LENGTH)
if(GIT_PARTS_LENGTH EQUAL 3) if(GIT_PARTS_LENGTH EQUAL 3)
list(GET GIT_PARTS 0 GIT_TAGNAME) list(GET GIT_PARTS 0 GIT_TAGNAME)
list(GET GIT_PARTS 1 GIT_COMMITCOUNT) list(GET GIT_PARTS 1 GIT_COMMITCOUNT)
list(GET GIT_PARTS 2 GIT_SHA1) list(GET GIT_PARTS 2 GIT_SHA1)
set(HAS_GET_REVISION ON) set(HAS_GET_REVISION ON)
endif(GIT_PARTS_LENGTH EQUAL 3) endif(GIT_PARTS_LENGTH EQUAL 3)
endif(${GIT_INFO_RESULT} EQUAL 0) endif(${GIT_INFO_RESULT} EQUAL 0)
endif(NOT GIT_EXECUTABLE-NOTFOUND)
endif(FORCE_GIT_REVISION)
if(INCLUDE_GIT_REVISION AND HAS_GET_REVISION) if(INCLUDE_GIT_REVISION AND HAS_GET_REVISION)
set(CLEMENTINE_VERSION_DISPLAY "${GIT_REV}") set(CLEMENTINE_VERSION_DISPLAY "${GIT_REV}")