3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-23 00:55:31 +00:00

[CMake] Fix detection of git description and hash for CMake 2.8.12

This commit is contained in:
Dan Liew 2017-06-24 15:15:27 +01:00
parent 3229bedb36
commit 80c0c4f663
2 changed files with 8 additions and 4 deletions

View file

@ -99,7 +99,9 @@ function(get_git_head_hash GIT_DIR OUTPUT_VAR)
message(FATAL_ERROR \""${GIT_DIR}\" is not an absolute path")
endif()
find_package(Git)
if (NOT Git_FOUND)
# NOTE: Use `GIT_FOUND` rather than `Git_FOUND` which was only
# available in CMake >= 3.5
if (NOT GIT_FOUND)
set(${OUTPUT_VAR} "GIT-NOTFOUND" PARENT_SCOPE)
return()
endif()
@ -146,7 +148,9 @@ function(get_git_head_describe GIT_DIR OUTPUT_VAR)
message(FATAL_ERROR \""${GIT_DIR}\" is not an absolute path")
endif()
find_package(Git)
if (NOT Git_FOUND)
# NOTE: Use `GIT_FOUND` rather than `Git_FOUND` which was only
# available in CMake >= 3.5
if (NOT GIT_FOUND)
set(${OUTPUT_VAR} "GIT-NOTFOUND" PARENT_SCOPE)
return()
endif()