From 3a2e47afb7d9ad99e612cd25e8e889667c2b5795 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Mon, 19 Aug 2024 12:31:11 +0200 Subject: [PATCH] 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 --- CMake/FindBearSSL.cmake | 2 +- CMake/FindNettle.cmake | 4 ++-- CMakeLists.txt | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) 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}) -- 2.47.3