mirror of
https://github.com/curl/curl.git
synced 2025-04-12 16:20:35 +08:00
cmake/Find: set <Modulename>_FOUND
for compatibility when found via pkg-config
For Find modules where `<Modulename>` is not fully uppercase. `<Modulename>` is case-exact name used in the Find modules filename: `CMake/Find<Moduleame>.cmake`. `find_package_handle_standard_args()` sets both `<MODULENAME>_FOUND` and `<Modulename>_FOUND` when detecting the dependency. Some CMake code relies on this and 3rd-party code may rely on it too. Make sure to set the latter variant when detecting the dependency via `pkg-config`, where we don't call `find_package_handle_standard_args()`. CMake sets these variable to `TRUE` (not `ON` or `1`). Replicate this for compatibility. Closes #16153
This commit is contained in:
parent
ffd6132da6
commit
2b9b3ec579
@ -51,6 +51,7 @@ if(CURL_USE_PKGCONFIG AND
|
||||
endif()
|
||||
|
||||
if(BROTLI_FOUND AND BROTLIDEC_FOUND)
|
||||
set(Brotli_FOUND TRUE)
|
||||
list(APPEND BROTLIDEC_LIBRARIES ${BROTLI_LIBRARIES}) # order is significant: brotlidec then brotlicommon
|
||||
list(REVERSE BROTLIDEC_LIBRARIES)
|
||||
list(REMOVE_DUPLICATES BROTLIDEC_LIBRARIES)
|
||||
|
@ -48,6 +48,7 @@ if(CURL_USE_PKGCONFIG AND
|
||||
endif()
|
||||
|
||||
if(CARES_FOUND)
|
||||
set(Cares_FOUND TRUE)
|
||||
string(REPLACE ";" " " CARES_CFLAGS "${CARES_CFLAGS}")
|
||||
message(STATUS "Found Cares (via pkg-config): ${CARES_INCLUDE_DIRS} (found version \"${CARES_VERSION}\")")
|
||||
else()
|
||||
|
@ -48,6 +48,7 @@ if(CURL_USE_PKGCONFIG AND
|
||||
endif()
|
||||
|
||||
if(LIBGSASL_FOUND)
|
||||
set(Libgsasl_FOUND TRUE)
|
||||
string(REPLACE ";" " " LIBGSASL_CFLAGS "${LIBGSASL_CFLAGS}")
|
||||
message(STATUS "Found Libgsasl (via pkg-config): ${LIBGSASL_INCLUDE_DIRS} (found version \"${LIBGSASL_VERSION}\")")
|
||||
else()
|
||||
|
@ -48,6 +48,7 @@ if(CURL_USE_PKGCONFIG AND
|
||||
endif()
|
||||
|
||||
if(LIBIDN2_FOUND)
|
||||
set(Libidn2_FOUND TRUE)
|
||||
string(REPLACE ";" " " LIBIDN2_CFLAGS "${LIBIDN2_CFLAGS}")
|
||||
message(STATUS "Found Libidn2 (via pkg-config): ${LIBIDN2_INCLUDE_DIRS} (found version \"${LIBIDN2_VERSION}\")")
|
||||
else()
|
||||
|
@ -48,6 +48,7 @@ if(CURL_USE_PKGCONFIG AND
|
||||
endif()
|
||||
|
||||
if(LIBPSL_FOUND AND LIBPSL_INCLUDE_DIRS)
|
||||
set(Libpsl_FOUND TRUE)
|
||||
string(REPLACE ";" " " LIBPSL_CFLAGS "${LIBPSL_CFLAGS}")
|
||||
message(STATUS "Found Libpsl (via pkg-config): ${LIBPSL_INCLUDE_DIRS} (found version \"${LIBPSL_VERSION}\")")
|
||||
else()
|
||||
|
@ -48,6 +48,7 @@ if(CURL_USE_PKGCONFIG AND
|
||||
endif()
|
||||
|
||||
if(LIBRTMP_FOUND AND LIBRTMP_INCLUDE_DIRS)
|
||||
set(Librtmp_FOUND TRUE)
|
||||
string(REPLACE ";" " " LIBRTMP_CFLAGS "${LIBRTMP_CFLAGS}")
|
||||
message(STATUS "Found Librtmp (via pkg-config): ${LIBRTMP_INCLUDE_DIRS} (found version \"${LIBRTMP_VERSION}\")")
|
||||
else()
|
||||
|
@ -48,6 +48,7 @@ if(CURL_USE_PKGCONFIG AND
|
||||
endif()
|
||||
|
||||
if(LIBSSH_FOUND)
|
||||
set(Libssh_FOUND TRUE)
|
||||
string(REPLACE ";" " " LIBSSH_CFLAGS "${LIBSSH_CFLAGS}")
|
||||
message(STATUS "Found Libssh (via pkg-config): ${LIBSSH_INCLUDE_DIRS} (found version \"${LIBSSH_VERSION}\")")
|
||||
else()
|
||||
|
@ -48,6 +48,7 @@ if(CURL_USE_PKGCONFIG AND
|
||||
endif()
|
||||
|
||||
if(LIBSSH2_FOUND AND LIBSSH2_INCLUDE_DIRS)
|
||||
set(Libssh2_FOUND TRUE)
|
||||
string(REPLACE ";" " " LIBSSH2_CFLAGS "${LIBSSH2_CFLAGS}")
|
||||
message(STATUS "Found Libssh2 (via pkg-config): ${LIBSSH2_INCLUDE_DIRS} (found version \"${LIBSSH2_VERSION}\")")
|
||||
else()
|
||||
|
@ -48,6 +48,7 @@ if(CURL_USE_PKGCONFIG AND
|
||||
endif()
|
||||
|
||||
if(LIBUV_FOUND)
|
||||
set(Libuv_FOUND TRUE)
|
||||
string(REPLACE ";" " " LIBUV_CFLAGS "${LIBUV_CFLAGS}")
|
||||
message(STATUS "Found Libuv (via pkg-config): ${LIBUV_INCLUDE_DIRS} (found version \"${LIBUV_VERSION}\")")
|
||||
else()
|
||||
|
@ -60,6 +60,7 @@ if(CURL_USE_PKGCONFIG AND
|
||||
endif()
|
||||
|
||||
if(MBEDTLS_FOUND AND MBEDX509_FOUND AND MBEDCRYPTO_FOUND)
|
||||
set(MbedTLS_FOUND TRUE)
|
||||
list(APPEND MBEDTLS_LIBRARIES ${MBEDX509_LIBRARIES} ${MBEDCRYPTO_LIBRARIES})
|
||||
list(REVERSE MBEDTLS_LIBRARIES)
|
||||
list(REMOVE_DUPLICATES MBEDTLS_LIBRARIES)
|
||||
|
@ -48,6 +48,7 @@ if(CURL_USE_PKGCONFIG AND
|
||||
endif()
|
||||
|
||||
if(NETTLE_FOUND)
|
||||
set(Nettle_FOUND TRUE)
|
||||
string(REPLACE ";" " " NETTLE_CFLAGS "${NETTLE_CFLAGS}")
|
||||
message(STATUS "Found Nettle (via pkg-config): ${NETTLE_INCLUDE_DIRS} (found version \"${NETTLE_VERSION}\")")
|
||||
else()
|
||||
|
@ -48,6 +48,7 @@ if(CURL_USE_PKGCONFIG AND
|
||||
endif()
|
||||
|
||||
if(QUICHE_FOUND)
|
||||
set(Quiche_FOUND TRUE)
|
||||
string(REPLACE ";" " " QUICHE_CFLAGS "${QUICHE_CFLAGS}")
|
||||
message(STATUS "Found Quiche (via pkg-config): ${QUICHE_INCLUDE_DIRS} (found version \"${QUICHE_VERSION}\")")
|
||||
else()
|
||||
|
@ -48,6 +48,7 @@ if(CURL_USE_PKGCONFIG AND
|
||||
endif()
|
||||
|
||||
if(RUSTLS_FOUND)
|
||||
set(Rustls_FOUND TRUE)
|
||||
string(REPLACE ";" " " RUSTLS_CFLAGS "${RUSTLS_CFLAGS}")
|
||||
message(STATUS "Found Rustls (via pkg-config): ${RUSTLS_INCLUDE_DIRS} (found version \"${RUSTLS_VERSION}\")")
|
||||
else()
|
||||
|
@ -57,6 +57,7 @@ if(CURL_USE_PKGCONFIG AND
|
||||
endif()
|
||||
|
||||
if(WOLFSSL_FOUND)
|
||||
set(WolfSSL_FOUND TRUE)
|
||||
string(REPLACE ";" " " WOLFSSL_CFLAGS "${WOLFSSL_CFLAGS}")
|
||||
message(STATUS "Found WolfSSL (via pkg-config): ${WOLFSSL_INCLUDE_DIRS} (found version \"${WOLFSSL_VERSION}\")")
|
||||
else()
|
||||
|
@ -57,6 +57,7 @@ if(CURL_USE_PKGCONFIG AND
|
||||
endif()
|
||||
|
||||
if(ZSTD_FOUND)
|
||||
set(Zstd_FOUND TRUE)
|
||||
string(REPLACE ";" " " ZSTD_CFLAGS "${ZSTD_CFLAGS}")
|
||||
message(STATUS "Found Zstd (via pkg-config): ${ZSTD_INCLUDE_DIRS} (found version \"${ZSTD_VERSION}\")")
|
||||
else()
|
||||
|
Loading…
x
Reference in New Issue
Block a user