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
This commit is contained in:
Jakub Zakrzewski 2017-09-10 16:56:16 +02:00
parent 58a9e770e3
commit 1cb4f5d6e8
5 changed files with 117 additions and 4 deletions

View file

@ -76,4 +76,15 @@ set_target_properties(${EXE_NAME} PROPERTIES
#INCLUDE(ModuleInstall OPTIONAL)
install(TARGETS ${EXE_NAME} DESTINATION bin)
install(TARGETS ${EXE_NAME} EXPORT curl-target DESTINATION bin)
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}
)