cmake: tidy up Find modules

Smoothen out minor differences between Find modules.

- brotli, nghttp2: drop redundant `FOUND_VAR` specifiers from
  `find_package_handle_standard_args()` calls.
  This function sets both `<NAME_UPPER>_FOUND` and `<NAME>_FOUND`
  by default.

- brotli: set result vars only when found.

- brotli: add missing `mark_as_advanced()` call.

- brotli: delete custom fail message.

- mbedtls, bearssl: use `REQUIRED_VARS` instead of `DEFAULT_MSG`.

- msh3, quiche: set `<NAME>_VERSION` (via pkg-config).

- wolfssl: also use `PC_WOLFSSL_INCLUDEDIR`, `PC_WOLFSSL_LIBDIR`
  as hints.

- libpsl, libssh2, zstd: clear temporary variables used for version
  detection.

- gss, msh3, nghttp2, nghttp3, ngtcp2, quiche, zstd: fix to apply
  `mark_as_advanced()` to internal variables only.

Closes #14538
This commit is contained in:
Viktor Szakats 2024-08-13 22:31:21 +02:00
parent 5abfe451be
commit 65f5caee05
No known key found for this signature in database
GPG key ID: B5ABD165E2AEF201
13 changed files with 43 additions and 23 deletions

View file

@ -38,11 +38,12 @@ find_library(MBEDCRYPTO_LIBRARY "mbedcrypto")
set(MBEDTLS_LIBRARIES "${MBEDTLS_LIBRARY}" "${MBEDX509_LIBRARY}" "${MBEDCRYPTO_LIBRARY}")
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(MbedTLS DEFAULT_MSG
MBEDTLS_INCLUDE_DIRS
MBEDTLS_LIBRARY
MBEDX509_LIBRARY
MBEDCRYPTO_LIBRARY
find_package_handle_standard_args(MbedTLS
REQUIRED_VARS
MBEDTLS_INCLUDE_DIRS
MBEDTLS_LIBRARY
MBEDX509_LIBRARY
MBEDCRYPTO_LIBRARY
)
mark_as_advanced(MBEDTLS_INCLUDE_DIRS MBEDTLS_LIBRARY MBEDX509_LIBRARY MBEDCRYPTO_LIBRARY)