From: Viktor Szakats Date: Fri, 16 Aug 2024 23:08:45 +0000 (+0200) Subject: cmake: limit `pkg-config` to UNIX and MSVC+vcpkg by default X-Git-Tag: curl-8_10_0~194 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c555ab469d74756b0e3a21f797237d53f9334ce3;p=thirdparty%2Fcurl.git cmake: limit `pkg-config` to UNIX and MSVC+vcpkg by default Limits `pkg-config` to UNIX and MSVC with vcpkg, by default. Compared to curl 8.9.1, this unlocks `pkg-config` on MSVC with vcpkg. This condition might be updated in the future depending on where `pkg-config` can be useful without breaking things. (e.g. to non-cross MINGW, or all MINGW). In the meantime everyone is free to override the default and test their build with `pkg-config` by setting the `CURL_USE_PKGCONFIG=ON` CMake option. Closes #14575 --- diff --git a/CMake/curl-config.cmake.in b/CMake/curl-config.cmake.in index 5be5d7103a..11f13d03f7 100644 --- a/CMake/curl-config.cmake.in +++ b/CMake/curl-config.cmake.in @@ -24,7 +24,7 @@ @PACKAGE_INIT@ if(NOT DEFINED CURL_USE_PKGCONFIG) - if(NOT MSVC OR VCPKG_TOOLCHAIN) + if(UNIX OR (MSVC AND VCPKG_TOOLCHAIN)) # Keep this in sync with root CMakeLists.txt set(CURL_USE_PKGCONFIG ON) else() set(CURL_USE_PKGCONFIG OFF) diff --git a/CMakeLists.txt b/CMakeLists.txt index abf6af30a7..269a6e286f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -208,7 +208,7 @@ else() endif() # Override to force-disable or force-enable the use of pkg-config. -if(NOT MSVC OR VCPKG_TOOLCHAIN) +if(UNIX OR (MSVC AND VCPKG_TOOLCHAIN)) # Keep this in sync with CMake/curl-config.cmake.in set(_curl_use_pkgconfig_default ON) else() set(_curl_use_pkgconfig_default OFF)