summaryrefslogtreecommitdiff
path: root/CMake/Macros.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'CMake/Macros.cmake')
-rw-r--r--CMake/Macros.cmake13
1 files changed, 12 insertions, 1 deletions
diff --git a/CMake/Macros.cmake b/CMake/Macros.cmake
index e11f11155..b9fd33e8d 100644
--- a/CMake/Macros.cmake
+++ b/CMake/Macros.cmake
@@ -9,7 +9,7 @@
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
-# are also available at https://curl.haxx.se/docs/copyright.html.
+# are also available at https://curl.se/docs/copyright.html.
#
# You may opt to use, copy, modify, merge, publish, distribute and/or sell
# copies of the Software, and permit persons to whom the Software is
@@ -107,3 +107,14 @@ macro(curl_nroff_check)
message(WARNING "Found no *nroff program")
endif()
endmacro()
+
+macro(optional_dependency DEPENDENCY)
+ set(CURL_${DEPENDENCY} AUTO CACHE STRING "Build curl with ${DEPENDENCY} support (AUTO, ON or OFF)")
+ set_property(CACHE CURL_${DEPENDENCY} PROPERTY STRINGS AUTO ON OFF)
+
+ if(CURL_${DEPENDENCY} STREQUAL AUTO)
+ find_package(${DEPENDENCY})
+ elseif(CURL_${DEPENDENCY})
+ find_package(${DEPENDENCY} REQUIRED)
+ endif()
+endmacro()