Skip to content

cmake: add CMake Config-based dependency detection for c-ares, wolfSSL - #21098

Closed
vszakats wants to merge 1 commit into
curl:masterfrom
vszakats:cm-more-config
Closed

vszakats wants to merge 1 commit into
curl:masterfrom
vszakats:cm-more-config

Conversation

@vszakats

@vszakats vszakats commented Mar 25, 2026 •

Copy link
Copy Markdown
Member

For wolfSSL it requires v5.2.1+, and with 5.9.0+ it's also supported when
wolfSSL was built with autotools.

Follow-up to 8fce3e1 #20814


https://github.com/curl/curl/pull/21098/files?w=1

…fSSL

For wolfSSL it requires v5.2.1+, and with 5.9.0+ it's also supported
when wolfSSL was built with autotools.

Follow-up to 8fce3e1 curl#20814
@vszakats vszakats changed the title cmake: add CMake Config-based dependency detection for c-ares and wolfSSL cmake: add CMake Config-based dependency detection for c-ares, wolfSSL Mar 25, 2026
@vszakats vszakats closed this in a56ab9d Mar 26, 2026
@vszakats
vszakats deleted the cm-more-config branch March 26, 2026 10:20
outcast36 pushed a commit to greearb/curl that referenced this pull request Jun 3, 2026
For wolfSSL it requires v5.2.1+, and with 5.9.0+ it's also supported when
wolfSSL was built with autotools.

Follow-up to 8fce3e1 curl#20814

Closes curl#21098
vszakats added a commit to libssh2/libssh2 that referenced this pull request Jul 9, 2026
After limiting `find_package()`/`find_dependency()` calls to libssh2
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 libssh2-specific imported targets the rest of the build
expects.

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
`-DLIBSSH2_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:

`MbedTLS_DIR`, `wolfssl_DIR`

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

mbedTLS needs to be built with CMake for this to work. wolfSSL 5.9.0+
also supports it when it was built with autotools.

Experimental.

Refs:
curl/curl@8fce3e1
curl/curl#20814
curl/curl@a56ab9d
curl/curl#21098

Follow-up to dd5f3ff #2262

Closes #2264
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

1 participant