mirror of
https://github.com/curl/curl.git
synced 2026-04-14 22:41:40 +03:00
build: cmake multi-pkg-config detection improvements (brotli, ldap, mbedtls)
Apply downstream patch from the vcpkg project: - cmake/FindBrotli: streamline detecting multiple pkg-config modules. Add `libbrotlicommon` to `Requires.private` in `libcurl.pc`. Apply the above idea to the rest of multi-module dependencies: - cmake/FindMbedTLS: streamline detecting multiple pkg-config modules Add `mbedx509`, `mbedcrypto` to `Requires.private` in `libcurl.pc`. - cmake/FindLDAP: streamline detecting multiple pkg-config modules And sync these changes with autotools, and add `libbrotlicommon`, `mbedx509`, `mbedcrypto` to `Requires.private`. Co-authored-by: Kai Pastor Ref: https://github.com/microsoft/vcpkg/pull/43819 Closes #16479
This commit is contained in:
parent
f4831daa9b
commit
3b501976a9
5 changed files with 9 additions and 26 deletions
|
|
@ -46,7 +46,7 @@ if(DEFINED MBEDTLS_INCLUDE_DIRS AND NOT DEFINED MBEDTLS_INCLUDE_DIR)
|
|||
unset(MBEDTLS_INCLUDE_DIRS)
|
||||
endif()
|
||||
|
||||
set(MBEDTLS_PC_REQUIRES "mbedtls")
|
||||
set(MBEDTLS_PC_REQUIRES "mbedtls" "mbedx509" "mbedcrypto")
|
||||
|
||||
if(CURL_USE_PKGCONFIG AND
|
||||
NOT DEFINED MBEDTLS_INCLUDE_DIR AND
|
||||
|
|
@ -55,16 +55,10 @@ if(CURL_USE_PKGCONFIG AND
|
|||
NOT DEFINED MBEDCRYPTO_LIBRARY)
|
||||
find_package(PkgConfig QUIET)
|
||||
pkg_check_modules(MBEDTLS ${MBEDTLS_PC_REQUIRES})
|
||||
pkg_check_modules(MBEDX509 "mbedx509")
|
||||
pkg_check_modules(MBEDCRYPTO "mbedcrypto")
|
||||
endif()
|
||||
|
||||
if(MBEDTLS_FOUND AND MBEDX509_FOUND AND MBEDCRYPTO_FOUND)
|
||||
if(MBEDTLS_FOUND)
|
||||
set(MbedTLS_FOUND TRUE)
|
||||
list(APPEND MBEDTLS_LIBRARIES ${MBEDX509_LIBRARIES} ${MBEDCRYPTO_LIBRARIES})
|
||||
list(REVERSE MBEDTLS_LIBRARIES)
|
||||
list(REMOVE_DUPLICATES MBEDTLS_LIBRARIES)
|
||||
list(REVERSE MBEDTLS_LIBRARIES)
|
||||
string(REPLACE ";" " " MBEDTLS_CFLAGS "${MBEDTLS_CFLAGS}")
|
||||
message(STATUS "Found MbedTLS (via pkg-config): ${MBEDTLS_INCLUDE_DIRS} (found version \"${MBEDTLS_VERSION}\")")
|
||||
else()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue