diff --git a/debian/patches/0007-Pass-debian-version-as-GIT_VERSION.patch b/debian/patches/0007-Pass-debian-version-as-GIT_VERSION.patch index 868783b3b..06871bbd4 100644 --- a/debian/patches/0007-Pass-debian-version-as-GIT_VERSION.patch +++ b/debian/patches/0007-Pass-debian-version-as-GIT_VERSION.patch @@ -3,26 +3,30 @@ Date: Fri, 13 Dec 2019 17:23:41 -0400 Subject: Pass debian version as GIT_VERSION --- - cmake/Version.cmake | 5 +++++ - 1 file changed, 5 insertions(+) + cmake/Version.cmake | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cmake/Version.cmake b/cmake/Version.cmake -index 45037a0..d9fdaef 100644 +index a017995..068e271 100644 --- a/cmake/Version.cmake +++ b/cmake/Version.cmake -@@ -1,4 +1,8 @@ +@@ -1,6 +1,10 @@ + # We do this via a custom command that re-invokes a cmake script because we need the DEPENDS on .git/index so that we will re-run it (to regenerate the commit tag in the version) whenever the current commit changes. If we used a configure_file directly here, it would only re-run when something else causes cmake to re-run. +-set(VERSIONTAG "${GIT_VERSION}") +if(GIT_VERSION) + set(VERSIONTAG "${GIT_VERSION}") + configure_file("${CMAKE_CURRENT_SOURCE_DIR}/constants/version.cpp.in" "${CMAKE_CURRENT_BINARY_DIR}/constants/version.cpp") +else() - find_package(Git QUIET) ++find_package(Git QUIET) set(GIT_INDEX_FILE "${PROJECT_SOURCE_DIR}/.git/index") - if(EXISTS ${GIT_INDEX_FILE} AND ( GIT_FOUND OR Git_FOUND) ) -@@ -18,5 +22,6 @@ else() - set(VERSIONTAG "nogit") - configure_file("${CMAKE_CURRENT_SOURCE_DIR}/constants/version.cpp.in" "${CMAKE_CURRENT_BINARY_DIR}/constants/version.cpp") + find_package(Git) + if(EXISTS "${GIT_INDEX_FILE}" AND ( GIT_FOUND OR Git_FOUND) ) +@@ -22,6 +26,7 @@ if(EXISTS "${GIT_INDEX_FILE}" AND ( GIT_FOUND OR Git_FOUND) ) + else() + configure_file("${CMAKE_CURRENT_SOURCE_DIR}/constants/version.cpp.in" "${CMAKE_CURRENT_BINARY_DIR}/constants/version.cpp" @ONLY) endif() +endif() - add_custom_target(genversion DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/constants/version.cpp") + + if(WIN32)