]> git.sesse.net Git - kdenlive/commitdiff
Fix setting version number with revision when repository was fetched with "depth...
authorJean-Baptiste Mardelle <jb@kdenlive.org>
Mon, 14 Nov 2011 17:12:07 +0000 (18:12 +0100)
committerJean-Baptiste Mardelle <jb@kdenlive.org>
Mon, 14 Nov 2011 17:12:07 +0000 (18:12 +0100)
CMakeLists.txt

index 27df197526f05e9a837c260f155d17d009e87110..45aeff186491e71aa8851783b2b980aa3d265d18 100644 (file)
@@ -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)