]> git.ipfire.org Git - thirdparty/curl.git/commit
cmake: add and use local FindGnuTLS module
authorViktor Szakats <commit@vsz.me>
Mon, 20 Oct 2025 13:51:39 +0000 (15:51 +0200)
committerViktor Szakats <commit@vsz.me>
Tue, 21 Oct 2025 12:37:40 +0000 (14:37 +0200)
commit1966c86d71eb90beeeb3ccbefd6321bd64992553
treec04410676b45dfbf073ccac7cf2244b1265da695
parent9e198618dea14231488005b53c7800d4e80e2dce
cmake: add and use local FindGnuTLS module

Replacing a combination of custom logic in the main script and relying
on CMake's built-in Find module, with code and behavior used for
the rest of dependencies.

Also to:
- add version detection in the non-pkg-config path.
- make `GNUTLS_INCLUDE_DIR` and `GNUTLS_LIBRARY` take precedence over
  pkg-config. As with other dependencies.
- document the above two configuration options.
- prepare for #16973, which originally introduced this local Find
  module.

The local module is doing largely the same as CMake's built-in
FindGnuTLS. Differences:
- honors `CURL_USE_PKGCONFIG`.
- returns GnuTLS version for non-pkg-config detection.
- consistently returns `GNUTLS_VERSION`.
  (CMake's built-in uses s different name in <3.16.)
- CMake 3.16+ returns an imported target. curl supports 3.7,
  therefore we may only use it conditionally, which isn't worth it.

Cherry-picked from #16973

Closes #19163
CMake/FindGnuTLS.cmake [new file with mode: 0644]
CMakeLists.txt
Makefile.am
docs/INSTALL-CMAKE.md