]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
cmake/FindNettle: skip `pkg-config` for custom configs
authorViktor Szakats <commit@vsz.me>
Sat, 17 Aug 2024 22:10:39 +0000 (00:10 +0200)
committerViktor Szakats <commit@vsz.me>
Mon, 19 Aug 2024 12:09:14 +0000 (14:09 +0200)
If either `NETTLE_INCLUDE_DIR` or `NETTLE_LIBRARY` is set to customize
the `nettle` dependency, skip `pkg-config` and use the CMake-native
detection to honor these custom settings.

Closes #14584

CMake/FindNettle.cmake

index 2cd691eb086a8b8d0af7116a8d99abefd808c603..33f3d915fb7f1a7fedff2ecdb477b0e30cf483ef 100644 (file)
@@ -23,7 +23,7 @@
 ###########################################################################
 # Find the nettle library
 #
-# Input variables (when CURL_USE_PKGCONFIG=OFF):
+# Input variables:
 #
 # NETTLE_INCLUDE_DIR   The nettle include directory
 # NETTLE_LIBRARY       Path to nettle library
@@ -35,7 +35,9 @@
 # NETTLE_LIBRARIES     The nettle library names
 # NETTLE_VERSION       Version of nettle
 
-if(CURL_USE_PKGCONFIG)
+if(CURL_USE_PKGCONFIG AND
+   NOT DEFINED NETTLE_INCLUDE_DIR AND
+   NOT DEFINED NETTLE_LIBRARY)
   find_package(PkgConfig QUIET)
   pkg_check_modules(NETTLE "nettle")
 endif()