curl-curl/docs
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
..
cmdline-opts rtmp: drop support 2026-03-21 14:56:06 +01:00
examples cmake: drop support for CMake 3.17 and older 2026-03-21 13:24:47 +01:00
internals badwords: prefer 'null-terminated' 2026-03-18 11:40:13 +01:00
libcurl rtmp: drop support 2026-03-21 14:56:06 +01:00
tests docs: minor wording tweaks 2026-03-11 08:46:01 +01:00
.gitignore docs: add RELEASE-TOOLS.md.dist to .gitignore 2024-07-01 22:49:55 +02:00
ALTSVC.md docs: fold long lines 2025-12-11 11:42:28 +01:00
BINDINGS.md docs: some nitpicks 2026-02-27 23:05:37 +01:00
BUG-BOUNTY.md BUG-BOUNTY.md: minor rephrase to say there is no bug bounty 2026-03-10 17:34:08 +01:00
BUGS.md docs: avoid using the word 'magic' 2026-03-03 15:32:13 +01:00
CIPHERS-TLS12.md docs: update CIPHERS.md 2024-08-12 23:35:56 +02:00
CIPHERS.md docs: avoid starting sentences with However, 2026-03-07 23:49:11 +01:00
CMakeLists.txt tests: move test docs into /docs 2025-05-28 15:00:03 +02:00
CODE_OF_CONDUCT.md tidy-up: Markdown, clang-format nits 2026-01-22 23:44:47 +01:00
CODE_REVIEW.md docs: fix broken link in CODE_REVIEW.md 2025-06-21 10:32:06 +02:00
CONTRIBUTE.md badwords: avoid 'simply' 2026-03-10 19:34:06 +01:00
curl-config.md docs: minor edits to please the new spellchecker regime 2025-02-27 13:15:21 +01:00
CURL-DISABLE.md build: make NTLM disabled by default 2026-03-21 15:30:03 +01:00
CURLDOWN.md stop using the word 'just' 2026-03-03 15:30:22 +01:00
DEPRECATE.md DEPRECATE: remove last empty line 2026-03-21 15:18:33 +01:00
DISTROS.md docs: add LibreELEC to DISTROS.md 2026-01-26 12:12:05 -08:00
EARLY-RELEASE.md stop using the word 'just' 2026-03-03 15:30:22 +01:00
ECH.md dnscache: own source file, improvements 2026-03-21 12:04:36 +01:00
EXPERIMENTAL.md docs/EXPERIMENTAL.md: add a mention of HTTPSRR as experimental 2025-01-16 19:41:42 +01:00
FAQ.md rtmp: drop support 2026-03-21 14:56:06 +01:00
FEATURES.md tidy-up: miscellaneous 2026-01-20 12:37:56 +01:00
GOVERNANCE.md docs: avoid starting sentences with However, 2026-03-07 23:49:11 +01:00
HELP-US.md tidy-up: miscellaneous 2026-01-15 13:06:13 +01:00
HISTORY.md rtmp: drop support 2026-03-21 14:56:06 +01:00
HSTS.md tidy-up: miscellaneous 2026-01-20 12:37:56 +01:00
HTTP3.md configure: fix --with-ngtcp2=<path> option for crypto libs 2026-03-17 14:37:53 +01:00
HTTP-COOKIES.md stop using the word 'just' 2026-03-03 15:30:22 +01:00
HTTPSRR.md badwords: avoid 'simply' 2026-03-10 19:34:06 +01:00
INFRASTRUCTURE.md BUG-BOUNTY.md: we stop the bug-bounty end of Jan 2026 2026-01-26 08:26:28 +01:00
INSTALL INSTALL: converted to markdown => INSTALL.md 2016-10-21 15:57:29 +02:00
INSTALL-CMAKE.md cmake: add CMake Config-based dependency detection 2026-03-21 18:52:31 +01:00
INSTALL.md rtmp: drop support 2026-03-21 14:56:06 +01:00
INTERNALS.md cmake: drop support for CMake 3.17 and older 2026-03-21 13:24:47 +01:00
IPFS.md stop using the word 'just' 2026-03-03 15:30:22 +01:00
KNOWN_BUGS.md docs: avoid starting sentences with However, 2026-03-07 23:49:11 +01:00
KNOWN_RISKS.md stop using the word 'just' 2026-03-03 15:30:22 +01:00
MAIL-ETIQUETTE.md badwords: avoid 'simply' 2026-03-10 19:34:06 +01:00
Makefile.am tidy-up: miscellaneous 2026-01-15 13:06:13 +01:00
MANUAL.md badwords: avoid 'simply' 2026-03-10 19:34:06 +01:00
mk-ca-bundle.md stop using the word 'just' 2026-03-03 15:30:22 +01:00
options-in-versions tool_getparam: add --knownhosts 2025-10-06 13:41:22 +02:00
README.md reuse: add copyright + license info to individual docs/*.md files 2024-03-31 12:01:18 +02:00
RELEASE-PROCEDURE.md RELEASE-PROCEDURE.md: update future release dates 2026-01-26 12:28:25 +01:00
ROADMAP.md CI: add whitespace checker 2024-06-27 13:33:30 +02:00
runtests.md badwords: avoid 'simply' 2026-03-10 19:34:06 +01:00
RUSTLS.md tidy-up: URLs 2025-09-23 00:34:46 +02:00
SECURITY-ADVISORY.md stop using the word 'just' 2026-03-03 15:30:22 +01:00
SPONSORS.md BUG-BOUNTY.md: we stop the bug-bounty end of Jan 2026 2026-01-26 08:26:28 +01:00
SSL-PROBLEMS.md tidy-up: Markdown, clang-format nits 2026-01-22 23:44:47 +01:00
SSLCERTS.md tidy-up: miscellaneous 2025-12-12 04:18:48 +01:00
testcurl.md tidy-up: Markdown, clang-format nits 2026-01-22 23:44:47 +01:00
THANKS THANKS: add contributors from 8.19.0 release 2026-03-11 07:46:12 +01:00
THANKS-filter THANKS-filter: update with a new entry 2026-03-09 11:35:19 +01:00
TheArtOfHttpScripting.md badwords: avoid 'simply' 2026-03-10 19:34:06 +01:00
TODO.md docs: avoid starting sentences with However, 2026-03-07 23:49:11 +01:00
URL-SYNTAX.md rtmp: drop support 2026-03-21 14:56:06 +01:00
VERSIONS.md VERSIONS: add 8.19.0 2026-03-11 07:46:12 +01:00
VULN-DISCLOSURE-POLICY.md BUG-BOUNTY.md: minor rephrase to say there is no bug bounty 2026-03-10 17:34:08 +01:00
wcurl.md badwords: avoid 'simply' 2026-03-10 19:34:06 +01:00

curl logo

Documentation

You find a mix of various documentation in this directory and subdirectories, using several different formats. Some of them are not ideal for reading directly in your browser.

If you would rather see the rendered version of the documentation, check out the curl website's documentation section for general curl stuff or the libcurl section for libcurl related documentation.