summaryrefslogtreecommitdiff
path: root/lib/CMakeLists.txt
diff options
context:
space:
mode:
authorRuslan Baratov <ruslan_baratov@yahoo.com>2018-07-18 02:31:51 +0300
committerJay Satiro <raysatiro@yahoo.com>2018-10-01 16:16:29 -0400
commit69328490fc91bfa00a6a90da84239524b01f5527 (patch)
treec5c4a5f819da86598b6a25354a1bffbdf07edad5 /lib/CMakeLists.txt
parentb8ab30d3096f65683571eff4ba474ceba592a480 (diff)
downloadgnurl-69328490fc91bfa00a6a90da84239524b01f5527.tar.gz
gnurl-69328490fc91bfa00a6a90da84239524b01f5527.tar.bz2
gnurl-69328490fc91bfa00a6a90da84239524b01f5527.zip
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
Diffstat (limited to 'lib/CMakeLists.txt')
-rw-r--r--lib/CMakeLists.txt14
1 files changed, 4 insertions, 10 deletions
diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt
index be6f7a249..eca9a8af9 100644
--- a/lib/CMakeLists.txt
+++ b/lib/CMakeLists.txt
@@ -109,19 +109,13 @@ target_include_directories(${LIB_NAME} INTERFACE
$<BUILD_INTERFACE:${CURL_SOURCE_DIR}/include>)
install(TARGETS ${LIB_NAME}
- EXPORT libcurl-target
- ARCHIVE DESTINATION lib
- LIBRARY DESTINATION lib
- RUNTIME DESTINATION bin
+ EXPORT ${TARGETS_EXPORT_NAME}
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)
export(TARGETS ${LIB_NAME}
APPEND FILE ${PROJECT_BINARY_DIR}/libcurl-target.cmake
NAMESPACE CURL::
)
-
-install(EXPORT libcurl-target
- FILE libcurl-target.cmake
- NAMESPACE CURL::
- DESTINATION ${CURL_INSTALL_CMAKE_DIR}
-)