mirror of
https://github.com/Kitware/CMake.git
synced 2026-04-21 21:58:50 -05:00
FindCURL: Try to find CURLConfig.cmake
This commit is contained in:
@@ -0,0 +1,7 @@
|
|||||||
|
FindCURL-cmake-package
|
||||||
|
----------------------
|
||||||
|
|
||||||
|
* The :module:`FindCURL` module learned to find CURL using
|
||||||
|
the ``CURLConfig.cmake`` package configuration file generated by
|
||||||
|
CURL's cmake buildsystem. It also gained a new ``CURL_NO_CURL_CMAKE``
|
||||||
|
option to disable this behavior.
|
||||||
+27
-1
@@ -37,8 +37,35 @@ This module defines the following variables:
|
|||||||
|
|
||||||
``CURL_VERSION_STRING``
|
``CURL_VERSION_STRING``
|
||||||
The version of ``curl`` found.
|
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)
|
find_package(PkgConfig QUIET)
|
||||||
if(PKG_CONFIG_FOUND)
|
if(PKG_CONFIG_FOUND)
|
||||||
pkg_check_modules(PC_CURL QUIET libcurl)
|
pkg_check_modules(PC_CURL QUIET libcurl)
|
||||||
@@ -139,7 +166,6 @@ if(CURL_FIND_COMPONENTS)
|
|||||||
endforeach()
|
endforeach()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
|
|
||||||
find_package_handle_standard_args(CURL
|
find_package_handle_standard_args(CURL
|
||||||
REQUIRED_VARS CURL_LIBRARY CURL_INCLUDE_DIR
|
REQUIRED_VARS CURL_LIBRARY CURL_INCLUDE_DIR
|
||||||
VERSION_VAR CURL_VERSION_STRING
|
VERSION_VAR CURL_VERSION_STRING
|
||||||
|
|||||||
Reference in New Issue
Block a user