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

Fix a cmake error when getting the git revision number of an exact tag checkout

(cherry picked from commit 9e2e035ae1)
This commit is contained in:
David Sansome 2011-12-28 14:13:12 +01:00
parent 5b60c9adcd
commit 5abfdf4eb0

View File

@ -139,10 +139,13 @@ else(FORCE_GIT_REVISION)
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)
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_INFO_RESULT} EQUAL 0) endif(${GIT_INFO_RESULT} EQUAL 0)
endif(NOT GIT_EXECUTABLE-NOTFOUND) endif(NOT GIT_EXECUTABLE-NOTFOUND)
endif(FORCE_GIT_REVISION) endif(FORCE_GIT_REVISION)