1
0
mirror of https://github.com/libssh2/libssh2.git synced 2026-10-24 03:48:58 +03:00
Viktor Szakats 86dcc0ae40 cmake: add CMake Config-based dependency detection for mbedTLS, wolfSSL
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:
8fce3e17e6
https://github.com/curl/curl/pull/20814
a56ab9dbc8
https://github.com/curl/curl/pull/21098

Follow-up to dd5f3fff39 #2262

Closes #2264
2026-07-09 14:47:52 +02:00
2026-06-30 00:12:47 +02:00
2026-04-10 18:39:11 +02:00
2026-06-28 10:23:00 +02:00
2026-06-16 03:47:52 +02:00
2023-06-07 08:18:55 +02:00
2023-08-18 11:20:58 +00:00
2011-04-04 13:31:33 +02:00

libssh2 - SSH2 library

libssh2 is a library implementing the SSH2 protocol, available under the revised BSD license.

Web site

Mailing list

BSD Licensed

Web site source code

Installation instructions:

Description
libssh2 - это библиотека, реализующая протокол SSH2, доступная по пересмотренной лицензии BSD
Readme 26 MiB
Languages
C 84.2%
CMake 3.7%
Perl 3.2%
M4 2.7%
Shell 2.3%
Other 3.7%