set GIT_HEAD and GIT_DESCRIBE from environment
[quassel.git] / CMakeLists.txt
index f6e9f74..70b05c9 100644 (file)
@@ -552,6 +552,17 @@ include(GetGitRevisionDescription)
 get_git_head_revision(GIT_REFSPEC GIT_HEAD)
 git_describe(GIT_DESCRIBE --long)
 
+# If not in a Git repo try to read GIT_HEAD and GIT_DESCRIBE from
+# enviroment
+if (NOT GIT_HEAD OR NOT GIT_DESCRIBE)
+  if (ENV_GIT_HEAD)
+      set(GIT_HEAD ${ENV_GIT_HEAD}) 
+  endif ()
+  if (ENV_GIT_DESCRIBE)
+     set(GIT_DESCRIBE ${ENV_GIT_DESCRIBE})
+  endif()
+endif()
+
 # Sanitize things if we're not in a Git repo
 if (NOT GIT_HEAD OR NOT GIT_DESCRIBE)
     set(GIT_HEAD "")