curl/CMake
Viktor Szakats 432f2fd9ac
cmake: sync up version detection in Find modules
- use the same pattern across all Find modules:
  - verify if the version header exists before reading it.
  - use a single regex per lookup.
  - sync regexes between Find modules.
  - use generic temporary variable names.
  - improve readability.
  - make it simpler to transition to new CMake syntax in the future:
    ```cmake
    file(STRINGS "${CARES_INCLUDE_DIR}/ares_version.h" _version_str REGEX "<...>")
    unset(_version_str)
    set(CARES_VERSION "${CMAKE_MATCH_1}")
    ```
    Ref: https://cmake.org/cmake/help/latest/policy/CMP0159.html#policy:CMP0159

- fix zstd version detection to be CMake 3.7 compatible.
  Required 3.9 before this patch, for the `CMAKE_MATCH_<n>` feature.
  Follow-up to c5d506e9bb #12200

Follow-up to 4e2f3641f8 #14548

Closes #14572
2024-08-17 10:33:26 +02:00
..
Platforms build: tidy up __builtin_available feature checks (Apple) 2024-07-10 11:42:46 +02:00
cmake_uninstall.cmake.in cmake: more small tidy-ups and fixes 2024-08-08 13:48:28 +02:00
CMakeConfigurableFile.in copyright: update all copyright lines and remove year ranges 2023-01-03 09:19:21 +01:00
curl-config.cmake.in cmake: add CURL_USE_PKGCONFIG option 2024-08-13 09:28:27 +02:00
CurlSymbolHiding.cmake cmake: tidy-up continues 2024-08-17 00:32:38 +02:00
CurlTests.c cmake: tidy-ups 2024-08-03 20:49:15 +02:00
FindBearSSL.cmake cmake: tidy-up continues 2024-08-17 00:32:38 +02:00
FindBrotli.cmake cmake: revert to pkg_check_modules() 2024-08-17 00:31:52 +02:00
FindCARES.cmake cmake: revert to pkg_check_modules() 2024-08-17 00:31:52 +02:00
FindGSS.cmake cmake: tidy-up continues 2024-08-17 00:32:38 +02:00
FindLibPSL.cmake cmake: sync up version detection in Find modules 2024-08-17 10:33:26 +02:00
FindLibSSH2.cmake cmake: sync up version detection in Find modules 2024-08-17 10:33:26 +02:00
FindMbedTLS.cmake cmake: revert to pkg_check_modules() 2024-08-17 00:31:52 +02:00
FindMSH3.cmake cmake: revert to pkg_check_modules() 2024-08-17 00:31:52 +02:00
FindNettle.cmake cmake: sync up version detection in Find modules 2024-08-17 10:33:26 +02:00
FindNGHTTP2.cmake cmake: revert to pkg_check_modules() 2024-08-17 00:31:52 +02:00
FindNGHTTP3.cmake cmake: revert to pkg_check_modules() 2024-08-17 00:31:52 +02:00
FindNGTCP2.cmake cmake: tidy-up continues 2024-08-17 00:32:38 +02:00
FindQUICHE.cmake cmake: revert to pkg_check_modules() 2024-08-17 00:31:52 +02:00
Findrustls.cmake cmake: revert to pkg_check_modules() 2024-08-17 00:31:52 +02:00
FindWolfSSH.cmake cmake: sync up version detection in Find modules 2024-08-17 10:33:26 +02:00
FindWolfSSL.cmake cmake: sync up version detection in Find modules 2024-08-17 10:33:26 +02:00
FindZstd.cmake cmake: sync up version detection in Find modules 2024-08-17 10:33:26 +02:00
Macros.cmake cmake: more syntax tidy-up 2024-08-07 23:41:27 +02:00
OtherTests.cmake cmake: more syntax tidy-up 2024-08-07 23:41:27 +02:00
PickyWarnings.cmake tidy-up: OS names 2024-08-04 19:17:45 +02:00
Utilities.cmake cmake: more syntax tidy-up 2024-08-07 23:41:27 +02:00