diff options
author | Brad King <brad.king@kitware.com> | 2018-03-08 14:56:14 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2018-03-08 14:56:40 (GMT) |
commit | 151763c9b2b5a1c76fc2acd31e284eca6940bded (patch) | |
tree | 1509217613300ba9fcc4e478b01d355782f88f95 /Modules | |
parent | f0b412dd82b8d45f1544961ecec618ebf877812d (diff) | |
parent | ee06f3c339e0f90e9a61891d3ad8c71a4286d504 (diff) | |
download | CMake-151763c9b2b5a1c76fc2acd31e284eca6940bded.zip CMake-151763c9b2b5a1c76fc2acd31e284eca6940bded.tar.gz CMake-151763c9b2b5a1c76fc2acd31e284eca6940bded.tar.bz2 |
Merge topic 'curl-target'
ee06f3c339 FindCURL: Revise documentation markup
83c0cb3f03 FindCURL: provide imported target CURL::CURL
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1822
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/FindCURL.cmake | 34 |
1 files changed, 27 insertions, 7 deletions
diff --git a/Modules/FindCURL.cmake b/Modules/FindCURL.cmake index f4bcc36..e66ae92 100644 --- a/Modules/FindCURL.cmake +++ b/Modules/FindCURL.cmake @@ -5,16 +5,30 @@ # FindCURL # -------- # -# Find curl -# # Find the native CURL headers and libraries. # -# :: +# IMPORTED Targets +# ^^^^^^^^^^^^^^^^ +# +# This module defines :prop_tgt:`IMPORTED` target ``CURL::CURL``, if +# curl has been found. +# +# Result Variables +# ^^^^^^^^^^^^^^^^ +# +# This module defines the following variables: # -# CURL_INCLUDE_DIRS - where to find curl/curl.h, etc. -# CURL_LIBRARIES - List of libraries when using curl. -# CURL_FOUND - True if curl found. -# CURL_VERSION_STRING - the version of curl found (since CMake 2.8.8) +# ``CURL_FOUND`` +# True if curl found. +# +# ``CURL_INCLUDE_DIRS`` +# where to find curl/curl.h, etc. +# +# ``CURL_LIBRARIES`` +# List of libraries when using curl. +# +# ``CURL_VERSION_STRING`` +# The version of curl found. # Look for the header file. find_path(CURL_INCLUDE_DIR NAMES curl/curl.h) @@ -52,4 +66,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() |