From: Viktor Szakats Date: Sat, 17 Aug 2024 21:39:49 +0000 (+0200) Subject: cmake: tidy up more in Find modules X-Git-Tag: curl-8_10_0~212 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3e60f174ee0a86a8e11100f603f030036a3b0200;p=thirdparty%2Fcurl.git cmake: tidy up more in Find modules - add `NAMES` where missing. - document input variables (including deprecated ones.) - comment cleanups. - FindWolfSSL: drop stray `QUIET` from `pkg_check_modules()`. (`QUIET` may be re-added for all modules in the future.) Closes #14579 --- diff --git a/CMake/FindBearSSL.cmake b/CMake/FindBearSSL.cmake index 2e25182c34..0487f80abe 100644 --- a/CMake/FindBearSSL.cmake +++ b/CMake/FindBearSSL.cmake @@ -23,7 +23,13 @@ ########################################################################### # Find the bearssl library # -# Result Variables: +# Input variables: +# +# BEARSSL_INCLUDE_DIR The bearssl include directory +# BEARSSL_INCLUDE_DIRS The bearssl include directory (deprecated) +# BEARSSL_LIBRARY Path to bearssl library +# +# Result variables: # # BEARSSL_FOUND System has bearssl # BEARSSL_INCLUDE_DIRS The bearssl include directories @@ -35,8 +41,8 @@ if(DEFINED BEARSSL_INCLUDE_DIRS AND NOT DEFINED BEARSSL_INCLUDE_DIR) unset(BEARSSL_INCLUDE_DIRS) endif() -find_path(BEARSSL_INCLUDE_DIR "bearssl.h") -find_library(BEARSSL_LIBRARY "bearssl") +find_path(BEARSSL_INCLUDE_DIR NAMES "bearssl.h") +find_library(BEARSSL_LIBRARY NAMES "bearssl") include(FindPackageHandleStandardArgs) find_package_handle_standard_args(BEARSSL diff --git a/CMake/FindBrotli.cmake b/CMake/FindBrotli.cmake index d0fe01c6a0..1150d4cc72 100644 --- a/CMake/FindBrotli.cmake +++ b/CMake/FindBrotli.cmake @@ -23,7 +23,13 @@ ########################################################################### # Find the brotli library # -# Result Variables: +# Input variables: +# +# BROTLI_INCLUDE_DIR The brotli include directory +# BROTLICOMMON_LIBRARY Path to brotlicommon library +# BROTLIDEC_LIBRARY Path to brotlidec library +# +# Result variables: # # BROTLI_FOUND System has brotli # BROTLI_INCLUDE_DIRS The brotli include directories diff --git a/CMake/FindCARES.cmake b/CMake/FindCARES.cmake index 6dd563dd28..7f29f814c5 100644 --- a/CMake/FindCARES.cmake +++ b/CMake/FindCARES.cmake @@ -23,7 +23,12 @@ ########################################################################### # Find the c-ares library # -# Result Variables: +# Input variables: +# +# CARES_INCLUDE_DIR The c-ares include directory +# CARES_LIBRARY Path to c-ares library +# +# Result variables: # # CARES_FOUND System has c-ares # CARES_INCLUDE_DIRS The c-ares include directories @@ -35,7 +40,7 @@ if(CURL_USE_PKGCONFIG) pkg_check_modules(PC_CARES "libcares") endif() -find_path(CARES_INCLUDE_DIR "ares.h" +find_path(CARES_INCLUDE_DIR NAMES "ares.h" HINTS ${PC_CARES_INCLUDEDIR} ${PC_CARES_INCLUDE_DIRS} diff --git a/CMake/FindGSS.cmake b/CMake/FindGSS.cmake index 3e37a1d41b..d1d6eadc6d 100644 --- a/CMake/FindGSS.cmake +++ b/CMake/FindGSS.cmake @@ -27,7 +27,7 @@ # # GSS_ROOT_DIR Set this variable to the root installation of GSS # -# Result Variables: +# Result variables: # # GSS_FOUND System has the Heimdal library # GSS_FLAVOUR "MIT" or "Heimdal" if anything found diff --git a/CMake/FindLibPSL.cmake b/CMake/FindLibPSL.cmake index 47e766672d..7eb48d6ed7 100644 --- a/CMake/FindLibPSL.cmake +++ b/CMake/FindLibPSL.cmake @@ -23,7 +23,12 @@ ########################################################################### # Find the libpsl library # -# Result Variables: +# Input variables: +# +# LIBPSL_INCLUDE_DIR The libpsl include directory +# LIBPSL_LIBRARY Path to libpsl library +# +# Result variables: # # LIBPSL_FOUND System has libpsl # LIBPSL_INCLUDE_DIRS The libpsl include directories @@ -35,7 +40,7 @@ if(CURL_USE_PKGCONFIG) pkg_check_modules(PC_LIBPSL "libpsl") endif() -find_path(LIBPSL_INCLUDE_DIR "libpsl.h" +find_path(LIBPSL_INCLUDE_DIR NAMES "libpsl.h" HINTS ${PC_LIBPSL_INCLUDEDIR} ${PC_LIBPSL_INCLUDE_DIRS} diff --git a/CMake/FindLibSSH2.cmake b/CMake/FindLibSSH2.cmake index b40cb44166..fc16bad548 100644 --- a/CMake/FindLibSSH2.cmake +++ b/CMake/FindLibSSH2.cmake @@ -23,7 +23,12 @@ ########################################################################### # Find the libssh2 library # -# Result Variables: +# Input variables: +# +# LIBSSH2_INCLUDE_DIR The libssh2 include directory +# LIBSSH2_LIBRARY Path to libssh2 library +# +# Result variables: # # LIBSSH2_FOUND System has libssh2 # LIBSSH2_INCLUDE_DIRS The libssh2 include directories @@ -35,7 +40,7 @@ if(CURL_USE_PKGCONFIG) pkg_check_modules(PC_LIBSSH2 "libssh2") endif() -find_path(LIBSSH2_INCLUDE_DIR "libssh2.h" +find_path(LIBSSH2_INCLUDE_DIR NAMES "libssh2.h" HINTS ${PC_LIBSSH2_INCLUDEDIR} ${PC_LIBSSH2_INCLUDE_DIRS} diff --git a/CMake/FindMSH3.cmake b/CMake/FindMSH3.cmake index 901119acc7..46cee88719 100644 --- a/CMake/FindMSH3.cmake +++ b/CMake/FindMSH3.cmake @@ -23,7 +23,12 @@ ########################################################################### # Find the msh3 library # -# Result Variables: +# Input variables: +# +# MSH3_INCLUDE_DIR The msh3 include directory +# MSH3_LIBRARY Path to msh3 library +# +# Result variables: # # MSH3_FOUND System has msh3 # MSH3_INCLUDE_DIRS The msh3 include directories @@ -35,7 +40,7 @@ if(CURL_USE_PKGCONFIG) pkg_check_modules(PC_MSH3 "libmsh3") endif() -find_path(MSH3_INCLUDE_DIR "msh3.h" +find_path(MSH3_INCLUDE_DIR NAMES "msh3.h" HINTS ${PC_MSH3_INCLUDEDIR} ${PC_MSH3_INCLUDE_DIRS} diff --git a/CMake/FindMbedTLS.cmake b/CMake/FindMbedTLS.cmake index 3376b2cee8..53b86149e4 100644 --- a/CMake/FindMbedTLS.cmake +++ b/CMake/FindMbedTLS.cmake @@ -23,7 +23,15 @@ ########################################################################### # Find the mbedtls library # -# Result Variables: +# Input variables: +# +# MBEDTLS_INCLUDE_DIR The mbedtls include directory +# MBEDTLS_INCLUDE_DIRS The mbedtls include directory (deprecated) +# MBEDTLS_LIBRARY Path to mbedtls library +# MBEDX509_LIBRARY Path to mbedx509 library +# MBEDCRYPTO_LIBRARY Path to mbedcrypto library +# +# Result variables: # # MBEDTLS_FOUND System has mbedtls # MBEDTLS_INCLUDE_DIRS The mbedtls include directories @@ -41,23 +49,23 @@ if(CURL_USE_PKGCONFIG) pkg_check_modules(PC_MBEDTLS "mbedtls") endif() -find_path(MBEDTLS_INCLUDE_DIR "mbedtls/ssl.h" +find_path(MBEDTLS_INCLUDE_DIR NAMES "mbedtls/ssl.h" HINTS ${PC_MBEDTLS_INCLUDEDIR} ${PC_MBEDTLS_INCLUDE_DIRS} ) -find_library(MBEDTLS_LIBRARY "mbedtls" +find_library(MBEDTLS_LIBRARY NAMES "mbedtls" HINTS ${PC_MBEDTLS_LIBDIR} ${PC_MBEDTLS_LIBRARY_DIRS} ) -find_library(MBEDX509_LIBRARY "mbedx509" +find_library(MBEDX509_LIBRARY NAMES "mbedx509" HINTS ${PC_MBEDTLS_LIBDIR} ${PC_MBEDTLS_LIBRARY_DIRS} ) -find_library(MBEDCRYPTO_LIBRARY "mbedcrypto" +find_library(MBEDCRYPTO_LIBRARY NAMES "mbedcrypto" HINTS ${PC_MBEDTLS_LIBDIR} ${PC_MBEDTLS_LIBRARY_DIRS} diff --git a/CMake/FindNGHTTP2.cmake b/CMake/FindNGHTTP2.cmake index e41a5d1cd9..e632d2054b 100644 --- a/CMake/FindNGHTTP2.cmake +++ b/CMake/FindNGHTTP2.cmake @@ -23,7 +23,12 @@ ########################################################################### # Find the nghttp2 library # -# Result Variables: +# Input variables: +# +# NGHTTP2_INCLUDE_DIR The nghttp2 include directory +# NGHTTP2_LIBRARY Path to nghttp2 library +# +# Result variables: # # NGHTTP2_FOUND System has nghttp2 # NGHTTP2_INCLUDE_DIRS The nghttp2 include directories @@ -35,7 +40,7 @@ if(CURL_USE_PKGCONFIG) pkg_check_modules(PC_NGHTTP2 "libnghttp2") endif() -find_path(NGHTTP2_INCLUDE_DIR "nghttp2/nghttp2.h" +find_path(NGHTTP2_INCLUDE_DIR NAMES "nghttp2/nghttp2.h" HINTS ${PC_NGHTTP2_INCLUDEDIR} ${PC_NGHTTP2_INCLUDE_DIRS} diff --git a/CMake/FindNGHTTP3.cmake b/CMake/FindNGHTTP3.cmake index d0e34ab10c..02a0c87d07 100644 --- a/CMake/FindNGHTTP3.cmake +++ b/CMake/FindNGHTTP3.cmake @@ -23,7 +23,12 @@ ########################################################################### # Find the nghttp3 library # -# Result Variables: +# Input variables: +# +# NGHTTP3_INCLUDE_DIR The nghttp3 include directory +# NGHTTP3_LIBRARY Path to nghttp3 library +# +# Result variables: # # NGHTTP3_FOUND System has nghttp3 # NGHTTP3_INCLUDE_DIRS The nghttp3 include directories @@ -35,7 +40,7 @@ if(CURL_USE_PKGCONFIG) pkg_check_modules(PC_NGHTTP3 "libnghttp3") endif() -find_path(NGHTTP3_INCLUDE_DIR "nghttp3/nghttp3.h" +find_path(NGHTTP3_INCLUDE_DIR NAMES "nghttp3/nghttp3.h" HINTS ${PC_NGHTTP3_INCLUDEDIR} ${PC_NGHTTP3_INCLUDE_DIRS} diff --git a/CMake/FindNGTCP2.cmake b/CMake/FindNGTCP2.cmake index 04bd59410c..194483d54c 100644 --- a/CMake/FindNGTCP2.cmake +++ b/CMake/FindNGTCP2.cmake @@ -31,7 +31,12 @@ # wolfSSL: Use libngtcp2_crypto_wolfssl # GnuTLS: Use libngtcp2_crypto_gnutls # -# Result Variables: +# Input variables: +# +# NGTCP2_INCLUDE_DIR The ngtcp2 include directory +# NGTCP2_LIBRARY Path to ngtcp2 library +# +# Result variables: # # NGTCP2_FOUND System has ngtcp2 # NGTCP2_INCLUDE_DIRS The ngtcp2 include directories @@ -43,7 +48,7 @@ if(CURL_USE_PKGCONFIG) pkg_check_modules(PC_NGTCP2 "libngtcp2") endif() -find_path(NGTCP2_INCLUDE_DIR "ngtcp2/ngtcp2.h" +find_path(NGTCP2_INCLUDE_DIR NAMES "ngtcp2/ngtcp2.h" HINTS ${PC_NGTCP2_INCLUDEDIR} ${PC_NGTCP2_INCLUDE_DIRS} diff --git a/CMake/FindNettle.cmake b/CMake/FindNettle.cmake index ea86d939b9..2cd691eb08 100644 --- a/CMake/FindNettle.cmake +++ b/CMake/FindNettle.cmake @@ -23,7 +23,12 @@ ########################################################################### # Find the nettle library # -# Result Variables: +# Input variables (when CURL_USE_PKGCONFIG=OFF): +# +# NETTLE_INCLUDE_DIR The nettle include directory +# NETTLE_LIBRARY Path to nettle library +# +# Result variables: # # NETTLE_FOUND System has nettle # NETTLE_INCLUDE_DIRS The nettle include directories diff --git a/CMake/FindQUICHE.cmake b/CMake/FindQUICHE.cmake index c2d08f9f7d..3da45468b0 100644 --- a/CMake/FindQUICHE.cmake +++ b/CMake/FindQUICHE.cmake @@ -23,7 +23,12 @@ ########################################################################### # Find the quiche library # -# Result Variables: +# Input variables: +# +# QUICHE_INCLUDE_DIR The quiche include directory +# QUICHE_LIBRARY Path to quiche library +# +# Result variables: # # QUICHE_FOUND System has quiche # QUICHE_INCLUDE_DIRS The quiche include directories @@ -35,7 +40,7 @@ if(CURL_USE_PKGCONFIG) pkg_check_modules(PC_QUICHE "quiche") endif() -find_path(QUICHE_INCLUDE_DIR "quiche.h" +find_path(QUICHE_INCLUDE_DIR NAMES "quiche.h" HINTS ${PC_QUICHE_INCLUDEDIR} ${PC_QUICHE_INCLUDE_DIRS} diff --git a/CMake/FindWolfSSH.cmake b/CMake/FindWolfSSH.cmake index fba4a450e7..608e3abfc5 100644 --- a/CMake/FindWolfSSH.cmake +++ b/CMake/FindWolfSSH.cmake @@ -23,14 +23,19 @@ ########################################################################### # Find the wolfssh library # -# Result Variables: +# Input variables: +# +# WOLFSSH_INCLUDE_DIR The wolfssh include directory +# WOLFSSH_LIBRARY Path to wolfssh library +# +# Result variables: # # WOLFSSH_FOUND System has wolfssh # WOLFSSH_INCLUDE_DIRS The wolfssh include directories # WOLFSSH_LIBRARIES The wolfssh library names # WOLFSSH_VERSION Version of wolfssh -find_path(WOLFSSH_INCLUDE_DIR "wolfssh/ssh.h") +find_path(WOLFSSH_INCLUDE_DIR NAMES "wolfssh/ssh.h") find_library(WOLFSSH_LIBRARY NAMES "wolfssh" "libwolfssh") if(WOLFSSH_INCLUDE_DIR AND EXISTS "${WOLFSSH_INCLUDE_DIR}/wolfssh/version.h") diff --git a/CMake/FindWolfSSL.cmake b/CMake/FindWolfSSL.cmake index 3189dc7c20..905fbfd5d6 100644 --- a/CMake/FindWolfSSL.cmake +++ b/CMake/FindWolfSSL.cmake @@ -23,7 +23,14 @@ ########################################################################### # Find the wolfssl library # -# Result Variables: +# Input variables: +# +# WOLFSSL_INCLUDE_DIR The wolfssl include directory +# WolfSSL_INCLUDE_DIR The wolfssl include directory (deprecated) +# WOLFSSL_LIBRARY Path to wolfssl library +# WolfSSL_LIBRARY Path to wolfssl library (deprecated) +# +# Result variables: # # WOLFSSL_FOUND System has wolfssl # WOLFSSL_INCLUDE_DIRS The wolfssl include directories @@ -41,7 +48,7 @@ endif() if(CURL_USE_PKGCONFIG) find_package(PkgConfig QUIET) - pkg_check_modules(PC_WOLFSSL QUIET "wolfssl") + pkg_check_modules(PC_WOLFSSL "wolfssl") endif() find_path(WOLFSSL_INCLUDE_DIR NAMES "wolfssl/ssl.h" diff --git a/CMake/FindZstd.cmake b/CMake/FindZstd.cmake index 82fba01112..10558ccc49 100644 --- a/CMake/FindZstd.cmake +++ b/CMake/FindZstd.cmake @@ -23,7 +23,14 @@ ########################################################################### # Find the zstd library # -# Result Variables: +# Input variables: +# +# ZSTD_INCLUDE_DIR The zstd include directory +# Zstd_INCLUDE_DIR The zstd include directory (deprecated) +# ZSTD_LIBRARY Path to zstd library +# Zstd_LIBRARY Path to zstd library (deprecated) +# +# Result variables: # # ZSTD_FOUND System has zstd # ZSTD_INCLUDE_DIRS The zstd include directories @@ -44,7 +51,7 @@ if(CURL_USE_PKGCONFIG) pkg_check_modules(PC_ZSTD "libzstd") endif() -find_path(ZSTD_INCLUDE_DIR "zstd.h" +find_path(ZSTD_INCLUDE_DIR NAMES "zstd.h" HINTS ${PC_ZSTD_INCLUDEDIR} ${PC_ZSTD_INCLUDE_DIRS} diff --git a/CMake/Findrustls.cmake b/CMake/Findrustls.cmake index d45330c8d7..ebd1c9fe25 100644 --- a/CMake/Findrustls.cmake +++ b/CMake/Findrustls.cmake @@ -23,7 +23,12 @@ ########################################################################### # Find the rustls library # -# Result Variables: +# Input variables: +# +# RUSTLS_INCLUDE_DIR The rustls include directory +# RUSTLS_LIBRARY Path to rustls library +# +# Result variables: # # RUSTLS_FOUND System has rustls # RUSTLS_INCLUDE_DIRS The rustls include directories @@ -35,13 +40,13 @@ if(CURL_USE_PKGCONFIG) pkg_check_modules(PC_RUSTLS "rustls") endif() -find_path(RUSTLS_INCLUDE_DIR "rustls.h" +find_path(RUSTLS_INCLUDE_DIR NAMES "rustls.h" HINTS ${PC_RUSTLS_INCLUDEDIR} ${PC_RUSTLS_INCLUDE_DIRS} ) -find_library(RUSTLS_LIBRARY "rustls" +find_library(RUSTLS_LIBRARY NAMES "rustls" HINTS ${PC_RUSTLS_LIBDIR} ${PC_RUSTLS_LIBRARY_DIRS}