- drop redundant internal variable `USE_ZLIB`, rely on `HAVE_LIBZ`.
- rename `optional_dependency()` -> `curl_dependency_option()`
Make `grep 'option('` hit this option. Namespaced.
It has a single use with `ZLIB`.
Closes #14918
endif()
endmacro()
-macro(optional_dependency _dependency)
+macro(curl_dependency_option _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(@USE_OPENSSL@)
find_dependency(OpenSSL @OPENSSL_VERSION_MAJOR@)
endif()
-if(@USE_ZLIB@)
+if(@HAVE_LIBZ@)
find_dependency(ZLIB @ZLIB_VERSION_MAJOR@)
endif()
# and before calling openssl_check_symbol_exists().
set(HAVE_LIBZ OFF)
-set(USE_ZLIB OFF)
-optional_dependency(ZLIB)
+curl_dependency_option(ZLIB)
if(ZLIB_FOUND)
set(HAVE_LIBZ ON)
- set(USE_ZLIB ON)
# Depend on ZLIB via imported targets. This allows our dependents to
# get our dependencies transitively.
# LIB_SELECTED
# TARGETS_EXPORT_NAME
# USE_OPENSSL
- # USE_ZLIB
+ # HAVE_LIBZ
configure_package_config_file("CMake/curl-config.cmake.in"
"${_project_config}"
INSTALL_DESTINATION ${CURL_INSTALL_CMAKE_DIR}