allow building from source tarballs

pull/1150/head
Jeff Becker 4 years ago
parent 87411032ec
commit d44a96769a
No known key found for this signature in database
GPG Key ID: F357B3B42F6F9B05

@ -1,6 +1,7 @@
find_package(Git QUIET)
if(GIT_FOUND OR Git_FOUND)
set(GIT_INDEX_FILE "${PROJECT_SOURCE_DIR}/.git/index")
if(EXISTS ${GIT_INDEX_FILE} AND GIT_FOUND OR Git_FOUND)
message(STATUS "Found Git: ${GIT_EXECUTABLE}")
add_custom_command(
@ -11,9 +12,9 @@ if(GIT_FOUND OR Git_FOUND)
"-D" "DEST=${CMAKE_CURRENT_BINARY_DIR}/constants/version.cpp"
"-P" "${CMAKE_CURRENT_LIST_DIR}/GenVersion.cmake"
DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/constants/version.cpp.in"
"${CMAKE_CURRENT_SOURCE_DIR}/../.git/index")
"${GIT_INDEX_FILE}")
else()
message(WARNING "Git was not found! Setting version to to nogit")
message(STATUS "Git was not found! Setting version to to nogit")
set(VERSIONTAG "nogit")
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/constants/version.cpp.in" "${CMAKE_CURRENT_BINARY_DIR}/constants/version.cpp")
endif()

Loading…
Cancel
Save