From c555ab469d74756b0e3a21f797237d53f9334ce3 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Sat, 17 Aug 2024 01:08:45 +0200 Subject: [PATCH] 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 --- CMake/curl-config.cmake.in | 2 +- CMakeLists.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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)