]> git.feebdaed.xyz Git - 0xmirror/cJSON.git/commitdiff
Fix make.sh install unwanted config files
authorRomain Lesteven <romain.lesteven@armaturetech.com>
Fri, 17 Apr 2020 10:01:39 +0000 (12:01 +0200)
committerRomain Lesteven <romain.lesteven@armaturetech.com>
Fri, 17 Apr 2020 10:01:39 +0000 (12:01 +0200)
CMakeLists.txt

index 913c1524601c423d19d261113cfebcac13627173..0a73a2c270601d298933008580f4e94dff62640b 100644 (file)
@@ -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)