From 1cb4f5d6e8e470638759a48ba99fda230089712f Mon Sep 17 00:00:00 2001 From: Jakub Zakrzewski Date: Sun, 10 Sep 2017 16:56:16 +0200 Subject: cmake: Export libcurl and curl targets to use by other cmake projects The config files define curl and libcurl targets as imported targets CURL::curl and CURL::libcurl. For backward compatibility with CMake- provided find-module the CURL_INCLUDE_DIRS and CURL_LIBRARIES are also set. Closes #1879 --- lib/CMakeLists.txt | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'lib/CMakeLists.txt') diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index d6c996189..1fabdba90 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt @@ -108,7 +108,24 @@ if(WIN32) endif() endif() +target_include_directories(${LIB_NAME} INTERFACE + $) + install(TARGETS ${LIB_NAME} + EXPORT libcurl-target ARCHIVE DESTINATION lib LIBRARY DESTINATION lib - RUNTIME DESTINATION bin) + RUNTIME DESTINATION bin +) + +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} +) + -- cgit v1.2.3