From 4ff308c9480fa6a98a6de7589a1e021645d6bddb Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Wed, 27 Nov 2013 10:35:48 +0100 Subject: [PATCH] Fix icinga-version.h in dist tarballs. Fixes #5226 --- CMakeLists.txt | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2da2eca0b..44ff8ffa3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -42,12 +42,17 @@ set(CPACK_PACKAGE_CONTACT "Icinga Development Team") set(CPACK_PACKAGE_VERSION ${ICINGA2_VERSION}) set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_BINARY_DIR}/LICENSE.txt") set(CPACK_WIX_UPGRADE_GUID "68C75073-7CEF-4FC9-8DA5-581758729696") +set(CPACK_SOURCE_IGNORE_FILES "/.git/") include(CPack) include(GetGitRevisionDescription) -set(GIT_VERSION ${CPACK_PACKAGE_VERSION}) git_describe(GIT_VERSION --tags) -configure_file(icinga-version.h.cmake icinga-version.h) +if(GIT_VERSION MATCHES "-NOTFOUND$") + configure_file(icinga-version.h.fallback ${CMAKE_CURRENT_BINARY_DIR}/icinga-version.h COPYONLY) +else() + configure_file(icinga-version.h.cmake icinga-version.h) + configure_file(${CMAKE_CURRENT_BINARY_DIR}/icinga-version.h ${CMAKE_CURRENT_SOURCE_DIR}/icinga-version.h.fallback COPYONLY) +endif() if(WIN32) set(Boost_USE_STATIC_LIBS ON)