From: Jean-Baptiste Mardelle Date: Mon, 14 Nov 2011 17:12:07 +0000 (+0100) Subject: Fix setting version number with revision when repository was fetched with "depth... X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=19bf59335a59c90ffcb68c5fef166189bb81c6f3;p=kdenlive Fix setting version number with revision when repository was fetched with "depth=1" (build script) --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 27df1975..45aeff18 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -25,7 +25,16 @@ if(NOT RELEASE_BUILD) ${CMAKE_CURRENT_SOURCE_DIR} ARGS "describe --tags" OUTPUT_VARIABLE KDENLIVE_GIT_REVISION + RETURN_VALUE TAG_RESULT ) + # git describe --tags failed, for example it fails if repo was checked with depth=1 + if(NOT ${TAG_RESULT} EQUAL 0) + exec_program(${GIT_EXECUTABLE} + ${CMAKE_CURRENT_SOURCE_DIR} + ARGS "describe --always" + OUTPUT_VARIABLE KDENLIVE_GIT_REVISION + ) + endif(NOT ${TAG_RESULT} EQUAL 0) message("Current Kdenlive Git revision is ${KDENLIVE_GIT_REVISION}") set(VERSION "\"${KDENLIVE_VERSION} (rev. ${KDENLIVE_GIT_REVISION})\"") else(GIT_FOUND)