summaryrefslogtreecommitdiff
path: root/Modules/FindCURL.cmake
diff options
context:
space:
mode:
authorDongHun Kwak <dh0128.kwak@samsung.com>2021-10-08 09:19:58 +0900
committerDongHun Kwak <dh0128.kwak@samsung.com>2021-10-08 09:19:58 +0900
commit484e650e5f7846961a1597af681a9186b2a03729 (patch)
tree83cbc84f064eb6ac9691cbfa3ac4d8c6f311fb0b /Modules/FindCURL.cmake
parentcd3301b98f04fe073d08531f49b84be0aa2897ef (diff)
downloadcmake-484e650e5f7846961a1597af681a9186b2a03729.tar.gz
cmake-484e650e5f7846961a1597af681a9186b2a03729.tar.bz2
cmake-484e650e5f7846961a1597af681a9186b2a03729.zip
Imported Upstream version 3.17.0upstream/3.17.0
Diffstat (limited to 'Modules/FindCURL.cmake')
-rw-r--r--Modules/FindCURL.cmake28
1 files changed, 27 insertions, 1 deletions
diff --git a/Modules/FindCURL.cmake b/Modules/FindCURL.cmake
index aeebc842e..919babcde 100644
--- a/Modules/FindCURL.cmake
+++ b/Modules/FindCURL.cmake
@@ -37,8 +37,35 @@ This module defines the following variables:
``CURL_VERSION_STRING``
The version of ``curl`` found.
+
+CURL CMake
+^^^^^^^^^^
+
+If CURL was built using the CMake buildsystem then it provides its own
+``CURLConfig.cmake`` file for use with the :command:`find_package` command's
+config mode. This module looks for this file and, if found,
+returns its results with no further action.
+
+Set ``CURL_NO_CURL_CMAKE`` to ``ON`` to disable this search.
+
#]=======================================================================]
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+
+if(NOT CURL_NO_CURL_CMAKE)
+ # do a find package call to specifically look for the CMake version
+ # of curl
+ find_package(CURL QUIET NO_MODULE)
+ mark_as_advanced(CURL_DIR)
+
+ # if we found the CURL cmake package then we are done, and
+ # can print what we found and return.
+ if(CURL_FOUND)
+ find_package_handle_standard_args(CURL HANDLE_COMPONENTS CONFIG_MODE)
+ return()
+ endif()
+endif()
+
find_package(PkgConfig QUIET)
if(PKG_CONFIG_FOUND)
pkg_check_modules(PC_CURL QUIET libcurl)
@@ -139,7 +166,6 @@ if(CURL_FIND_COMPONENTS)
endforeach()
endif()
-include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
find_package_handle_standard_args(CURL
REQUIRED_VARS CURL_LIBRARY CURL_INCLUDE_DIR
VERSION_VAR CURL_VERSION_STRING