From 3ecbef6d116e23c7538ba2fcfd7f05c4caf88e58 Mon Sep 17 00:00:00 2001 From: Sebastian Messmer Date: Fri, 12 Feb 2016 11:12:14 +0100 Subject: [PATCH] Fix CPack package generation --- cpack/CMakeLists.txt | 11 +++++++---- vendor/googletest/CMakeLists.txt | 3 --- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/cpack/CMakeLists.txt b/cpack/CMakeLists.txt index 6546b7ef..87db15de 100644 --- a/cpack/CMakeLists.txt +++ b/cpack/CMakeLists.txt @@ -1,4 +1,7 @@ -if(CMAKE_BUILD_TYPE MATCHES Release) +# We only allow generating distribution packages if: +# - it is a release build (to ensure all generated debian packages are fine to be distributed) +# - tests are not built (because otherwise CPack would start installing googletest with the package as well) +if(CMAKE_BUILD_TYPE MATCHES Release AND NOT BUILD_TESTING) if("${CMAKE_VERSION}" VERSION_LESS "3.3") # Earlier cmake versions generate .deb packages for which the package manager says they're bad quality # and asks the user whether they really want to install it. Cmake 3.3 fixes this. @@ -28,8 +31,8 @@ if(CMAKE_BUILD_TYPE MATCHES Release) #set(CPACK_NSIS_CONTACT "messmer@cryfs.org") #set(CPACK_NSIS_MODIFY_PATH ON) else(WIN32 AND NOT UNIX) - set(CPACK_STRIP_FILES "bin/cryfs") - set(CPACK_SOURCE_STRIP_FILES "") + set(CPACK_STRIP_FILES ON) + set(CPACK_SOURCE_STRIP_FILES ON) endif(WIN32 AND NOT UNIX) set(CPACK_PACKAGE_EXECUTABLES "cryfs" "CryFS") set(CPACK_DEBIAN_PACKAGE_SECTION "utils") @@ -42,4 +45,4 @@ if(CMAKE_BUILD_TYPE MATCHES Release) include(CPack) endif("${CMAKE_VERSION}" VERSION_LESS "3.3") -endif(CMAKE_BUILD_TYPE MATCHES Release) +endif(CMAKE_BUILD_TYPE MATCHES Release AND NOT BUILD_TESTING) diff --git a/vendor/googletest/CMakeLists.txt b/vendor/googletest/CMakeLists.txt index e05fd2f5..1b7118b5 100644 --- a/vendor/googletest/CMakeLists.txt +++ b/vendor/googletest/CMakeLists.txt @@ -1,9 +1,6 @@ include(CTest) if (BUILD_TESTING) - function(install) - # Do nothing. This disables cmake install() commands in googletest. - endfunction() add_subdirectory(gtest-1.7.0) project (googletest)