diff options
author | DongHun Kwak <dh0128.kwak@samsung.com> | 2021-10-08 09:13:24 +0900 |
---|---|---|
committer | DongHun Kwak <dh0128.kwak@samsung.com> | 2021-10-08 09:13:24 +0900 |
commit | e42c4abb646a39cdd5d1ccb22a9619990ce2a898 (patch) | |
tree | 5c4a99e76409f26c9525137e845d0bac7efa8c7b /Modules/FindCURL.cmake | |
parent | 07408dd83a3637a29a56a7d5fbe49f63cbb41e8f (diff) | |
download | cmake-e42c4abb646a39cdd5d1ccb22a9619990ce2a898.tar.gz cmake-e42c4abb646a39cdd5d1ccb22a9619990ce2a898.tar.bz2 cmake-e42c4abb646a39cdd5d1ccb22a9619990ce2a898.zip |
Imported Upstream version 3.12.0upstream/3.12.0
Diffstat (limited to 'Modules/FindCURL.cmake')
-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 f4bcc36a9..a549765be 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::libcurl``, 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::libcurl) + add_library(CURL::libcurl UNKNOWN IMPORTED) + set_target_properties(CURL::libcurl PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${CURL_INCLUDE_DIRS}") + set_property(TARGET CURL::libcurl APPEND PROPERTY IMPORTED_LOCATION "${CURL_LIBRARY}") + endif() endif() |