X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=CMakeLists.txt;h=c65f6be0e93a191ca26ce9763fba11594b3e02c3;hp=4ec9377d108f60296a35e940e0221de02faf675b;hb=eaa1bd30bc088e5cae6d8a742d7aedb3d8ff1897;hpb=ea81b32f0a4fdc203eb30e8327acde58de153179;ds=sidebyside diff --git a/CMakeLists.txt b/CMakeLists.txt index 4ec9377d..c65f6be0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -563,6 +563,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 (DEFINED ENV{GIT_HEAD}) + set(GIT_HEAD ${GIT_HEAD}) + endif () + if (DEFINED ENV{GIT_DESCRIBE}) + set(GIT_DESCRIBE ${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 "")