From b9b76b9ed81dc5241df977f52bbd6781db67eb68 Mon Sep 17 00:00:00 2001 From: Thomas Klausner Date: Sat, 28 Sep 2024 20:43:26 +0200 Subject: [PATCH] Only install anything if LIBZIP_DO_INSTALL is ON. Closes #458. --- CMakeLists.txt | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8d019b9ff..b268200a7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -477,19 +477,19 @@ include(CMakePackageConfigHelpers) write_basic_package_version_file("${PROJECT_BINARY_DIR}/${PROJECT_NAME}-config-version.cmake" COMPATIBILITY AnyNewerVersion) -configure_package_config_file("${PROJECT_NAME}-config.cmake.in" "${PROJECT_BINARY_DIR}/${PROJECT_NAME}-config.cmake" - INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/libzip) +if(LIBZIP_DO_INSTALL) + configure_package_config_file("${PROJECT_NAME}-config.cmake.in" "${PROJECT_BINARY_DIR}/${PROJECT_NAME}-config.cmake" + INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/libzip) -# Install Find* modules, they are required by libzip-config.cmake to resolve dependencies -install(FILES + # Install Find* modules, they are required by libzip-config.cmake to resolve dependencies + install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/cmake/FindNettle.cmake ${CMAKE_CURRENT_SOURCE_DIR}/cmake/Findzstd.cmake ${CMAKE_CURRENT_SOURCE_DIR}/cmake/FindMbedTLS.cmake - DESTINATION + DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/libzip/modules - ) + ) -if(LIBZIP_DO_INSTALL) # Add targets to the build-tree export set export(TARGETS zip FILE "${PROJECT_BINARY_DIR}/${PROJECT_NAME}-targets.cmake")