From 69328490fc91bfa00a6a90da84239524b01f5527 Mon Sep 17 00:00:00 2001 From: Ruslan Baratov Date: Wed, 18 Jul 2018 02:31:51 +0300 Subject: CMake: Improve config installation Use 'GNUInstallDirs' standard module to set destinations of installed files. Use uppercase "CURL" names instead of lowercase "curl" to match standard 'FindCURL.cmake' CMake module: * https://cmake.org/cmake/help/latest/module/FindCURL.html Meaning: * Install 'CURLConfig.cmake' instead of 'curl-config.cmake' * User should call 'find_package(CURL)' instead of 'find_package(curl)' Use 'configure_package_config_file' function to generate 'CURLConfig.cmake' file. This will make 'curl-config.cmake.in' template file smaller and handle components better. E.g. current configuration report no error if user specified unknown components (note: new configuration expects no components, report error if user will try to specify any). Closes https://github.com/curl/curl/pull/2849 --- src/CMakeLists.txt | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'src/CMakeLists.txt') diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index d3ea3e23b..f10a3d0bb 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -72,14 +72,8 @@ target_link_libraries(${EXE_NAME} libcurl ${CURL_LIBS}) #INCLUDE(ModuleInstall OPTIONAL) -install(TARGETS ${EXE_NAME} EXPORT curl-target DESTINATION bin) +install(TARGETS ${EXE_NAME} EXPORT ${TARGETS_EXPORT_NAME} DESTINATION ${CMAKE_INSTALL_BINDIR}) export(TARGETS ${EXE_NAME} APPEND FILE ${PROJECT_BINARY_DIR}/curl-target.cmake NAMESPACE CURL:: ) - -install(EXPORT curl-target - FILE curl-target.cmake - NAMESPACE CURL:: - DESTINATION ${CURL_INSTALL_CMAKE_DIR} -) -- cgit v1.2.3