From: Viktor Szakats Date: Mon, 19 Aug 2024 10:31:11 +0000 (+0200) Subject: cmake: fix Find module and package names X-Git-Tag: curl-8_10_0~196 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3a2e47afb7d9ad99e612cd25e8e889667c2b5795;p=thirdparty%2Fcurl.git cmake: fix Find module and package names - fix BearSSL warning about name mismatch. - fix Nettle Find module not found on Linux. - tidy-up: drop quotes from a package name. Package names must match case-sensitively to work on all platforms: - `find_package( ...)` in `CMakeLists.txt`. - `CMake/Find.cmake` filenames. - `find_package_handle_standard_args( ...` in Find modules. - `message(STATUS "Found ...` in Find modules. (to match the message shown by `find_package_handle_standard_args()`) Closes #14599 --- diff --git a/CMake/FindBearSSL.cmake b/CMake/FindBearSSL.cmake index 0487f80abe..dba4f5e608 100644 --- a/CMake/FindBearSSL.cmake +++ b/CMake/FindBearSSL.cmake @@ -45,7 +45,7 @@ find_path(BEARSSL_INCLUDE_DIR NAMES "bearssl.h") find_library(BEARSSL_LIBRARY NAMES "bearssl") include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(BEARSSL +find_package_handle_standard_args(BearSSL REQUIRED_VARS BEARSSL_INCLUDE_DIR BEARSSL_LIBRARY diff --git a/CMake/FindNettle.cmake b/CMake/FindNettle.cmake index d36194f7d1..e6f1544551 100644 --- a/CMake/FindNettle.cmake +++ b/CMake/FindNettle.cmake @@ -44,7 +44,7 @@ endif() if(NETTLE_FOUND) set(NETTLE_LIBRARIES ${NETTLE_LINK_LIBRARIES}) - message(STATUS "Found nettle (via pkg-config): ${NETTLE_INCLUDE_DIRS} (Found version \"${NETTLE_VERSION}\")") + message(STATUS "Found Nettle (via pkg-config): ${NETTLE_INCLUDE_DIRS} (Found version \"${NETTLE_VERSION}\")") else() find_path(NETTLE_INCLUDE_DIR NAMES "nettle/sha2.h") find_library(NETTLE_LIBRARY NAMES "nettle") @@ -64,7 +64,7 @@ else() endif() include(FindPackageHandleStandardArgs) - find_package_handle_standard_args("nettle" + find_package_handle_standard_args(Nettle REQUIRED_VARS NETTLE_INCLUDE_DIR NETTLE_LIBRARY diff --git a/CMakeLists.txt b/CMakeLists.txt index 4bc7681f2c..dfef954510 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -615,7 +615,7 @@ if(CURL_USE_GNUTLS) if(NOT GNUTLS_FOUND) find_package(GnuTLS REQUIRED) endif() - find_package(nettle REQUIRED) + find_package(Nettle REQUIRED) set(_ssl_enabled ON) set(USE_GNUTLS ON) list(APPEND CURL_LIBS ${GNUTLS_LIBRARIES} ${NETTLE_LIBRARIES})