diff options
author | Rolf Eike Beer <eike@sf-mail.de> | 2018-03-05 22:17:28 +0100 |
---|---|---|
committer | Rolf Eike Beer <eike@sf-mail.de> | 2018-03-06 22:53:35 +0100 |
commit | 83c0cb3f0328504baf425704803c2ae83942cb86 (patch) | |
tree | fbaab31be56b074c2f05bbc4d1fef6b172c63e0a /Modules/FindCURL.cmake | |
parent | 674c5b306671129bc4a854137c304f19e2c3bf65 (diff) | |
download | cmake-83c0cb3f0328504baf425704803c2ae83942cb86.tar.gz |
FindCURL: provide imported target CURL::CURL
Diffstat (limited to 'Modules/FindCURL.cmake')
-rw-r--r-- | Modules/FindCURL.cmake | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/Modules/FindCURL.cmake b/Modules/FindCURL.cmake index f4bcc36a95..1d969a8138 100644 --- a/Modules/FindCURL.cmake +++ b/Modules/FindCURL.cmake @@ -7,6 +7,12 @@ # # Find curl # +# IMPORTED Targets +# ^^^^^^^^^^^^^^^^ +# +# This module defines :prop_tgt:`IMPORTED` target ``CURL::CURL``, if +# curl has been found. +# # Find the native CURL headers and libraries. # # :: @@ -52,4 +58,10 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(CURL if(CURL_FOUND) set(CURL_LIBRARIES ${CURL_LIBRARY}) set(CURL_INCLUDE_DIRS ${CURL_INCLUDE_DIR}) + + if(NOT TARGET CURL::CURL) + add_library(CURL::CURL UNKNOWN IMPORTED) + set_target_properties(CURL::CURL PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${CURL_INCLUDE_DIRS}") + set_property(TARGET CURL::CURL APPEND PROPERTY IMPORTED_LOCATION "${CURL_LIBRARY}") + endif() endif() |