From 3442b366720d1046c827b4df4b26ccd0ecb66b2c Mon Sep 17 00:00:00 2001 From: Romain Lesteven Date: Fri, 17 Apr 2020 12:01:39 +0200 Subject: [PATCH] Fix make.sh install unwanted config files --- CMakeLists.txt | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 913c152..0a73a2c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -223,10 +223,12 @@ configure_file( "${CMAKE_CURRENT_SOURCE_DIR}/library_config/cJSONConfigVersion.cmake.in" ${PROJECT_BINARY_DIR}/cJSONConfigVersion.cmake @ONLY) -# Install package config files -install(FILES ${PROJECT_BINARY_DIR}/cJSONConfig.cmake - ${PROJECT_BINARY_DIR}/cJSONConfigVersion.cmake - DESTINATION "${CMAKE_INSTALL_FULL_LIBDIR}/cmake/cJSON") +if(ENABLE_TARGET_EXPORT) + # Install package config files + install(FILES ${PROJECT_BINARY_DIR}/cJSONConfig.cmake + ${PROJECT_BINARY_DIR}/cJSONConfigVersion.cmake + DESTINATION "${CMAKE_INSTALL_FULL_LIBDIR}/cmake/cJSON") +endif() option(ENABLE_CJSON_TEST "Enable building cJSON test" ON) if(ENABLE_CJSON_TEST)