summaryrefslogtreecommitdiff
path: root/CMakeModules/GenerateSCMRev.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'CMakeModules/GenerateSCMRev.cmake')
-rw-r--r--CMakeModules/GenerateSCMRev.cmake12
1 files changed, 9 insertions, 3 deletions
diff --git a/CMakeModules/GenerateSCMRev.cmake b/CMakeModules/GenerateSCMRev.cmake
index 43ca730ec..c7da2b91d 100644
--- a/CMakeModules/GenerateSCMRev.cmake
+++ b/CMakeModules/GenerateSCMRev.cmake
@@ -11,9 +11,15 @@ find_package(Git QUIET PATHS "${GIT_EXECUTABLE}")
11 11
12# generate git/build information 12# generate git/build information
13include(GetGitRevisionDescription) 13include(GetGitRevisionDescription)
14get_git_head_revision(GIT_REF_SPEC GIT_REV) 14if(NOT GIT_REF_SPEC)
15git_describe(GIT_DESC --always --long --dirty) 15 get_git_head_revision(GIT_REF_SPEC GIT_REV)
16git_branch_name(GIT_BRANCH) 16endif()
17if(NOT GIT_DESC)
18 git_describe(GIT_DESC --always --long --dirty)
19endif()
20if (NOT GIT_BRANCH)
21 git_branch_name(GIT_BRANCH)
22endif()
17get_timestamp(BUILD_DATE) 23get_timestamp(BUILD_DATE)
18 24
19# Generate cpp with Git revision from template 25# Generate cpp with Git revision from template