cmake: tidy up and document feature detections in dependencies

- update text on dependency feature detection variables, and move it
  to its own section in `docs/INSTALL-CMAKE.md`.
  Ref: #17032 (Discussion)

- tidy up descriptions/comments, alpha-sort.

- move comment to its own section in `docs/INSTALL-CMAKE.md`.

- split `HAVE_SSL_SET_QUIC_USE_LEGACY_CODEPOINT` to distinct names for
  each TLS backend API. To make the names more stable and to sync them
  with autotools.
  Follow-up to 07cc50f8eb #17018
  Follow-up to 342a654ef3 #15873

- drop redundant condition while detecting QUICTLS API.
  Follow-up to 07cc50f8eb #17018

- add config-comparison exception for `HAVE_SSL_SET_QUIC_TLS_CBS`.
  Follow-up to 5eefdd71a3 #17027

- detect `wolfSSL_get_peer_certificate` like autotools does.

- detect `wolfSSL_UseALPN` like autotools does.

Closes #17082
This commit is contained in:
Viktor Szakats 2025-04-17 10:07:30 +02:00
parent 7bf576064c
commit 4bfc379b90
No known key found for this signature in database
GPG key ID: B5ABD165E2AEF201
4 changed files with 61 additions and 31 deletions

View file

@ -464,6 +464,43 @@ Details via CMake
- `TEST_NGHTTPX`: Default: `nghttpx`
- `VSFTPD`: Default: `vsftps`
## Feature detection variables
By default this CMake build script detects the version of some dependencies
using `check_symbol_exists`. Those checks do not work in the case that both
CURL and its dependency are included as sub-projects in a larger build using
`FetchContent`. To support that case, additional variables may be defined by
the parent project, ideally in the "extra" find package redirect file:
<https://cmake.org/cmake/help/latest/module/FetchContent.html#integrating-with-find-package>
Available variables:
- `HAVE_GNUTLS_SRP`: `gnutls_srp_verifier` present in GnuTLS.
- `HAVE_GSS_C_NT_HOSTBASED_SERVICE`: `GSS_C_NT_HOSTBASED_SERVICE` present in GSS/Heimdal/Kerberos.
- `HAVE_LDAP_INIT_FD`: `ldap_init_fd` present in LDAP library.
- `HAVE_LDAP_URL_PARSE`: `ldap_url_parse` present in LDAP library.
- `HAVE_OPENSSL_SRP`: `SSL_CTX_set_srp_username` present in OpenSSL (or fork).
- `HAVE_QUICHE_CONN_SET_QLOG_FD`: `quiche_conn_set_qlog_fd` present in quiche.
- `HAVE_RUSTLS_SUPPORTED_HPKE`: `rustls_supported_hpke` present in Rustls (unused if Rustls is detected via `pkg-config`).
- `HAVE_SSL_SET0_WBIO`: `SSL_set0_wbio` present in OpenSSL (or fork).
- `HAVE_SSL_SET1_ECH_CONFIG_LIST`: `SSL_set1_ech_config_list` present in OpenSSL (or fork).
- `HAVE_SSL_SET_QUIC_TLS_CBS`: `SSL_set_quic_tls_cbs` in OpenSSL.
- `HAVE_SSL_SET_QUIC_USE_LEGACY_CODEPOINT`: `SSL_set_quic_use_legacy_codepoint` in OpenSSL fork.
- `HAVE_WOLFSSL_BIO`: `wolfSSL_BIO_new` present in wolfSSL.
- `HAVE_WOLFSSL_CTX_GENERATEECHCONFIG`: `wolfSSL_CTX_GenerateEchConfig` present in wolfSSL.
- `HAVE_WOLFSSL_DES_ECB_ENCRYPT`: `wolfSSL_DES_ecb_encrypt` present in wolfSSL.
- `HAVE_WOLFSSL_FULL_BIO`: `wolfSSL_BIO_set_shutdown` present in wolfSSL.
- `HAVE_WOLFSSL_GET_PEER_CERTIFICATE`: `wolfSSL_get_peer_certificate` present in wolfSSL.
- `HAVE_WOLFSSL_SET_QUIC_USE_LEGACY_CODEPOINT`:
`wolfSSL_set_quic_use_legacy_codepoint` present in wolfSSL.
- `HAVE_WOLFSSL_USEALPN`: `wolfSSL_UseALPN` present in wolfSSL.
For each of the above variables, if the variable is *defined* (either to `ON`
or `OFF`), the symbol detection is skipped. If the variable is *not defined*,
the feature detection is performed.
Note: These variables are internal and subject to change.
# Migrating from Visual Studio IDE Project Files
We recommend using CMake to build curl with MSVC.