mirror of
https://github.com/curl/curl.git
synced 2026-04-14 22:51:53 +03:00
cmake: quotes, whitespace, use VERSION_GREATER_EQUAL
- `NOT` + `VERSION_LESS` -> `VERSION_GREATER_EQUAL` Available since 3.7, which is the minimum required for curl: https://cmake.org/cmake/help/latest/command/if.html#version-greater-equal - make `CMAKE_REQUIRED_*` argument quotes consistent. - make `CMAKE_REQUIRED_*` space alignment consistent. - drop quote from version value for consistency with other cases. - formatting Closes #17002
This commit is contained in:
parent
2485a2d100
commit
6af7ab3b39
6 changed files with 50 additions and 53 deletions
|
|
@ -923,8 +923,8 @@ if(CURL_USE_GNUTLS)
|
|||
|
||||
if(NOT DEFINED HAVE_GNUTLS_SRP AND NOT CURL_DISABLE_SRP)
|
||||
cmake_push_check_state()
|
||||
list(APPEND CMAKE_REQUIRED_INCLUDES ${GNUTLS_INCLUDE_DIRS})
|
||||
list(APPEND CMAKE_REQUIRED_LIBRARIES ${GNUTLS_LIBRARIES})
|
||||
list(APPEND CMAKE_REQUIRED_INCLUDES "${GNUTLS_INCLUDE_DIRS}")
|
||||
list(APPEND CMAKE_REQUIRED_LIBRARIES "${GNUTLS_LIBRARIES}")
|
||||
check_symbol_exists("gnutls_srp_verifier" "gnutls/gnutls.h" HAVE_GNUTLS_SRP)
|
||||
cmake_pop_check_state()
|
||||
endif()
|
||||
|
|
@ -944,12 +944,12 @@ if(CURL_USE_RUSTLS)
|
|||
endif()
|
||||
|
||||
if(NOT DEFINED HAVE_RUSTLS_SUPPORTED_HPKE)
|
||||
if(RUSTLS_VERSION AND RUSTLS_VERSION VERSION_GREATER_EQUAL "0.15")
|
||||
if(RUSTLS_VERSION AND RUSTLS_VERSION VERSION_GREATER_EQUAL 0.15)
|
||||
set(HAVE_RUSTLS_SUPPORTED_HPKE TRUE)
|
||||
elseif(NOT RUSTLS_VERSION)
|
||||
cmake_push_check_state()
|
||||
list(APPEND CMAKE_REQUIRED_INCLUDES ${RUSTLS_INCLUDE_DIRS})
|
||||
list(APPEND CMAKE_REQUIRED_LIBRARIES ${RUSTLS_LIBRARIES})
|
||||
list(APPEND CMAKE_REQUIRED_INCLUDES "${RUSTLS_INCLUDE_DIRS}")
|
||||
list(APPEND CMAKE_REQUIRED_LIBRARIES "${RUSTLS_LIBRARIES}")
|
||||
curl_required_libpaths("${RUSTLS_LIBRARY_DIRS}")
|
||||
check_symbol_exists("rustls_supported_hpke" "rustls.h" HAVE_RUSTLS_SUPPORTED_HPKE)
|
||||
cmake_pop_check_state()
|
||||
|
|
@ -999,7 +999,7 @@ endif()
|
|||
set(HAVE_ZSTD OFF)
|
||||
curl_dependency_option(CURL_ZSTD Zstd "zstd")
|
||||
if(ZSTD_FOUND)
|
||||
if(NOT ZSTD_VERSION VERSION_LESS 1.0.0)
|
||||
if(ZSTD_VERSION VERSION_GREATER_EQUAL 1.0.0)
|
||||
set(HAVE_ZSTD ON)
|
||||
list(APPEND CURL_LIBS ${ZSTD_LIBRARIES})
|
||||
list(APPEND CURL_LIBDIRS ${ZSTD_LIBRARY_DIRS})
|
||||
|
|
@ -1029,8 +1029,8 @@ macro(curl_openssl_check_exists)
|
|||
endif()
|
||||
endif()
|
||||
if(USE_WOLFSSL)
|
||||
list(APPEND CMAKE_REQUIRED_INCLUDES "${WOLFSSL_INCLUDE_DIRS}")
|
||||
list(APPEND CMAKE_REQUIRED_LIBRARIES "${WOLFSSL_LIBRARIES}")
|
||||
list(APPEND CMAKE_REQUIRED_INCLUDES "${WOLFSSL_INCLUDE_DIRS}")
|
||||
list(APPEND CMAKE_REQUIRED_LIBRARIES "${WOLFSSL_LIBRARIES}")
|
||||
curl_required_libpaths("${WOLFSSL_LIBRARY_DIRS}")
|
||||
if(HAVE_LIBZ)
|
||||
list(APPEND CMAKE_REQUIRED_LIBRARIES ZLIB::ZLIB) # Public wolfSSL headers also require zlib headers
|
||||
|
|
@ -1193,8 +1193,8 @@ if(USE_QUICHE)
|
|||
endif()
|
||||
if(NOT DEFINED HAVE_QUICHE_CONN_SET_QLOG_FD)
|
||||
cmake_push_check_state()
|
||||
list(APPEND CMAKE_REQUIRED_INCLUDES "${QUICHE_INCLUDE_DIRS}")
|
||||
list(APPEND CMAKE_REQUIRED_LIBRARIES "${QUICHE_LIBRARIES}")
|
||||
list(APPEND CMAKE_REQUIRED_INCLUDES "${QUICHE_INCLUDE_DIRS}")
|
||||
list(APPEND CMAKE_REQUIRED_LIBRARIES "${QUICHE_LIBRARIES}")
|
||||
check_symbol_exists("quiche_conn_set_qlog_fd" "quiche.h" HAVE_QUICHE_CONN_SET_QLOG_FD)
|
||||
cmake_pop_check_state()
|
||||
endif()
|
||||
|
|
@ -1278,7 +1278,7 @@ if(NOT CURL_DISABLE_LDAP)
|
|||
# LDAP feature checks
|
||||
|
||||
list(APPEND CMAKE_REQUIRED_DEFINITIONS "-DLDAP_DEPRECATED=1")
|
||||
list(APPEND CMAKE_REQUIRED_LIBRARIES ${LDAP_LIBRARIES})
|
||||
list(APPEND CMAKE_REQUIRED_LIBRARIES "${LDAP_LIBRARIES}")
|
||||
curl_required_libpaths("${LDAP_LIBRARY_DIRS}")
|
||||
|
||||
check_function_exists("ldap_url_parse" HAVE_LDAP_URL_PARSE)
|
||||
|
|
@ -1461,7 +1461,7 @@ if(CURL_USE_GSSAPI)
|
|||
set(HAVE_GSSGNU 1)
|
||||
else()
|
||||
cmake_push_check_state()
|
||||
list(APPEND CMAKE_REQUIRED_INCLUDES ${GSS_INCLUDE_DIRS})
|
||||
list(APPEND CMAKE_REQUIRED_INCLUDES "${GSS_INCLUDE_DIRS}")
|
||||
|
||||
set(_include_list "")
|
||||
check_include_file("gssapi/gssapi.h" HAVE_GSSAPI_GSSAPI_H)
|
||||
|
|
@ -1481,7 +1481,7 @@ if(CURL_USE_GSSAPI)
|
|||
|
||||
if(NOT DEFINED HAVE_GSS_C_NT_HOSTBASED_SERVICE)
|
||||
string(APPEND CMAKE_REQUIRED_FLAGS " ${GSS_CFLAGS}")
|
||||
list(APPEND CMAKE_REQUIRED_LIBRARIES ${GSS_LIBRARIES})
|
||||
list(APPEND CMAKE_REQUIRED_LIBRARIES "${GSS_LIBRARIES}")
|
||||
curl_required_libpaths("${GSS_LIBRARY_DIRS}")
|
||||
check_symbol_exists("GSS_C_NT_HOSTBASED_SERVICE" "${_include_list}" HAVE_GSS_C_NT_HOSTBASED_SERVICE)
|
||||
endif()
|
||||
|
|
@ -2199,7 +2199,7 @@ curl_add_if("PSL" USE_LIBPSL)
|
|||
curl_add_if("CAcert" CURL_CA_EMBED_SET)
|
||||
curl_add_if("SSLS-EXPORT" _ssl_enabled AND USE_SSLS_EXPORT)
|
||||
if(_items)
|
||||
if(NOT CMAKE_VERSION VERSION_LESS 3.13)
|
||||
if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.13)
|
||||
list(SORT _items CASE INSENSITIVE)
|
||||
else()
|
||||
list(SORT _items)
|
||||
|
|
@ -2213,7 +2213,7 @@ message(STATUS "Features: ${SUPPORT_FEATURES}")
|
|||
set(_items "")
|
||||
curl_add_if("Schannel" _ssl_enabled AND USE_SCHANNEL)
|
||||
curl_add_if("${_openssl}" _ssl_enabled AND USE_OPENSSL AND OPENSSL_VERSION VERSION_LESS 3.0.0)
|
||||
curl_add_if("${_openssl} v3+" _ssl_enabled AND USE_OPENSSL AND NOT OPENSSL_VERSION VERSION_LESS 3.0.0)
|
||||
curl_add_if("${_openssl} v3+" _ssl_enabled AND USE_OPENSSL AND OPENSSL_VERSION VERSION_GREATER_EQUAL 3.0.0)
|
||||
curl_add_if("Secure Transport" _ssl_enabled AND USE_SECTRANSP)
|
||||
curl_add_if("mbedTLS" _ssl_enabled AND USE_MBEDTLS)
|
||||
curl_add_if("BearSSL" _ssl_enabled AND USE_BEARSSL)
|
||||
|
|
@ -2222,7 +2222,7 @@ curl_add_if("GnuTLS" _ssl_enabled AND USE_GNUTLS)
|
|||
curl_add_if("rustls" _ssl_enabled AND USE_RUSTLS)
|
||||
|
||||
if(_items)
|
||||
if(NOT CMAKE_VERSION VERSION_LESS 3.13)
|
||||
if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.13)
|
||||
list(SORT _items CASE INSENSITIVE)
|
||||
else()
|
||||
list(SORT _items)
|
||||
|
|
@ -2300,7 +2300,7 @@ if(NOT CURL_DISABLE_INSTALL)
|
|||
endforeach()
|
||||
|
||||
foreach(_libdir IN LISTS _custom_libdirs CURL_LIBDIRS)
|
||||
if(NOT CMAKE_VERSION VERSION_LESS 3.20)
|
||||
if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.20)
|
||||
cmake_path(SET _libdir NORMALIZE "${_libdir}")
|
||||
endif()
|
||||
list(FIND _sys_libdirs "${_libdir}" _libdir_index)
|
||||
|
|
@ -2337,7 +2337,7 @@ if(NOT CURL_DISABLE_INSTALL)
|
|||
get_filename_component(_libdir ${_lib} DIRECTORY)
|
||||
get_filename_component(_libname ${_lib} NAME_WE)
|
||||
if(_libname MATCHES "^lib")
|
||||
if(NOT CMAKE_VERSION VERSION_LESS 3.20)
|
||||
if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.20)
|
||||
cmake_path(SET _libdir NORMALIZE "${_libdir}")
|
||||
endif()
|
||||
list(FIND _sys_libdirs "${_libdir}" _libdir_index)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue