From: Alf Gaida Date: Sat, 10 Jan 2015 15:39:33 +0000 (+0100) Subject: set GIT_HEAD and GIT_DESCRIBE from environment X-Git-Tag: 0.12-beta1~5^2~1 X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=commitdiff_plain;h=2d34cee94202d11702881ddcd7bf80717f87f8c3;hp=399cac566c86141228358a7e7e14b2375fdc3259 set GIT_HEAD and GIT_DESCRIBE from environment --- diff --git a/CMakeLists.txt b/CMakeLists.txt index f6e9f748..70b05c93 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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 "")