curl/CMake
Viktor Szakats 9dfdc6ff42
cmake: allow pkg-config in more envs
Before this patch, `pkg-config` was used for `UNIX` builds only (with
a few exceptions like wolfSSL, libssh, gsasl, libuv). This patch extends
`pkg-config` use to all envs except: `MSVC` without vcpkg. Meaning MSVC
with vcpkg will now use it. Also mingw on Windows.

Also apply the new condition to options where `pkg-config` was used
unconditionally (= for all targets). These are:
`-DCURL_USE_WOLFSSL=ON`, `-DCURL_USE_LIBSSH=ON`,
`-DCURL_USE_GSASL=ON` and `-DCURL_USE_LIBUV=ON`

This patch may still cause regressions for cross-builds (e.g. mingw
cross-build from Unix) and potentially other cases. If that happens, we
recommend using some of these methods to explicitly disable `pkg-config`
when using CMake:
- CMake option: `-DPKG_CONFIG_EXECUTABLE=`
  (or `-DPKG_CONFIG_EXECUTABLE=nonexistent` or similar)
  This is similar to the (curl-specific) `PKG_CONFIG` env for autotools.
- export env: `PKG_CONFIG_LIBDIR=`
  (or `PKG_CONFIG_PATH`, `PKG_CONFIG_SYSROOT_DIR`,
  or the CMake-specific `PKG_CONFIG`)

We may improve control over this in a future patch, also allowing opting
in MSVC (without vcpkg).

Ref: #14405
Ref: #14408
Ref: #14140
Closes #14483
2024-08-12 14:57:10 +02:00
..
Platforms build: tidy up __builtin_available feature checks (Apple) 2024-07-10 11:42:46 +02:00
cmake_uninstall.cmake.in cmake: more small tidy-ups and fixes 2024-08-08 13:48:28 +02:00
CMakeConfigurableFile.in copyright: update all copyright lines and remove year ranges 2023-01-03 09:19:21 +01:00
curl-config.cmake.in cmake: bring curl-config.cmake closer to FindCURL 2024-06-13 11:17:32 +02:00
CurlSymbolHiding.cmake cmake: more small tidy-ups and fixes 2024-08-08 13:48:28 +02:00
CurlTests.c cmake: tidy-ups 2024-08-03 20:49:15 +02:00
FindBearSSL.cmake cmake: more syntax tidy-up 2024-08-07 23:41:27 +02:00
FindBrotli.cmake cmake: more syntax tidy-up 2024-08-07 23:41:27 +02:00
FindCARES.cmake cmake: more syntax tidy-up 2024-08-07 23:41:27 +02:00
FindGSS.cmake cmake: allow pkg-config in more envs 2024-08-12 14:57:10 +02:00
FindLibPSL.cmake cmake: more syntax tidy-up 2024-08-07 23:41:27 +02:00
FindLibSSH2.cmake cmake: more syntax tidy-up 2024-08-07 23:41:27 +02:00
FindMbedTLS.cmake cmake: more syntax tidy-up 2024-08-07 23:41:27 +02:00
FindMSH3.cmake cmake: allow pkg-config in more envs 2024-08-12 14:57:10 +02:00
FindNettle.cmake cmake: allow pkg-config in more envs 2024-08-12 14:57:10 +02:00
FindNGHTTP2.cmake cmake: allow pkg-config in more envs 2024-08-12 14:57:10 +02:00
FindNGHTTP3.cmake cmake: allow pkg-config in more envs 2024-08-12 14:57:10 +02:00
FindNGTCP2.cmake cmake: allow pkg-config in more envs 2024-08-12 14:57:10 +02:00
FindQUICHE.cmake cmake: allow pkg-config in more envs 2024-08-12 14:57:10 +02:00
FindWolfSSL.cmake cmake: allow pkg-config in more envs 2024-08-12 14:57:10 +02:00
FindZstd.cmake cmake: allow pkg-config in more envs 2024-08-12 14:57:10 +02:00
Macros.cmake cmake: more syntax tidy-up 2024-08-07 23:41:27 +02:00
OtherTests.cmake cmake: more syntax tidy-up 2024-08-07 23:41:27 +02:00
PickyWarnings.cmake tidy-up: OS names 2024-08-04 19:17:45 +02:00
Utilities.cmake cmake: more syntax tidy-up 2024-08-07 23:41:27 +02:00