From: Viktor Szakats Date: Tue, 30 Jul 2024 08:52:32 +0000 (+0200) Subject: cmake: drop `if(PKG_CONFIG_FOUND)` guard for `pkg_check_modules()` X-Git-Tag: curl-8_9_1~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b92ead34dd027c5c3315e9f992474234dbd88412;p=thirdparty%2Fcurl.git cmake: drop `if(PKG_CONFIG_FOUND)` guard for `pkg_check_modules()` The oldest cmake supported by curl is v3.7.0, which already has such guard (using `PKG_CONFIG_EXECUTABLE`) inside `pkg_check_modules()`. The advantage of leaving that guard to CMake is that it will define/reset all output variables, while the manual guard doesn't do this and also leaves for example `NETTLE_FOUND` undefined. Delete the single use of this guard from the recently added `nettle` detection, where I included it by accident. Then possibly re-introduce it universally if we find it useful after more evaluation. Follow-up to 669ce42275635dc1f881dab3dfc9a55c9ab49b21 #14285 Closes #14309 --- diff --git a/CMake/FindNettle.cmake b/CMake/FindNettle.cmake index ec6d4cbd6e..96d7d6f6a6 100644 --- a/CMake/FindNettle.cmake +++ b/CMake/FindNettle.cmake @@ -30,9 +30,7 @@ if(UNIX) find_package(PkgConfig QUIET) - if(PKG_CONFIG_FOUND) - pkg_check_modules(NETTLE "nettle") - endif() + pkg_check_modules(NETTLE "nettle") endif() if(NETTLE_FOUND)