INSTALL-CMAKE.md: CMake usage updates

This PR updates the CMake build/install docs in `docs/INSTALL-CMAKE.md`,
in particular focusing on the use of libcurl from CMake using
`find_package` as well as the newly added features/protocols support via
using `COMPONENTS` or `OPTIONAL_COMPONENTS` with `find_package`.
See #15854 for initial discussion and the corresponding PR #15858 that
was merged.

Some additional best-practices notes are added, for example:

* Encouraging building out-of-source
* Using `--config` with `cmake --build` for multi-config CMake
  generators, not `CMAKE_BUILD_TYPE`

We also add a CURL CMake-specific tip on using `CMAKE_INSTALL_PREFIX`
during configure time to set the install prefix, not using `--prefix`
when running `cmake --install` so `curl-config` output is consistent.

Closes #16329
This commit is contained in:
Derek Huang 2025-02-14 02:28:27 -05:00 committed by Viktor Szakats
parent 84332d49fb
commit af0100fc17
No known key found for this signature in database
GPG key ID: B5ABD165E2AEF201
2 changed files with 96 additions and 7 deletions

View file

@ -251,6 +251,7 @@ Feltzing
ffi
filesize
filesystem
FindCURL
FLOSS
fnmatch
footguns