curl-curl/.github/workflows
Viktor Szakats 8fce3e17e6
cmake: add CMake Config-based dependency detection
After limiting `find_package()`/`find_dependency()` calls to curl local
Find modules via the `MODULES` keyword, it became possible to detect
dependencies via CMake Configs from within those local Find modules, by
calling `find_package()` again with the `CONFIG` keyword. This patch
implements this. Then maps detection results to the result variables and
curl-specific imported targets the rest of the build expects.

Also honor recently introduced `*_USE_STATIC_LIBS` (experimental) flags
to map to the static target when requested.

This adds CMake Configs as an alternative to the existing `pkg-config`
and `find_path()`/`find_library()` auto-detection methods.

Enabled by default for MSVC, outside vcpkg and when not cross-building.
To enable for other cases, or override the default, you can use
`-DCURL_USE_CMAKECONFIG=ON` or `OFF`.

When enabled, Config detection happens after `pkg-config` and before
`find_path()`/`find_library()`. Using CMake's built-in options, you may
also manually point to the absolute directory holding Config files:

`Libssh2_DIR`, `MbedTLS_DIR`, `NGHTTP2_DIR`, `NGHTTP3_DIR`,
`NGTCP2_DIR` v1.19.0+ (with non-fork OpenSSL only), `Zstd_DIR` v1.4.5+

E.g. `-DMbedTLS_DIR=/path/to/mbedtls/lib/cmake/MbedTLS`

These dependencies typically need to be built with CMake to support
this.

Tagged as experimental.

Refs:
#20013 #19156 #19117
https://github.com/curl/curl/pull/20784#issuecomment-3984318492

Depends-on: fad1ebaecc #20840
Follow-up to 91e06fde1b #20784
Follow-up to 26c39d8df1 #20015

Closes #20814
2026-03-21 18:52:31 +01:00
..
appveyor-status.yml GHA: switch 12 Linux jobs to arm64 2026-01-09 19:35:16 +01:00
checkdocs.yml badwords: dedupe invocation into a runnable script 2026-03-10 17:44:15 +01:00
checksrc.yml badwords: dedupe invocation into a runnable script 2026-03-10 17:44:15 +01:00
checkurls.yml GHA: bump GHA and pip dependencies 2026-02-01 16:40:37 +01:00
codeql.yml rtmp: drop support 2026-03-21 14:56:06 +01:00
configure-vs-cmake.yml cmake: add CMake Config-based dependency detection 2026-03-21 18:52:31 +01:00
curl-for-win.yml GHA: bump GHA and pip dependencies 2026-02-01 16:40:37 +01:00
distcheck.yml cmake: fix building with CMAKE_FIND_PACKAGE_PREFER_CONFIG=ON 2026-03-03 16:33:21 +01:00
fuzz.yml GHA: silence fresh zizmor 1.21.0 warnings 2026-01-16 13:48:28 +01:00
http3-linux.yml GHA: add NTLM to lots of builds 2026-03-21 15:30:04 +01:00
label.yml GHA: use ubuntu-slim image in 3 jobs 2026-01-25 18:54:12 +01:00
linux-old.yml rtmp: drop support 2026-03-21 14:56:06 +01:00
linux.yml GHA: add NTLM to lots of builds 2026-03-21 15:30:04 +01:00
macos.yml GHA: add NTLM to lots of builds 2026-03-21 15:30:04 +01:00
non-native.yml GHA: add NTLM to lots of builds 2026-03-21 15:30:04 +01:00
windows.yml GHA: add NTLM to lots of builds 2026-03-21 15:30:04 +01:00