From 83095ba6767f47c70eb6bd4013df51fe521f551c Mon Sep 17 00:00:00 2001 From: Kai Pastor Date: Sat, 29 Nov 2025 11:41:39 +0100 Subject: [PATCH 01/22] WIP [skip actions] --- ports/curl/portfile.cmake | 9 +++++---- ports/curl/vcpkg.json | 2 +- ports/curl/wip.diff | 12 ++++++++++++ 3 files changed, 18 insertions(+), 5 deletions(-) create mode 100644 ports/curl/wip.diff diff --git a/ports/curl/portfile.cmake b/ports/curl/portfile.cmake index d884af05e2e38c..fcc11c4a1306af 100644 --- a/ports/curl/portfile.cmake +++ b/ports/curl/portfile.cmake @@ -3,12 +3,13 @@ string(REPLACE "." "_" curl_version "curl-${VERSION}") vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO curl/curl - REF ${curl_version} - SHA512 ec2fa6c47d52feed943421b00e98370971bcc73b82842a85426ea9e42d36eaab51258a8d00197fdaaf5ec39e19385280fe387765f27e3b3dc1086c46236dc0bf + REF #[[ ${curl_version} ]] 16f073ef49f94412000218c9f6ad04e3fd7e4d01 + SHA512 21e1c19cf834375aca364b1417b32abacb5358db39d056fea26a04cd93c6a998b440ae23a0af01bad6c4b0b708fcb923354993d36d4dca39229c04b780e599bf HEAD_REF master PATCHES - dependencies.patch - pkgconfig-curl-config.patch + #dependencies.patch + #pkgconfig-curl-config.patch + wip.diff ) vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS diff --git a/ports/curl/vcpkg.json b/ports/curl/vcpkg.json index 1769b315486da4..47065a7130c20c 100644 --- a/ports/curl/vcpkg.json +++ b/ports/curl/vcpkg.json @@ -1,6 +1,6 @@ { "name": "curl", - "version": "8.17.0", + "version": "8.18.0", "description": "A library for transferring data with URLs", "homepage": "https://curl.se/", "license": "curl AND ISC AND BSD-3-Clause", diff --git a/ports/curl/wip.diff b/ports/curl/wip.diff new file mode 100644 index 00000000000000..152e61af9a0b0f --- /dev/null +++ b/ports/curl/wip.diff @@ -0,0 +1,12 @@ +diff --git a/CMake/curl-config.cmake.in b/CMake/curl-config.cmake.in +index 99949198a3..1951acd0b1 100644 +--- a/CMake/curl-config.cmake.in ++++ b/CMake/curl-config.cmake.in +@@ -125,6 +125,7 @@ if("@HAVE_ZSTD@") + find_dependency(Zstd) + list(APPEND _libs CURL::zstd) + endif() ++list(REMOVE_ITEM CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}") + + if(CMAKE_C_COMPILER_ID STREQUAL "GNU" AND WIN32 AND NOT TARGET CURL::win32_winsock) + add_library(CURL::win32_winsock INTERFACE IMPORTED) From 90498b5143e2b768ffec0394adeeed8e58249904 Mon Sep 17 00:00:00 2001 From: Kai Pastor Date: Sat, 6 Dec 2025 17:41:21 +0100 Subject: [PATCH 02/22] Move to rc1 --- ports/curl/portfile.cmake | 4 ++-- ports/curl/wip.diff | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/ports/curl/portfile.cmake b/ports/curl/portfile.cmake index fcc11c4a1306af..f46c992fba02da 100644 --- a/ports/curl/portfile.cmake +++ b/ports/curl/portfile.cmake @@ -3,8 +3,8 @@ string(REPLACE "." "_" curl_version "curl-${VERSION}") vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO curl/curl - REF #[[ ${curl_version} ]] 16f073ef49f94412000218c9f6ad04e3fd7e4d01 - SHA512 21e1c19cf834375aca364b1417b32abacb5358db39d056fea26a04cd93c6a998b440ae23a0af01bad6c4b0b708fcb923354993d36d4dca39229c04b780e599bf + REF #[[ ${curl_version} ]] rc-8_18_0-1 + SHA512 5223c84dc5fc48353e0743d7443e26dbe0c691241862f81cbcaf9ca009c65f9e1d5ead5b1ac70cc056e07fb1b6aa700a2e6a0878929fe82cbd7ac067249323f3 HEAD_REF master PATCHES #dependencies.patch diff --git a/ports/curl/wip.diff b/ports/curl/wip.diff index 152e61af9a0b0f..f9783870c2e58f 100644 --- a/ports/curl/wip.diff +++ b/ports/curl/wip.diff @@ -1,12 +1,12 @@ diff --git a/CMake/curl-config.cmake.in b/CMake/curl-config.cmake.in -index 99949198a3..1951acd0b1 100644 +index 7f346c832c..f400f55eec 100644 --- a/CMake/curl-config.cmake.in +++ b/CMake/curl-config.cmake.in -@@ -125,6 +125,7 @@ if("@HAVE_ZSTD@") +@@ -135,6 +135,7 @@ if("@HAVE_ZSTD@") find_dependency(Zstd) - list(APPEND _libs CURL::zstd) + list(APPEND _curl_libs CURL::zstd) endif() +list(REMOVE_ITEM CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}") - if(CMAKE_C_COMPILER_ID STREQUAL "GNU" AND WIN32 AND NOT TARGET CURL::win32_winsock) - add_library(CURL::win32_winsock INTERFACE IMPORTED) + set(CMAKE_MODULE_PATH ${_curl_cmake_module_path_save}) + From f02a553c5a8a002610cdd70cc22d93acd39ad776 Mon Sep 17 00:00:00 2001 From: Kai Pastor Date: Sat, 6 Dec 2025 17:42:12 +0100 Subject: [PATCH 03/22] Align with release tarballs --- ports/curl/portfile.cmake | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ports/curl/portfile.cmake b/ports/curl/portfile.cmake index f46c992fba02da..e887f2e28a3edc 100644 --- a/ports/curl/portfile.cmake +++ b/ports/curl/portfile.cmake @@ -11,6 +11,9 @@ vcpkg_from_github( #pkgconfig-curl-config.patch wip.diff ) +# The on-the-fly tarballs do not carry the details of release tarballs. +vcpkg_replace_string("${SOURCE_PATH}/include/curl/curlver.h" [[-DEV"]] [["]]) +vcpkg_replace_string("${SOURCE_PATH}/include/curl/curlver.h" [[LIBCURL_TIMESTAMP "[unreleased]"]] [[LIBCURL_TIMESTAMP "[vcpkg]"]]) vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS FEATURES From 5d30fdc53c5c4a21ae3387327bc72545faec84cd Mon Sep 17 00:00:00 2001 From: Kai Pastor Date: Sun, 7 Dec 2025 08:00:39 +0100 Subject: [PATCH 04/22] WIP [skip actions] --- ports/curl/wip.diff | 438 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 432 insertions(+), 6 deletions(-) diff --git a/ports/curl/wip.diff b/ports/curl/wip.diff index f9783870c2e58f..12b19156a1a4b0 100644 --- a/ports/curl/wip.diff +++ b/ports/curl/wip.diff @@ -1,12 +1,438 @@ +diff --git a/CMake/FindBrotli.cmake b/CMake/FindBrotli.cmake +index 981b30cafd..ea8a38465f 100644 +--- a/CMake/FindBrotli.cmake ++++ b/CMake/FindBrotli.cmake +@@ -45,6 +45,15 @@ if(CURL_USE_PKGCONFIG AND + pkg_check_modules(_brotli ${_brotli_pc_requires}) + endif() + ++find_package(_brotli_cmake NAMES unofficial-brotli) ++if(TARGET unofficial::brotli::brotlidec AND NOT TARGET CURL::brotli) ++ add_library(CURL::brotli INTERFACE IMPORTED) ++ set_target_properties(CURL::brotli PROPERTIES ++ INTERFACE_CURL_CONFIG_LIBS "${_brotli_LINK_LIBRARIES}" ++ INTERFACE_LIBCURL_PC_MODULES "${_brotli_pc_requires}" ++ INTERFACE_LINK_LIBRARIES unofficial::brotli::brotlidec) ++endif() ++ + if(_brotli_FOUND) + set(Brotli_FOUND TRUE) + set(BROTLI_FOUND TRUE) +diff --git a/CMake/FindCares.cmake b/CMake/FindCares.cmake +index 4a20bc0af4..020032919d 100644 +--- a/CMake/FindCares.cmake ++++ b/CMake/FindCares.cmake +@@ -43,6 +43,15 @@ if(CURL_USE_PKGCONFIG AND + pkg_check_modules(_cares ${_cares_pc_requires}) + endif() + ++find_package(_cares_cmake NAMES c-ares) ++if(TARGET c-ares::cares AND NOT TARGET CURL::cares) ++ add_library(CURL::cares INTERFACE IMPORTED) ++ set_target_properties(CURL::cares PROPERTIES ++ INTERFACE_CURL_CONFIG_LIBS "${_cares_LINK_LIBRARIES}" ++ INTERFACE_LIBCURL_PC_MODULES "${_cares_pc_requires}" ++ INTERFACE_LINK_LIBRARIES c-ares::cares) ++endif() ++ + if(_cares_FOUND) + set(Cares_FOUND TRUE) + set(CARES_FOUND TRUE) +diff --git a/CMake/FindGSS.cmake b/CMake/FindGSS.cmake +index 106c4c4edd..044e0d3d00 100644 +--- a/CMake/FindGSS.cmake ++++ b/CMake/FindGSS.cmake +@@ -265,6 +265,7 @@ if(GSS_FOUND) + if(NOT TARGET CURL::gss) + add_library(CURL::gss INTERFACE IMPORTED) + set_target_properties(CURL::gss PROPERTIES ++ INTERFACE_CURL_CONFIG_LIBS "${_gss_LINK_LIBRARIES}" + INTERFACE_CURL_GSS_FLAVOUR "${_gss_flavour}" + INTERFACE_LIBCURL_PC_MODULES "${_gss_pc_requires}" + INTERFACE_COMPILE_OPTIONS "${_gss_CFLAGS}" +diff --git a/CMake/FindGnuTLS.cmake b/CMake/FindGnuTLS.cmake +index fff57b2c29..eb3a4e5769 100644 +--- a/CMake/FindGnuTLS.cmake ++++ b/CMake/FindGnuTLS.cmake +@@ -36,6 +36,7 @@ + + set(_gnutls_pc_requires "gnutls") + ++unset(GNUTLS_LIBRARY CACHE) # from shiftmedia-libgnutls cmake wrapper + if(CURL_USE_PKGCONFIG AND + NOT DEFINED GNUTLS_INCLUDE_DIR AND + NOT DEFINED GNUTLS_LIBRARY) +@@ -87,6 +88,7 @@ if(GNUTLS_FOUND) + if(NOT TARGET CURL::gnutls) + add_library(CURL::gnutls INTERFACE IMPORTED) + set_target_properties(CURL::gnutls PROPERTIES ++ INTERFACE_CURL_CONFIG_LIBS "${_gnutls_LINK_LIBRARIES}" + INTERFACE_LIBCURL_PC_MODULES "${_gnutls_pc_requires}" + INTERFACE_COMPILE_OPTIONS "${_gnutls_CFLAGS}" + INTERFACE_INCLUDE_DIRECTORIES "${_gnutls_INCLUDE_DIRS}" +diff --git a/CMake/FindLDAP.cmake b/CMake/FindLDAP.cmake +index 2f5cc713c7..b651998650 100644 +--- a/CMake/FindLDAP.cmake ++++ b/CMake/FindLDAP.cmake +@@ -110,6 +110,7 @@ if(LDAP_FOUND) + if(NOT TARGET CURL::ldap) + add_library(CURL::ldap INTERFACE IMPORTED) + set_target_properties(CURL::ldap PROPERTIES ++ INTERFACE_CURL_CONFIG_LIBS "${_ldap_LINK_LIBRARIES}" + INTERFACE_LIBCURL_PC_MODULES "${_ldap_pc_requires}" + INTERFACE_COMPILE_OPTIONS "${_ldap_CFLAGS}" + INTERFACE_INCLUDE_DIRECTORIES "${_ldap_INCLUDE_DIRS}" +diff --git a/CMake/FindLibgsasl.cmake b/CMake/FindLibgsasl.cmake +index 5ddf957d72..50176a2770 100644 +--- a/CMake/FindLibgsasl.cmake ++++ b/CMake/FindLibgsasl.cmake +@@ -86,6 +86,7 @@ if(LIBGSASL_FOUND) + if(NOT TARGET CURL::libgsasl) + add_library(CURL::libgsasl INTERFACE IMPORTED) + set_target_properties(CURL::libgsasl PROPERTIES ++ INTERFACE_CURL_CONFIG_LIBS "${_libgsasl_LINK_LIBRARIES}" + INTERFACE_LIBCURL_PC_MODULES "${_libgsasl_pc_requires}" + INTERFACE_COMPILE_OPTIONS "${_libgsasl_CFLAGS}" + INTERFACE_INCLUDE_DIRECTORIES "${_libgsasl_INCLUDE_DIRS}" +diff --git a/CMake/FindLibidn2.cmake b/CMake/FindLibidn2.cmake +index 336a7f7b40..276bedfee1 100644 +--- a/CMake/FindLibidn2.cmake ++++ b/CMake/FindLibidn2.cmake +@@ -87,6 +87,7 @@ if(LIBIDN2_FOUND) + if(NOT TARGET CURL::libidn2) + add_library(CURL::libidn2 INTERFACE IMPORTED) + set_target_properties(CURL::libidn2 PROPERTIES ++ INTERFACE_CURL_CONFIG_LIBS "${_libidn2_LINK_LIBRARIES}" + INTERFACE_LIBCURL_PC_MODULES "${_libidn2_pc_requires}" + INTERFACE_COMPILE_OPTIONS "${_libidn2_CFLAGS}" + INTERFACE_INCLUDE_DIRECTORIES "${_libidn2_INCLUDE_DIRS}" +diff --git a/CMake/FindLibpsl.cmake b/CMake/FindLibpsl.cmake +index 9b1a0cdd97..da91c65ab4 100644 +--- a/CMake/FindLibpsl.cmake ++++ b/CMake/FindLibpsl.cmake +@@ -87,6 +87,7 @@ if(LIBPSL_FOUND) + if(NOT TARGET CURL::libpsl) + add_library(CURL::libpsl INTERFACE IMPORTED) + set_target_properties(CURL::libpsl PROPERTIES ++ INTERFACE_CURL_CONFIG_LIBS "${_libpsl_LINK_LIBRARIES}" + INTERFACE_LIBCURL_PC_MODULES "${_libpsl_pc_requires}" + INTERFACE_COMPILE_OPTIONS "${_libpsl_CFLAGS}" + INTERFACE_INCLUDE_DIRECTORIES "${_libpsl_INCLUDE_DIRS}" +diff --git a/CMake/FindLibrtmp.cmake b/CMake/FindLibrtmp.cmake +index 070538578e..55322bace9 100644 +--- a/CMake/FindLibrtmp.cmake ++++ b/CMake/FindLibrtmp.cmake +@@ -107,6 +107,7 @@ if(LIBRTMP_FOUND) + if(NOT TARGET CURL::librtmp) + add_library(CURL::librtmp INTERFACE IMPORTED) + set_target_properties(CURL::librtmp PROPERTIES ++ INTERFACE_CURL_CONFIG_LIBS "${_librtmp_LINK_LIBRARIES}" + INTERFACE_LIBCURL_PC_MODULES "${_librtmp_pc_requires}" + INTERFACE_COMPILE_OPTIONS "${_librtmp_CFLAGS}" + INTERFACE_INCLUDE_DIRECTORIES "${_librtmp_INCLUDE_DIRS}" +diff --git a/CMake/FindLibssh2.cmake b/CMake/FindLibssh2.cmake +index 330611bfe5..c0ee764d37 100644 +--- a/CMake/FindLibssh2.cmake ++++ b/CMake/FindLibssh2.cmake +@@ -43,6 +43,15 @@ if(CURL_USE_PKGCONFIG AND + pkg_check_modules(_libssh2 ${_libssh2_pc_requires}) + endif() + ++find_package(_libssh2_cmake NAMES libssh2) ++if(TARGET libssh2::libssh2 AND NOT TARGET CURL::libssh2) ++ add_library(CURL::libssh2 INTERFACE IMPORTED) ++ set_target_properties(CURL::libssh2 PROPERTIES ++ INTERFACE_CURL_CONFIG_LIBS "${_libssh2_LINK_LIBRARIES}" ++ INTERFACE_LIBCURL_PC_MODULES "${_libssh2_pc_requires}" ++ INTERFACE_LINK_LIBRARIES libssh2::libssh2) ++endif() ++ + if(_libssh2_FOUND AND _libssh2_INCLUDE_DIRS) + set(Libssh2_FOUND TRUE) + set(LIBSSH2_FOUND TRUE) +diff --git a/CMake/FindMbedTLS.cmake b/CMake/FindMbedTLS.cmake +index 97201ab2b3..b055cdbe04 100644 +--- a/CMake/FindMbedTLS.cmake ++++ b/CMake/FindMbedTLS.cmake +@@ -53,6 +53,16 @@ if(CURL_USE_PKGCONFIG AND + pkg_check_modules(_mbedtls ${_mbedtls_pc_requires}) + endif() + ++# Prefer multi-config cmake ++find_package(_mbedtls_cmake NAMES MbedTLS) ++if(TARGET MbedTLS::mbedtls AND NOT TARGET CURL::mbedtls) ++ add_library(CURL::mbedtls INTERFACE IMPORTED) ++ set_target_properties(CURL::mbedtls PROPERTIES ++ INTERFACE_CURL_CONFIG_LIBS "${_mbedtls_LINK_LIBRARIES}" # curl-config ++ INTERFACE_LIBCURL_PC_MODULES "${_mbedtls_pc_requires}" # pkgconfig ++ INTERFACE_LINK_LIBRARIES MbedTLS::mbedtls MbedTLS::mbedx509 MbedTLS::mbedcrypto) ++endif() ++ + if(_mbedtls_FOUND) + set(MbedTLS_FOUND TRUE) + set(MBEDTLS_FOUND TRUE) +diff --git a/CMake/FindNGHTTP2.cmake b/CMake/FindNGHTTP2.cmake +index 8304345a38..d1ddd41d22 100644 +--- a/CMake/FindNGHTTP2.cmake ++++ b/CMake/FindNGHTTP2.cmake +@@ -86,6 +86,7 @@ if(NGHTTP2_FOUND) + if(NOT TARGET CURL::nghttp2) + add_library(CURL::nghttp2 INTERFACE IMPORTED) + set_target_properties(CURL::nghttp2 PROPERTIES ++ INTERFACE_CURL_CONFIG_LIBS "${_nghttp2_LINK_LIBRARIES}" + INTERFACE_LIBCURL_PC_MODULES "${_nghttp2_pc_requires}" + INTERFACE_COMPILE_OPTIONS "${_nghttp2_CFLAGS}" + INTERFACE_INCLUDE_DIRECTORIES "${_nghttp2_INCLUDE_DIRS}" +diff --git a/CMake/FindNGHTTP3.cmake b/CMake/FindNGHTTP3.cmake +index 37ebfe1114..f566eb70c7 100644 +--- a/CMake/FindNGHTTP3.cmake ++++ b/CMake/FindNGHTTP3.cmake +@@ -43,6 +43,15 @@ if(CURL_USE_PKGCONFIG AND + pkg_check_modules(_nghttp3 ${_nghttp3_pc_requires}) + endif() + ++find_package(_nghttp3_cmake NAMES nghttp3) ++if((TARGET nghttp3::nghttp3 OR TARGET nghttp3::nghttp3_static) AND NOT TARGET CURL::nghttp3) ++ add_library(CURL::nghttp3 INTERFACE IMPORTED) ++ set_target_properties(CURL::nghttp3 PROPERTIES ++ INTERFACE_CURL_CONFIG_LIBS "${_nghttp3_LINK_LIBRARIES}" ++ INTERFACE_LIBCURL_PC_MODULES "${_nghttp3_pc_requires}" ++ INTERFACE_LINK_LIBRARIES $,nghttp3::nghttp3,nghttp3::nghttp3_static>) ++endif() ++ + if(_nghttp3_FOUND) + set(NGHTTP3_FOUND TRUE) + set(NGHTTP3_VERSION ${_nghttp3_VERSION}) +diff --git a/CMake/FindNGTCP2.cmake b/CMake/FindNGTCP2.cmake +index 416ea459f6..98f93a2db1 100644 +--- a/CMake/FindNGTCP2.cmake ++++ b/CMake/FindNGTCP2.cmake +@@ -81,6 +81,15 @@ if(CURL_USE_PKGCONFIG AND + set(_tried_pkgconfig TRUE) + endif() + ++find_package(_ngtcp2_cmake NAMES ngtcp2) ++if((TARGET ngtcp2::ngtcp2 OR TARGET ngtcp2::ngtcp2_static) AND NOT TARGET CURL::ngtcp2) ++ add_library(CURL::ngtcp2 INTERFACE IMPORTED) ++ set_target_properties(CURL::ngtcp2 PROPERTIES ++ INTERFACE_CURL_CONFIG_LIBS "${_ngtcp2_LINK_LIBRARIES}" ++ INTERFACE_LIBCURL_PC_MODULES "${_ngtcp2_pc_requires}" ++ INTERFACE_LINK_LIBRARIES $,ngtcp2::ngtcp2,ngtcp2::ngtcp2_static>) ++endif() ++ + if(_ngtcp2_FOUND) + set(NGTCP2_FOUND TRUE) + set(NGTCP2_VERSION ${_ngtcp2_libngtcp2_VERSION}) +diff --git a/CMake/FindNettle.cmake b/CMake/FindNettle.cmake +index d22865ffad..cc7b21de4c 100644 +--- a/CMake/FindNettle.cmake ++++ b/CMake/FindNettle.cmake +@@ -92,6 +92,7 @@ if(NETTLE_FOUND) + if(NOT TARGET CURL::nettle) + add_library(CURL::nettle INTERFACE IMPORTED) + set_target_properties(CURL::nettle PROPERTIES ++ INTERFACE_CURL_CONFIG_LIBS "${_nettle_LINK_LIBRARIES}" + INTERFACE_LIBCURL_PC_MODULES "${_nettle_pc_requires}" + INTERFACE_COMPILE_OPTIONS "${_nettle_CFLAGS}" + INTERFACE_INCLUDE_DIRECTORIES "${_nettle_INCLUDE_DIRS}" +diff --git a/CMake/FindWolfSSL.cmake b/CMake/FindWolfSSL.cmake +index 3a3c05f0fd..01294374b4 100644 +--- a/CMake/FindWolfSSL.cmake ++++ b/CMake/FindWolfSSL.cmake +@@ -52,6 +52,15 @@ if(CURL_USE_PKGCONFIG AND + pkg_check_modules(_wolfssl ${_wolfssl_pc_requires}) + endif() + ++find_package(_wolfssl_cmake NAMES wolfssl) ++if(TARGET wolfssl::wolfssl AND NOT TARGET CURL::wolfssl) ++ add_library(CURL::wolfssl INTERFACE IMPORTED) ++ set_target_properties(CURL::wolfssl PROPERTIES ++ INTERFACE_CURL_CONFIG_LIBS "${_wolfssl_LINK_LIBRARIES}" ++ INTERFACE_LIBCURL_PC_MODULES "${_wolfssl_pc_requires}" ++ INTERFACE_LINK_LIBRARIES wolfssl::wolfssl) ++endif() ++ + if(_wolfssl_FOUND) + set(WolfSSL_FOUND TRUE) + set(WOLFSSL_FOUND TRUE) +diff --git a/CMake/FindZstd.cmake b/CMake/FindZstd.cmake +index 954a827b6f..9145d63070 100644 +--- a/CMake/FindZstd.cmake ++++ b/CMake/FindZstd.cmake +@@ -52,6 +52,15 @@ if(CURL_USE_PKGCONFIG AND + pkg_check_modules(_zstd ${_zstd_pc_requires}) + endif() + ++find_package(_zstd_cmake NAMES zstd) ++if(TARGET zstd::libzstd AND NOT TARGET CURL::zstd) ++ add_library(CURL::zstd INTERFACE IMPORTED) ++ set_target_properties(CURL::zstd PROPERTIES ++ INTERFACE_CURL_CONFIG_LIBS "${_zstd_LINK_LIBRARIES}" ++ INTERFACE_LIBCURL_PC_MODULES "${_zstd_pc_requires}" ++ INTERFACE_LINK_LIBRARIES zstd::libzstd) ++endif() ++ + if(_zstd_FOUND) + set(Zstd_FOUND TRUE) + set(ZSTD_FOUND TRUE) diff --git a/CMake/curl-config.cmake.in b/CMake/curl-config.cmake.in -index 7f346c832c..f400f55eec 100644 +index 7f346c832c..8f8b249ab1 100644 --- a/CMake/curl-config.cmake.in +++ b/CMake/curl-config.cmake.in -@@ -135,6 +135,7 @@ if("@HAVE_ZSTD@") - find_dependency(Zstd) - list(APPEND _curl_libs CURL::zstd) +@@ -46,6 +46,7 @@ endif() + + set(_curl_cmake_module_path_save ${CMAKE_MODULE_PATH}) + set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR} ${CMAKE_MODULE_PATH}) ++set(_curl_cmake_module_path ${CMAKE_MODULE_PATH}) + + set(_curl_libs "") + +@@ -92,6 +93,7 @@ endif() + if("@USE_LIBSSH2@") + find_dependency(Libssh2) + list(APPEND _curl_libs CURL::libssh2) ++ set(CMAKE_MODULE_PATH ${_curl_cmake_module_path}) + endif() + if("@USE_LIBUV@") + find_dependency(Libuv) +@@ -177,7 +179,7 @@ endif() + # For compatibility with CMake's FindCURL.cmake + set(CURL_VERSION_STRING "@CURLVERSION@") + set(CURL_LIBRARIES @PROJECT_NAME@::@LIB_NAME@) +-set(CURL_LIBRARIES_PRIVATE "@LIBCURL_PC_LIBS_PRIVATE_LIST@") ++set(CURL_LIBRARIES_PRIVATE "") # not multi-config. Relying on wrapper instead. + set_and_check(CURL_INCLUDE_DIRS "@PACKAGE_CMAKE_INSTALL_INCLUDEDIR@") + + set(CURL_SUPPORTED_PROTOCOLS "@CURL_SUPPORTED_PROTOCOLS_LIST@") +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 685335667b..a824903b48 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -754,6 +754,12 @@ if(CURL_USE_OPENSSL) + # get our dependencies transitively. + list(APPEND CURL_LIBS OpenSSL::SSL OpenSSL::Crypto) + set_target_properties(OpenSSL::SSL PROPERTIES INTERFACE_LIBCURL_PC_MODULES "openssl") ++ find_package(PkgConfig QUIET) ++ pkg_check_modules(_openssl openssl REQUIRED) ++ set_target_properties(OpenSSL::SSL PROPERTIES INTERFACE_CURL_CONFIG_LIBS "${_openssl_LINK_LIBRARIES}") ++ set_target_properties(OpenSSL::Crypto PROPERTIES INTERFACE_LIBCURL_PC_MODULES "libcrypto") ++ pkg_check_modules(_crypto libcrypto REQUIRED) ++ set_target_properties(OpenSSL::Crypto PROPERTIES INTERFACE_CURL_CONFIG_LIBS "${_crypto_LINK_LIBRARIES}") + + if(CURL_DEFAULT_SSL_BACKEND AND CURL_DEFAULT_SSL_BACKEND STREQUAL "openssl") + set(_valid_default_ssl_backend TRUE) +@@ -894,6 +900,9 @@ if(ZLIB_FOUND) + # get our dependencies transitively. + list(APPEND CURL_LIBS ZLIB::ZLIB) + set_target_properties(ZLIB::ZLIB PROPERTIES INTERFACE_LIBCURL_PC_MODULES "zlib") ++ find_package(PkgConfig QUIET) ++ pkg_check_modules(_zlib zlib) ++ set_target_properties(ZLIB::ZLIB PROPERTIES INTERFACE_CURL_CONFIG_LIBS "${_zlib_LINK_LIBRARIES}") endif() -+list(REMOVE_ITEM CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}") - set(CMAKE_MODULE_PATH ${_curl_cmake_module_path_save}) + set(HAVE_BROTLI OFF) +@@ -1802,9 +1811,7 @@ endif() + if(CMAKE_C_COMPILER_ID STREQUAL "GNU") + foreach(_lib IN ITEMS OpenSSL::Crypto ZLIB::ZLIB) + if(TARGET "${_lib}") +- add_library(CURL::${_lib} INTERFACE IMPORTED) +- get_target_property(_libname "${_lib}" LOCATION) +- set_target_properties(${_lib} PROPERTIES INTERFACE_LINK_LIBRARIES "${_libname}") ++ list(REMOVE_ITEM CURL_LIBS ${_lib}) + list(APPEND CURL_LIBS ${_lib}) + endif() + endforeach() +@@ -2143,8 +2150,17 @@ if(NOT CURL_DISABLE_INSTALL) + get_target_property(_modules "${_lib}" INTERFACE_LIBCURL_PC_MODULES) + if(_modules) + list(APPEND LIBCURL_PC_REQUIRES_PRIVATE "${_modules}") ++ get_target_property(_link_libs "${_lib}" INTERFACE_CURL_CONFIG_LIBS) ++ message(STATUS "xxx ${_lib} : ${_link_libs}") ++ if(_link_libs) ++ set(_explicit_libs "${_link_libs}") ++ endif() ++ else() ++ message(STATUS "xxx ${_lib} : ---") + endif() + ++ set(LIBCURL_PC_LIBS_PRIVATE_NO_MODULES "${LIBCURL_PC_LIBS_PRIVATE}") ++ set(LIBCURL_PC_LIBS_PRIVATE "") + foreach(_lib IN LISTS _explicit_libs) + if(_lib MATCHES "/") + # This gets a bit more complex, because we want to specify the +@@ -2163,6 +2179,7 @@ if(NOT CURL_DISABLE_INSTALL) + list(FIND _sys_libdirs "${_libdir}" _libdir_index) + if(_libdir_index LESS 0) + list(APPEND _ldflags "-L${_libdir}") ++ message(STATUS "++ ${_lib}") + endif() + string(REGEX REPLACE "^lib" "" _libname "${_libname}") + list(APPEND LIBCURL_PC_LIBS_PRIVATE "-l${_libname}") +@@ -2176,11 +2193,20 @@ if(NOT CURL_DISABLE_INSTALL) + list(APPEND LIBCURL_PC_LIBS_PRIVATE_LIST "${_lib}") + endif() + endforeach() ++ list(APPEND CURL_CONFIG_LIBS ${LIBCURL_PC_LIBS_PRIVATE}) ++ if(NOT _modules) ++ message(STATUS ">>> ${_lib} : ${LIBCURL_PC_LIBS_PRIVATE}") ++ list(APPEND LIBCURL_PC_LIBS_PRIVATE_NO_MODULES ${LIBCURL_PC_LIBS_PRIVATE}) ++ endif() ++ set(LIBCURL_PC_LIBS_PRIVATE "${LIBCURL_PC_LIBS_PRIVATE_NO_MODULES}") + elseif(_lib MATCHES "^-") # '-framework ' + list(APPEND _ldflags "${_lib}") + list(APPEND LIBCURL_PC_LIBS_PRIVATE_LIST "${_lib}") ++ message(STATUS " x ${_lib} : ---") + else() ++ list(APPEND CURL_CONFIG_LIBS "-l${_lib}") + list(APPEND LIBCURL_PC_LIBS_PRIVATE "-l${_lib}") ++ message(STATUS " x ${_lib} : -l${}_lib") + list(APPEND LIBCURL_PC_LIBS_PRIVATE_LIST "${_lib}") + endif() + endforeach() +@@ -2204,6 +2230,7 @@ if(NOT CURL_DISABLE_INSTALL) + if(LIBCURL_PC_LIBS_PRIVATE) + string(REPLACE ";" " " LIBCURL_PC_LIBS_PRIVATE "${LIBCURL_PC_LIBS_PRIVATE}") + endif() ++ string(REPLACE ";" " " CURL_CONFIG_LIBS "${CURL_CONFIG_LIBS}") + if(_ldflags) + list(REMOVE_DUPLICATES _ldflags) + string(REPLACE ";" " " _ldflags "${_ldflags}") +diff --git a/curl-config.in b/curl-config.in +index ce23519c33..603375a5bc 100644 +--- a/curl-config.in ++++ b/curl-config.in +@@ -155,7 +155,7 @@ while test "$#" -gt 0; do + curllibdir='' + fi + if test '@ENABLE_SHARED@' = 'no'; then +- echo "${curllibdir}-lcurl @LIBCURL_PC_LIBS_PRIVATE@" ++ echo "${curllibdir}-lcurl @LIBCURL_PC_LDFLAGS_PRIVATE@ @CURL_CONFIG_LIBS@" + else + echo "${curllibdir}-lcurl" + fi +@@ -167,7 +167,7 @@ while test "$#" -gt 0; do + --static-libs) + if test '@ENABLE_STATIC@' != 'no'; then +- echo "@libdir@/libcurl.@libext@ @LIBCURL_PC_LDFLAGS_PRIVATE@ @LIBCURL_PC_LIBS_PRIVATE@" ++ echo "@libdir@/libcurl.@libext@ @LIBCURL_PC_LDFLAGS_PRIVATE@ @CURL_CONFIG_LIBS@" + else + echo 'curl was built with static libraries disabled' >&2 + exit 1 +diff --git a/libcurl.pc.in b/libcurl.pc.in +index c0ba5244a8..17b7db9220 100644 +--- a/libcurl.pc.in ++++ b/libcurl.pc.in +@@ -33,9 +33,9 @@ Name: libcurl + URL: https://curl.se/ + Description: Library to transfer files with HTTP, FTP, etc. + Version: @CURLVERSION@ +-Requires: @LIBCURL_PC_REQUIRES@ ++Requires: + Requires.private: @LIBCURL_PC_REQUIRES_PRIVATE@ +-Libs: -L${libdir} -lcurl @LIBCURL_PC_LIBS@ ++Libs: -L${libdir} -lcurl + Libs.private: @LIBCURL_PC_LDFLAGS_PRIVATE@ @LIBCURL_PC_LIBS_PRIVATE@ +-Cflags: -I${includedir} @LIBCURL_PC_CFLAGS@ ++Cflags: -I${includedir} + Cflags.private: @LIBCURL_PC_CFLAGS_PRIVATE@ From 1a5c8ef9009812779c2ff396c993b96a6fc350b0 Mon Sep 17 00:00:00 2001 From: Kai Pastor Date: Sun, 7 Dec 2025 12:05:58 +0100 Subject: [PATCH 05/22] [ngtcp2] Export cmake targets for openssl backend --- ports/ngtcp2/export-crypto-targets.diff | 58 +++++++++++++++++++++++++ ports/ngtcp2/portfile.cmake | 2 + ports/ngtcp2/vcpkg.json | 1 + 3 files changed, 61 insertions(+) create mode 100644 ports/ngtcp2/export-crypto-targets.diff diff --git a/ports/ngtcp2/export-crypto-targets.diff b/ports/ngtcp2/export-crypto-targets.diff new file mode 100644 index 00000000000000..2b5befaf4c57be --- /dev/null +++ b/ports/ngtcp2/export-crypto-targets.diff @@ -0,0 +1,58 @@ +diff --git a/crypto/ossl/CMakeLists.txt b/crypto/ossl/CMakeLists.txt +index da2ef2df..1a108ada 100644 +--- a/crypto/ossl/CMakeLists.txt ++++ b/crypto/ossl/CMakeLists.txt +@@ -29,14 +29,11 @@ set(ngtcp2_crypto_ossl_SOURCES + ) + + set(ngtcp2_crypto_ossl_INCLUDE_DIRS +- "${CMAKE_CURRENT_SOURCE_DIR}/../../lib/includes" +- "${CMAKE_CURRENT_BINARY_DIR}/../../lib/includes" +- "${CMAKE_CURRENT_SOURCE_DIR}/../../lib" +- "${CMAKE_CURRENT_SOURCE_DIR}/../../crypto/includes" +- "${CMAKE_CURRENT_BINARY_DIR}/../../crypto/includes" +- "${CMAKE_CURRENT_SOURCE_DIR}/../../crypto" +- "${CMAKE_CURRENT_BINARY_DIR}/../../crypto" +- "${OPENSSL_INCLUDE_DIRS}" ++ "$" ++ "$" ++ "$" ++ "$" ++ "$" + ) + + foreach(name libngtcp2_crypto_ossl.pc) +@@ -55,9 +52,10 @@ if(ENABLE_SHARED_LIB) + ) + target_include_directories(ngtcp2_crypto_ossl PUBLIC + ${ngtcp2_crypto_ossl_INCLUDE_DIRS}) +- target_link_libraries(ngtcp2_crypto_ossl ngtcp2 ${OPENSSL_LIBRARIES}) ++ target_link_libraries(ngtcp2_crypto_ossl PUBLIC ngtcp2 OpenSSL::SSL) + + install(TARGETS ngtcp2_crypto_ossl ++ EXPORT "${PROJECT_NAME}Targets" + ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" + LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" + RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}") +@@ -77,8 +75,10 @@ if(ENABLE_STATIC_LIB) + "-DNGTCP2_STATICLIB") + target_include_directories(ngtcp2_crypto_ossl_static PUBLIC + ${ngtcp2_crypto_ossl_INCLUDE_DIRS}) ++ target_link_libraries(ngtcp2_crypto_ossl_static PUBLIC ngtcp2_static OpenSSL::SSL) + + install(TARGETS ngtcp2_crypto_ossl_static ++ EXPORT "${PROJECT_NAME}Targets" + DESTINATION "${CMAKE_INSTALL_LIBDIR}") + endif() + +diff --git a/lib/config.cmake.in b/lib/config.cmake.in +index 435a4d4a..fffcd517 100644 +--- a/lib/config.cmake.in ++++ b/lib/config.cmake.in +@@ -1,3 +1,6 @@ + include(CMakeFindDependencyMacro) ++if("@HAVE_OSSL@") ++ find_dependency(OpenSSL) ++endif() + + include("${CMAKE_CURRENT_LIST_DIR}/@NGTCP2_TARGETS_EXPORT_NAME@.cmake") diff --git a/ports/ngtcp2/portfile.cmake b/ports/ngtcp2/portfile.cmake index 4a72bcaf57c7d7..aee1042c003836 100644 --- a/ports/ngtcp2/portfile.cmake +++ b/ports/ngtcp2/portfile.cmake @@ -4,6 +4,8 @@ vcpkg_from_github( REF "v${VERSION}" SHA512 bd68cc652edba8b5619370729b88cc0dccd9c0542391b12b87b5a106e7982a984c9a1f1dea8817f8953318bc12967878498fbc50e221ec465e77422e5ae1ddcf HEAD_REF main + PATCHES + export-crypto-targets.diff ) string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" ENABLE_STATIC_LIB) diff --git a/ports/ngtcp2/vcpkg.json b/ports/ngtcp2/vcpkg.json index ece81631036f17..f038d284019d94 100644 --- a/ports/ngtcp2/vcpkg.json +++ b/ports/ngtcp2/vcpkg.json @@ -1,6 +1,7 @@ { "name": "ngtcp2", "version": "1.18.0", + "port-version": 1, "description": "ngtcp2 project is an effort to implement RFC9000 QUIC protocol.", "homepage": "https://github.com/ngtcp2/ngtcp2", "license": "MIT", From 24b21223c72e52116599648c808a07da74281aca Mon Sep 17 00:00:00 2001 From: Kai Pastor Date: Sun, 7 Dec 2025 12:06:15 +0100 Subject: [PATCH 06/22] WIP [skip actions] --- ports/curl/wip.diff | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/ports/curl/wip.diff b/ports/curl/wip.diff index 12b19156a1a4b0..85de4eeac801ff 100644 --- a/ports/curl/wip.diff +++ b/ports/curl/wip.diff @@ -204,20 +204,24 @@ index 37ebfe1114..f566eb70c7 100644 set(NGHTTP3_FOUND TRUE) set(NGHTTP3_VERSION ${_nghttp3_VERSION}) diff --git a/CMake/FindNGTCP2.cmake b/CMake/FindNGTCP2.cmake -index 416ea459f6..98f93a2db1 100644 +index 416ea459f6..400e4cc77b 100644 --- a/CMake/FindNGTCP2.cmake +++ b/CMake/FindNGTCP2.cmake -@@ -81,6 +81,15 @@ if(CURL_USE_PKGCONFIG AND +@@ -81,6 +81,19 @@ if(CURL_USE_PKGCONFIG AND set(_tried_pkgconfig TRUE) endif() +find_package(_ngtcp2_cmake NAMES ngtcp2) -+if((TARGET ngtcp2::ngtcp2 OR TARGET ngtcp2::ngtcp2_static) AND NOT TARGET CURL::ngtcp2) ++set(_ngtcp2_cmake_target ngtcp2::ngtcp2) ++if(_ngtcp2_crypto_backend) ++ set(_ngtcp2_cmake_target ngtcp2::ngtcp2_crypto_${_ngtcp2_crypto_backend}) ++endif() ++if((TARGET ${_ngtcp2_cmake_target} OR TARGET ${_ngtcp2_cmake_target}_static) AND NOT TARGET CURL::ngtcp2) + add_library(CURL::ngtcp2 INTERFACE IMPORTED) + set_target_properties(CURL::ngtcp2 PROPERTIES + INTERFACE_CURL_CONFIG_LIBS "${_ngtcp2_LINK_LIBRARIES}" + INTERFACE_LIBCURL_PC_MODULES "${_ngtcp2_pc_requires}" -+ INTERFACE_LINK_LIBRARIES $,ngtcp2::ngtcp2,ngtcp2::ngtcp2_static>) ++ INTERFACE_LINK_LIBRARIES $,${_ngtcp2_cmake_target},${_ngtcp2_cmake_target}_static>) +endif() + if(_ngtcp2_FOUND) From 5721f936255df5f4c2c342fba8636a823fb2b086 Mon Sep 17 00:00:00 2001 From: Kai Pastor Date: Sun, 7 Dec 2025 18:52:52 +0100 Subject: [PATCH 07/22] WIP [skip actions] --- ports/curl/wip.diff | 601 ++++++++++++++++++++++++++++---------------- 1 file changed, 391 insertions(+), 210 deletions(-) diff --git a/ports/curl/wip.diff b/ports/curl/wip.diff index 85de4eeac801ff..3477c83e1b1f72 100644 --- a/ports/curl/wip.diff +++ b/ports/curl/wip.diff @@ -1,57 +1,62 @@ diff --git a/CMake/FindBrotli.cmake b/CMake/FindBrotli.cmake -index 981b30cafd..ea8a38465f 100644 +index 981b30cafd..e7bfbca0b2 100644 --- a/CMake/FindBrotli.cmake +++ b/CMake/FindBrotli.cmake -@@ -45,6 +45,15 @@ if(CURL_USE_PKGCONFIG AND - pkg_check_modules(_brotli ${_brotli_pc_requires}) - endif() - -+find_package(_brotli_cmake NAMES unofficial-brotli) -+if(TARGET unofficial::brotli::brotlidec AND NOT TARGET CURL::brotli) -+ add_library(CURL::brotli INTERFACE IMPORTED) -+ set_target_properties(CURL::brotli PROPERTIES -+ INTERFACE_CURL_CONFIG_LIBS "${_brotli_LINK_LIBRARIES}" -+ INTERFACE_LIBCURL_PC_MODULES "${_brotli_pc_requires}" -+ INTERFACE_LINK_LIBRARIES unofficial::brotli::brotlidec) -+endif() -+ - if(_brotli_FOUND) - set(Brotli_FOUND TRUE) +@@ -50,6 +50,17 @@ if(_brotli_FOUND) set(BROTLI_FOUND TRUE) + set(BROTLI_VERSION ${_brotli_libbrotlicommon_VERSION}) + message(STATUS "Found Brotli (via pkg-config): ${_brotli_INCLUDE_DIRS} (found version \"${BROTLI_VERSION}\")") ++ find_package(_brotli_cmake NAMES unofficial-brotli) ++ if(TARGET unofficial::brotli::brotlidec AND NOT TARGET CURL::brotli) ++ add_library(CURL::brotli INTERFACE IMPORTED) ++ set_target_properties(CURL::brotli PROPERTIES ++ INTERFACE_LIBCURL_PC_LINK_LIBRARIES "${_brotli_LINK_LIBRARIES}" ++ INTERFACE_LIBCURL_PC_MODULES "${_brotli_pc_requires}" ++ INTERFACE_LINK_LIBRARIES unofficial::brotli::brotlidec) ++ endif() ++elseif(1) ++ set(Brotli_FOUND FALSE) ++ set(BROTLI_FOUND FALSE) + else() + find_path(BROTLI_INCLUDE_DIR "brotli/decode.h") + find_library(BROTLICOMMON_LIBRARY NAMES "brotlicommon") diff --git a/CMake/FindCares.cmake b/CMake/FindCares.cmake -index 4a20bc0af4..020032919d 100644 +index 4a20bc0af4..fcb113e0a7 100644 --- a/CMake/FindCares.cmake +++ b/CMake/FindCares.cmake -@@ -43,6 +43,15 @@ if(CURL_USE_PKGCONFIG AND - pkg_check_modules(_cares ${_cares_pc_requires}) - endif() - -+find_package(_cares_cmake NAMES c-ares) -+if(TARGET c-ares::cares AND NOT TARGET CURL::cares) -+ add_library(CURL::cares INTERFACE IMPORTED) -+ set_target_properties(CURL::cares PROPERTIES -+ INTERFACE_CURL_CONFIG_LIBS "${_cares_LINK_LIBRARIES}" -+ INTERFACE_LIBCURL_PC_MODULES "${_cares_pc_requires}" -+ INTERFACE_LINK_LIBRARIES c-ares::cares) -+endif() -+ - if(_cares_FOUND) - set(Cares_FOUND TRUE) +@@ -48,6 +48,17 @@ if(_cares_FOUND) set(CARES_FOUND TRUE) + set(CARES_VERSION ${_cares_VERSION}) + message(STATUS "Found Cares (via pkg-config): ${_cares_INCLUDE_DIRS} (found version \"${CARES_VERSION}\")") ++ find_package(_cares_cmake NAMES c-ares) ++ if(TARGET c-ares::cares AND NOT TARGET CURL::cares) ++ add_library(CURL::cares INTERFACE IMPORTED) ++ set_target_properties(CURL::cares PROPERTIES ++ INTERFACE_LIBCURL_PC_LINK_LIBRARIES "${_cares_LINK_LIBRARIES}" ++ INTERFACE_LIBCURL_PC_MODULES "${_cares_pc_requires}" ++ INTERFACE_LINK_LIBRARIES c-ares::cares) ++ endif() ++elseif(1) ++ set(Cares_FOUND FALSE) ++ set(CARES_FOUND FALSE) + else() + find_path(CARES_INCLUDE_DIR NAMES "ares.h") + find_library(CARES_LIBRARY NAMES ${CARES_NAMES} "cares") diff --git a/CMake/FindGSS.cmake b/CMake/FindGSS.cmake -index 106c4c4edd..044e0d3d00 100644 +index 106c4c4edd..a027983929 100644 --- a/CMake/FindGSS.cmake +++ b/CMake/FindGSS.cmake -@@ -265,6 +265,7 @@ if(GSS_FOUND) - if(NOT TARGET CURL::gss) - add_library(CURL::gss INTERFACE IMPORTED) - set_target_properties(CURL::gss PROPERTIES -+ INTERFACE_CURL_CONFIG_LIBS "${_gss_LINK_LIBRARIES}" - INTERFACE_CURL_GSS_FLAVOUR "${_gss_flavour}" +@@ -269,7 +269,6 @@ if(GSS_FOUND) INTERFACE_LIBCURL_PC_MODULES "${_gss_pc_requires}" INTERFACE_COMPILE_OPTIONS "${_gss_CFLAGS}" + INTERFACE_INCLUDE_DIRECTORIES "${_gss_INCLUDE_DIRS}" +- INTERFACE_LINK_DIRECTORIES "${_gss_LIBRARY_DIRS}" +- INTERFACE_LINK_LIBRARIES "${_gss_LIBRARIES}") ++ INTERFACE_LINK_LIBRARIES "${_gss_LINK_LIBRARIES}") + endif() + endif() diff --git a/CMake/FindGnuTLS.cmake b/CMake/FindGnuTLS.cmake -index fff57b2c29..eb3a4e5769 100644 +index fff57b2c29..7d81acd99a 100644 --- a/CMake/FindGnuTLS.cmake +++ b/CMake/FindGnuTLS.cmake @@ -36,6 +36,7 @@ @@ -62,254 +67,359 @@ index fff57b2c29..eb3a4e5769 100644 if(CURL_USE_PKGCONFIG AND NOT DEFINED GNUTLS_INCLUDE_DIR AND NOT DEFINED GNUTLS_LIBRARY) -@@ -87,6 +88,7 @@ if(GNUTLS_FOUND) - if(NOT TARGET CURL::gnutls) - add_library(CURL::gnutls INTERFACE IMPORTED) - set_target_properties(CURL::gnutls PROPERTIES -+ INTERFACE_CURL_CONFIG_LIBS "${_gnutls_LINK_LIBRARIES}" +@@ -90,7 +91,6 @@ if(GNUTLS_FOUND) INTERFACE_LIBCURL_PC_MODULES "${_gnutls_pc_requires}" INTERFACE_COMPILE_OPTIONS "${_gnutls_CFLAGS}" INTERFACE_INCLUDE_DIRECTORIES "${_gnutls_INCLUDE_DIRS}" +- INTERFACE_LINK_DIRECTORIES "${_gnutls_LIBRARY_DIRS}" +- INTERFACE_LINK_LIBRARIES "${_gnutls_LIBRARIES}") ++ INTERFACE_LINK_LIBRARIES "${_gnutls_LINK_LIBRARIES}") + endif() + endif() diff --git a/CMake/FindLDAP.cmake b/CMake/FindLDAP.cmake -index 2f5cc713c7..b651998650 100644 +index 2f5cc713c7..63c1b0800f 100644 --- a/CMake/FindLDAP.cmake +++ b/CMake/FindLDAP.cmake -@@ -110,6 +110,7 @@ if(LDAP_FOUND) - if(NOT TARGET CURL::ldap) - add_library(CURL::ldap INTERFACE IMPORTED) - set_target_properties(CURL::ldap PROPERTIES -+ INTERFACE_CURL_CONFIG_LIBS "${_ldap_LINK_LIBRARIES}" +@@ -113,7 +113,6 @@ if(LDAP_FOUND) INTERFACE_LIBCURL_PC_MODULES "${_ldap_pc_requires}" INTERFACE_COMPILE_OPTIONS "${_ldap_CFLAGS}" INTERFACE_INCLUDE_DIRECTORIES "${_ldap_INCLUDE_DIRS}" +- INTERFACE_LINK_DIRECTORIES "${_ldap_LIBRARY_DIRS}" +- INTERFACE_LINK_LIBRARIES "${_ldap_LIBRARIES}") ++ INTERFACE_LINK_LIBRARIES "${_ldap_LINK_LIBRARIES}") + endif() + endif() diff --git a/CMake/FindLibgsasl.cmake b/CMake/FindLibgsasl.cmake -index 5ddf957d72..50176a2770 100644 +index 5ddf957d72..db462466e4 100644 --- a/CMake/FindLibgsasl.cmake +++ b/CMake/FindLibgsasl.cmake -@@ -86,6 +86,7 @@ if(LIBGSASL_FOUND) - if(NOT TARGET CURL::libgsasl) - add_library(CURL::libgsasl INTERFACE IMPORTED) - set_target_properties(CURL::libgsasl PROPERTIES -+ INTERFACE_CURL_CONFIG_LIBS "${_libgsasl_LINK_LIBRARIES}" +@@ -89,7 +89,6 @@ if(LIBGSASL_FOUND) INTERFACE_LIBCURL_PC_MODULES "${_libgsasl_pc_requires}" INTERFACE_COMPILE_OPTIONS "${_libgsasl_CFLAGS}" INTERFACE_INCLUDE_DIRECTORIES "${_libgsasl_INCLUDE_DIRS}" +- INTERFACE_LINK_DIRECTORIES "${_libgsasl_LIBRARY_DIRS}" +- INTERFACE_LINK_LIBRARIES "${_libgsasl_LIBRARIES}") ++ INTERFACE_LINK_LIBRARIES "${_libgsasl_LINK_LIBRARIES}") + endif() + endif() diff --git a/CMake/FindLibidn2.cmake b/CMake/FindLibidn2.cmake -index 336a7f7b40..276bedfee1 100644 +index 336a7f7b40..b2f3eaf534 100644 --- a/CMake/FindLibidn2.cmake +++ b/CMake/FindLibidn2.cmake -@@ -87,6 +87,7 @@ if(LIBIDN2_FOUND) - if(NOT TARGET CURL::libidn2) - add_library(CURL::libidn2 INTERFACE IMPORTED) - set_target_properties(CURL::libidn2 PROPERTIES -+ INTERFACE_CURL_CONFIG_LIBS "${_libidn2_LINK_LIBRARIES}" +@@ -90,7 +90,6 @@ if(LIBIDN2_FOUND) INTERFACE_LIBCURL_PC_MODULES "${_libidn2_pc_requires}" INTERFACE_COMPILE_OPTIONS "${_libidn2_CFLAGS}" INTERFACE_INCLUDE_DIRECTORIES "${_libidn2_INCLUDE_DIRS}" +- INTERFACE_LINK_DIRECTORIES "${_libidn2_LIBRARY_DIRS}" +- INTERFACE_LINK_LIBRARIES "${_libidn2_LIBRARIES}") ++ INTERFACE_LINK_LIBRARIES "${_libidn2_LINK_LIBRARIES}") + endif() + endif() diff --git a/CMake/FindLibpsl.cmake b/CMake/FindLibpsl.cmake -index 9b1a0cdd97..da91c65ab4 100644 +index 9b1a0cdd97..a7fe288883 100644 --- a/CMake/FindLibpsl.cmake +++ b/CMake/FindLibpsl.cmake -@@ -87,6 +87,7 @@ if(LIBPSL_FOUND) - if(NOT TARGET CURL::libpsl) - add_library(CURL::libpsl INTERFACE IMPORTED) - set_target_properties(CURL::libpsl PROPERTIES -+ INTERFACE_CURL_CONFIG_LIBS "${_libpsl_LINK_LIBRARIES}" +@@ -90,7 +90,6 @@ if(LIBPSL_FOUND) INTERFACE_LIBCURL_PC_MODULES "${_libpsl_pc_requires}" INTERFACE_COMPILE_OPTIONS "${_libpsl_CFLAGS}" INTERFACE_INCLUDE_DIRECTORIES "${_libpsl_INCLUDE_DIRS}" +- INTERFACE_LINK_DIRECTORIES "${_libpsl_LIBRARY_DIRS}" +- INTERFACE_LINK_LIBRARIES "${_libpsl_LIBRARIES}") ++ INTERFACE_LINK_LIBRARIES "${_libpsl_LINK_LIBRARIES}") + endif() + endif() diff --git a/CMake/FindLibrtmp.cmake b/CMake/FindLibrtmp.cmake -index 070538578e..55322bace9 100644 +index 070538578e..9b5370be17 100644 --- a/CMake/FindLibrtmp.cmake +++ b/CMake/FindLibrtmp.cmake -@@ -107,6 +107,7 @@ if(LIBRTMP_FOUND) - if(NOT TARGET CURL::librtmp) - add_library(CURL::librtmp INTERFACE IMPORTED) - set_target_properties(CURL::librtmp PROPERTIES -+ INTERFACE_CURL_CONFIG_LIBS "${_librtmp_LINK_LIBRARIES}" +@@ -110,7 +110,6 @@ if(LIBRTMP_FOUND) INTERFACE_LIBCURL_PC_MODULES "${_librtmp_pc_requires}" INTERFACE_COMPILE_OPTIONS "${_librtmp_CFLAGS}" INTERFACE_INCLUDE_DIRECTORIES "${_librtmp_INCLUDE_DIRS}" +- INTERFACE_LINK_DIRECTORIES "${_librtmp_LIBRARY_DIRS}" +- INTERFACE_LINK_LIBRARIES "${_librtmp_LIBRARIES}") ++ INTERFACE_LINK_LIBRARIES "${_librtmp_LINK_LIBRARIES}") + endif() + endif() diff --git a/CMake/FindLibssh2.cmake b/CMake/FindLibssh2.cmake -index 330611bfe5..c0ee764d37 100644 +index 330611bfe5..94b5567c0e 100644 --- a/CMake/FindLibssh2.cmake +++ b/CMake/FindLibssh2.cmake -@@ -43,6 +43,15 @@ if(CURL_USE_PKGCONFIG AND - pkg_check_modules(_libssh2 ${_libssh2_pc_requires}) - endif() - -+find_package(_libssh2_cmake NAMES libssh2) -+if(TARGET libssh2::libssh2 AND NOT TARGET CURL::libssh2) -+ add_library(CURL::libssh2 INTERFACE IMPORTED) -+ set_target_properties(CURL::libssh2 PROPERTIES -+ INTERFACE_CURL_CONFIG_LIBS "${_libssh2_LINK_LIBRARIES}" -+ INTERFACE_LIBCURL_PC_MODULES "${_libssh2_pc_requires}" -+ INTERFACE_LINK_LIBRARIES libssh2::libssh2) -+endif() -+ - if(_libssh2_FOUND AND _libssh2_INCLUDE_DIRS) - set(Libssh2_FOUND TRUE) +@@ -48,6 +48,17 @@ if(_libssh2_FOUND AND _libssh2_INCLUDE_DIRS) set(LIBSSH2_FOUND TRUE) + set(LIBSSH2_VERSION ${_libssh2_VERSION}) + message(STATUS "Found Libssh2 (via pkg-config): ${_libssh2_INCLUDE_DIRS} (found version \"${LIBSSH2_VERSION}\")") ++ find_package(_libssh2_cmake NAMES libssh2) ++ if(TARGET libssh2::libssh2 AND NOT TARGET CURL::libssh2) ++ add_library(CURL::libssh2 INTERFACE IMPORTED) ++ set_target_properties(CURL::libssh2 PROPERTIES ++ INTERFACE_LIBCURL_PC_LINK_LIBRARIES "${_libssh2_LINK_LIBRARIES}" ++ INTERFACE_LIBCURL_PC_MODULES "${_libssh2_pc_requires}" ++ INTERFACE_LINK_LIBRARIES libssh2::libssh2) ++ endif() ++elseif(1) ++ set(Libssh2_FOUND FALSE) ++ set(LIBSSH2_FOUND FALSE) + else() + find_path(LIBSSH2_INCLUDE_DIR NAMES "libssh2.h") + find_library(LIBSSH2_LIBRARY NAMES "ssh2" "libssh2") diff --git a/CMake/FindMbedTLS.cmake b/CMake/FindMbedTLS.cmake -index 97201ab2b3..b055cdbe04 100644 +index 97201ab2b3..794460b0af 100644 --- a/CMake/FindMbedTLS.cmake +++ b/CMake/FindMbedTLS.cmake -@@ -53,6 +53,16 @@ if(CURL_USE_PKGCONFIG AND - pkg_check_modules(_mbedtls ${_mbedtls_pc_requires}) - endif() - -+# Prefer multi-config cmake -+find_package(_mbedtls_cmake NAMES MbedTLS) -+if(TARGET MbedTLS::mbedtls AND NOT TARGET CURL::mbedtls) -+ add_library(CURL::mbedtls INTERFACE IMPORTED) -+ set_target_properties(CURL::mbedtls PROPERTIES -+ INTERFACE_CURL_CONFIG_LIBS "${_mbedtls_LINK_LIBRARIES}" # curl-config -+ INTERFACE_LIBCURL_PC_MODULES "${_mbedtls_pc_requires}" # pkgconfig -+ INTERFACE_LINK_LIBRARIES MbedTLS::mbedtls MbedTLS::mbedx509 MbedTLS::mbedcrypto) -+endif() -+ - if(_mbedtls_FOUND) - set(MbedTLS_FOUND TRUE) +@@ -58,6 +58,17 @@ if(_mbedtls_FOUND) set(MBEDTLS_FOUND TRUE) + set(MBEDTLS_VERSION ${_mbedtls_mbedtls_VERSION}) + message(STATUS "Found MbedTLS (via pkg-config): ${_mbedtls_INCLUDE_DIRS} (found version \"${MBEDTLS_VERSION}\")") ++ find_package(_mbedtls_cmake NAMES MbedTLS) ++ if(TARGET MbedTLS::mbedtls AND NOT TARGET CURL::mbedtls) ++ add_library(CURL::mbedtls INTERFACE IMPORTED) ++ set_target_properties(CURL::mbedtls PROPERTIES ++ INTERFACE_LIBCURL_PC_LINK_LIBRARIES "${_mbedtls_LINK_LIBRARIES}" ++ INTERFACE_LIBCURL_PC_MODULES "${_mbedtls_pc_requires}" ++ INTERFACE_LINK_LIBRARIES MbedTLS::mbedtls MbedTLS::mbedx509 MbedTLS::mbedcrypto) ++ endif() ++elseif(1) ++ set(MbedTLS_FOUND FALSE) ++ set(MBEDTLS_FOUND FALSE) + else() + set(_mbedtls_pc_requires "") # Depend on pkg-config only when found via pkg-config + diff --git a/CMake/FindNGHTTP2.cmake b/CMake/FindNGHTTP2.cmake -index 8304345a38..d1ddd41d22 100644 +index 8304345a38..e66c3f40fa 100644 --- a/CMake/FindNGHTTP2.cmake +++ b/CMake/FindNGHTTP2.cmake -@@ -86,6 +86,7 @@ if(NGHTTP2_FOUND) - if(NOT TARGET CURL::nghttp2) - add_library(CURL::nghttp2 INTERFACE IMPORTED) - set_target_properties(CURL::nghttp2 PROPERTIES -+ INTERFACE_CURL_CONFIG_LIBS "${_nghttp2_LINK_LIBRARIES}" +@@ -89,7 +89,6 @@ if(NGHTTP2_FOUND) INTERFACE_LIBCURL_PC_MODULES "${_nghttp2_pc_requires}" INTERFACE_COMPILE_OPTIONS "${_nghttp2_CFLAGS}" INTERFACE_INCLUDE_DIRECTORIES "${_nghttp2_INCLUDE_DIRS}" +- INTERFACE_LINK_DIRECTORIES "${_nghttp2_LIBRARY_DIRS}" +- INTERFACE_LINK_LIBRARIES "${_nghttp2_LIBRARIES}") ++ INTERFACE_LINK_LIBRARIES "${_nghttp2_LINK_LIBRARIES}") + endif() + endif() diff --git a/CMake/FindNGHTTP3.cmake b/CMake/FindNGHTTP3.cmake -index 37ebfe1114..f566eb70c7 100644 +index 37ebfe1114..1aedcd983c 100644 --- a/CMake/FindNGHTTP3.cmake +++ b/CMake/FindNGHTTP3.cmake -@@ -43,6 +43,15 @@ if(CURL_USE_PKGCONFIG AND - pkg_check_modules(_nghttp3 ${_nghttp3_pc_requires}) - endif() - -+find_package(_nghttp3_cmake NAMES nghttp3) -+if((TARGET nghttp3::nghttp3 OR TARGET nghttp3::nghttp3_static) AND NOT TARGET CURL::nghttp3) -+ add_library(CURL::nghttp3 INTERFACE IMPORTED) -+ set_target_properties(CURL::nghttp3 PROPERTIES -+ INTERFACE_CURL_CONFIG_LIBS "${_nghttp3_LINK_LIBRARIES}" -+ INTERFACE_LIBCURL_PC_MODULES "${_nghttp3_pc_requires}" -+ INTERFACE_LINK_LIBRARIES $,nghttp3::nghttp3,nghttp3::nghttp3_static>) -+endif() -+ - if(_nghttp3_FOUND) +@@ -47,6 +47,16 @@ if(_nghttp3_FOUND) set(NGHTTP3_FOUND TRUE) set(NGHTTP3_VERSION ${_nghttp3_VERSION}) + message(STATUS "Found NGHTTP3 (via pkg-config): ${_nghttp3_INCLUDE_DIRS} (found version \"${NGHTTP3_VERSION}\")") ++ find_package(_nghttp3_cmake NAMES nghttp3) ++ if((TARGET nghttp3::nghttp3 OR TARGET nghttp3::nghttp3_static) AND NOT TARGET CURL::nghttp3) ++ add_library(CURL::nghttp3 INTERFACE IMPORTED) ++ set_target_properties(CURL::nghttp3 PROPERTIES ++ INTERFACE_LIBCURL_PC_LINK_LIBRARIES "${_nghttp3_LINK_LIBRARIES}" ++ INTERFACE_LIBCURL_PC_MODULES "${_nghttp3_pc_requires}" ++ INTERFACE_LINK_LIBRARIES $,nghttp3::nghttp3,nghttp3::nghttp3_static>) ++ endif() ++elseif(1) ++ set(NGHTTP3_FOUND FALSE) + else() + find_path(NGHTTP3_INCLUDE_DIR NAMES "nghttp3/nghttp3.h") + find_library(NGHTTP3_LIBRARY NAMES "nghttp3") diff --git a/CMake/FindNGTCP2.cmake b/CMake/FindNGTCP2.cmake -index 416ea459f6..400e4cc77b 100644 +index 416ea459f6..13010958be 100644 --- a/CMake/FindNGTCP2.cmake +++ b/CMake/FindNGTCP2.cmake -@@ -81,6 +81,19 @@ if(CURL_USE_PKGCONFIG AND - set(_tried_pkgconfig TRUE) - endif() - -+find_package(_ngtcp2_cmake NAMES ngtcp2) -+set(_ngtcp2_cmake_target ngtcp2::ngtcp2) -+if(_ngtcp2_crypto_backend) -+ set(_ngtcp2_cmake_target ngtcp2::ngtcp2_crypto_${_ngtcp2_crypto_backend}) -+endif() -+if((TARGET ${_ngtcp2_cmake_target} OR TARGET ${_ngtcp2_cmake_target}_static) AND NOT TARGET CURL::ngtcp2) -+ add_library(CURL::ngtcp2 INTERFACE IMPORTED) -+ set_target_properties(CURL::ngtcp2 PROPERTIES -+ INTERFACE_CURL_CONFIG_LIBS "${_ngtcp2_LINK_LIBRARIES}" -+ INTERFACE_LIBCURL_PC_MODULES "${_ngtcp2_pc_requires}" -+ INTERFACE_LINK_LIBRARIES $,${_ngtcp2_cmake_target},${_ngtcp2_cmake_target}_static>) -+endif() -+ - if(_ngtcp2_FOUND) +@@ -85,6 +85,24 @@ if(_ngtcp2_FOUND) set(NGTCP2_FOUND TRUE) set(NGTCP2_VERSION ${_ngtcp2_libngtcp2_VERSION}) + message(STATUS "Found NGTCP2 (via pkg-config): ${_ngtcp2_INCLUDE_DIRS} (found version \"${NGTCP2_VERSION}\")") ++ find_package(_ngtcp2_cmake NAMES ngtcp2) ++ set(_ngtcp2_cmake_target ngtcp2::ngtcp2) ++ if(_ngtcp2_crypto_backend) ++ # ngtcp2::ngtcp2 is a public link library of the crypto backend. ++ set(_ngtcp2_cmake_target ngtcp2::ngtcp2_crypto_${_ngtcp2_crypto_backend}) ++ endif() ++ if(TARGET ${_ngtcp2_cmake_target}_static) ++ string(APPEND _ngtcp2_cmake_target "_static") ++ endif() ++ if(TARGET ${_ngtcp2_cmake_target} AND NOT TARGET CURL::ngtcp2) ++ add_library(CURL::ngtcp2 INTERFACE IMPORTED) ++ set_target_properties(CURL::ngtcp2 PROPERTIES ++ INTERFACE_LIBCURL_PC_LINK_LIBRARIES "${_ngtcp2_LINK_LIBRARIES}" ++ INTERFACE_LIBCURL_PC_MODULES "${_ngtcp2_pc_requires}" ++ INTERFACE_LINK_LIBRARIES ${_ngtcp2_cmake_target}) ++ endif() ++elseif(0) ++ set(NGTCP2_FOUND FALSE) + else() + find_path(NGTCP2_INCLUDE_DIR NAMES "ngtcp2/ngtcp2.h") + find_library(NGTCP2_LIBRARY NAMES "ngtcp2") diff --git a/CMake/FindNettle.cmake b/CMake/FindNettle.cmake -index d22865ffad..cc7b21de4c 100644 +index d22865ffad..049265bc8b 100644 --- a/CMake/FindNettle.cmake +++ b/CMake/FindNettle.cmake -@@ -92,6 +92,7 @@ if(NETTLE_FOUND) - if(NOT TARGET CURL::nettle) - add_library(CURL::nettle INTERFACE IMPORTED) - set_target_properties(CURL::nettle PROPERTIES -+ INTERFACE_CURL_CONFIG_LIBS "${_nettle_LINK_LIBRARIES}" +@@ -95,7 +95,6 @@ if(NETTLE_FOUND) INTERFACE_LIBCURL_PC_MODULES "${_nettle_pc_requires}" INTERFACE_COMPILE_OPTIONS "${_nettle_CFLAGS}" INTERFACE_INCLUDE_DIRECTORIES "${_nettle_INCLUDE_DIRS}" +- INTERFACE_LINK_DIRECTORIES "${_nettle_LIBRARY_DIRS}" +- INTERFACE_LINK_LIBRARIES "${_nettle_LIBRARIES}") ++ INTERFACE_LINK_LIBRARIES "${_nettle_LINK_LIBRARIES}") + endif() + endif() diff --git a/CMake/FindWolfSSL.cmake b/CMake/FindWolfSSL.cmake -index 3a3c05f0fd..01294374b4 100644 +index 3a3c05f0fd..4c1b832898 100644 --- a/CMake/FindWolfSSL.cmake +++ b/CMake/FindWolfSSL.cmake -@@ -52,6 +52,15 @@ if(CURL_USE_PKGCONFIG AND - pkg_check_modules(_wolfssl ${_wolfssl_pc_requires}) - endif() - -+find_package(_wolfssl_cmake NAMES wolfssl) -+if(TARGET wolfssl::wolfssl AND NOT TARGET CURL::wolfssl) -+ add_library(CURL::wolfssl INTERFACE IMPORTED) -+ set_target_properties(CURL::wolfssl PROPERTIES -+ INTERFACE_CURL_CONFIG_LIBS "${_wolfssl_LINK_LIBRARIES}" -+ INTERFACE_LIBCURL_PC_MODULES "${_wolfssl_pc_requires}" -+ INTERFACE_LINK_LIBRARIES wolfssl::wolfssl) -+endif() -+ - if(_wolfssl_FOUND) - set(WolfSSL_FOUND TRUE) +@@ -57,6 +57,17 @@ if(_wolfssl_FOUND) set(WOLFSSL_FOUND TRUE) + set(WOLFSSL_VERSION ${_wolfssl_VERSION}) + message(STATUS "Found WolfSSL (via pkg-config): ${_wolfssl_INCLUDE_DIRS} (found version \"${WOLFSSL_VERSION}\")") ++ find_package(_wolfssl_cmake NAMES wolfssl) ++ if(TARGET wolfssl::wolfssl AND NOT TARGET CURL::wolfssl) ++ add_library(CURL::wolfssl INTERFACE IMPORTED) ++ set_target_properties(CURL::wolfssl PROPERTIES ++ INTERFACE_LIBCURL_PC_LINK_LIBRARIES "${_wolfssl_LINK_LIBRARIES}" ++ INTERFACE_LIBCURL_PC_MODULES "${_wolfssl_pc_requires}" ++ INTERFACE_LINK_LIBRARIES wolfssl::wolfssl) ++ endif() ++elseif(1) ++ set(WolfSSL_FOUND FALSE) ++ set(WOLFSSL_FOUND FALSE) + else() + find_path(WOLFSSL_INCLUDE_DIR NAMES "wolfssl/ssl.h") + find_library(WOLFSSL_LIBRARY NAMES "wolfssl") diff --git a/CMake/FindZstd.cmake b/CMake/FindZstd.cmake -index 954a827b6f..9145d63070 100644 +index 954a827b6f..f3bf53dab5 100644 --- a/CMake/FindZstd.cmake +++ b/CMake/FindZstd.cmake -@@ -52,6 +52,15 @@ if(CURL_USE_PKGCONFIG AND - pkg_check_modules(_zstd ${_zstd_pc_requires}) - endif() - -+find_package(_zstd_cmake NAMES zstd) -+if(TARGET zstd::libzstd AND NOT TARGET CURL::zstd) -+ add_library(CURL::zstd INTERFACE IMPORTED) -+ set_target_properties(CURL::zstd PROPERTIES -+ INTERFACE_CURL_CONFIG_LIBS "${_zstd_LINK_LIBRARIES}" -+ INTERFACE_LIBCURL_PC_MODULES "${_zstd_pc_requires}" -+ INTERFACE_LINK_LIBRARIES zstd::libzstd) -+endif() -+ - if(_zstd_FOUND) - set(Zstd_FOUND TRUE) +@@ -57,6 +57,17 @@ if(_zstd_FOUND) set(ZSTD_FOUND TRUE) + set(ZSTD_VERSION ${_zstd_VERSION}) + message(STATUS "Found Zstd (via pkg-config): ${_zstd_INCLUDE_DIRS} (found version \"${ZSTD_VERSION}\")") ++ find_package(_zstd_cmake NAMES zstd) ++ if(TARGET zstd::libzstd AND NOT TARGET CURL::zstd) ++ add_library(CURL::zstd INTERFACE IMPORTED) ++ set_target_properties(CURL::zstd PROPERTIES ++ INTERFACE_LIBCURL_PC_LINK_LIBRARIES "${_zstd_LINK_LIBRARIES}" ++ INTERFACE_LIBCURL_PC_MODULES "${_zstd_pc_requires}" ++ INTERFACE_LINK_LIBRARIES zstd::libzstd) ++ endif() ++elseif(1) ++ set(Zstd_FOUND TRUE) ++ set(ZSTD_FOUND TRUE) + else() + find_path(ZSTD_INCLUDE_DIR NAMES "zstd.h") + find_library(ZSTD_LIBRARY NAMES "zstd") diff --git a/CMake/curl-config.cmake.in b/CMake/curl-config.cmake.in -index 7f346c832c..8f8b249ab1 100644 +index 7f346c832c..083fddbc04 100644 --- a/CMake/curl-config.cmake.in +++ b/CMake/curl-config.cmake.in -@@ -46,6 +46,7 @@ endif() - - set(_curl_cmake_module_path_save ${CMAKE_MODULE_PATH}) - set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR} ${CMAKE_MODULE_PATH}) -+set(_curl_cmake_module_path ${CMAKE_MODULE_PATH}) - +@@ -50,74 +50,50 @@ set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR} ${CMAKE_MODULE_PATH}) set(_curl_libs "") -@@ -92,6 +93,7 @@ endif() + if("@HAVE_BROTLI@") +- find_dependency(Brotli) +- list(APPEND _curl_libs CURL::brotli) ++ find_dependency(unofficial-brotli CONFIG) + endif() + if("@USE_ARES@") +- find_dependency(Cares) +- list(APPEND _curl_libs CURL::cares) ++ find_dependency(c-ares CONFIG) + endif() + if("@HAVE_GSSAPI@") +- find_dependency(GSS) +- list(APPEND _curl_libs CURL::gss) + endif() + if("@USE_BACKTRACE@") + find_dependency(Libbacktrace) + list(APPEND _curl_libs CURL::libbacktrace) + endif() + if("@USE_GSASL@") +- find_dependency(Libgsasl) +- list(APPEND _curl_libs CURL::libgsasl) + endif() + if(NOT "@USE_WIN32_LDAP@" AND NOT "@CURL_DISABLE_LDAP@") +- find_dependency(LDAP) +- list(APPEND _curl_libs CURL::ldap) + endif() + if("@HAVE_LIBIDN2@") +- find_dependency(Libidn2) +- list(APPEND _curl_libs CURL::libidn2) + endif() + if("@USE_LIBPSL@") +- find_dependency(Libpsl) +- list(APPEND _curl_libs CURL::libpsl) + endif() + if("@USE_LIBRTMP@") +- find_dependency(Librtmp) +- list(APPEND _curl_libs CURL::librtmp) + endif() + if("@USE_LIBSSH@") + find_dependency(Libssh) + list(APPEND _curl_libs CURL::libssh) + endif() if("@USE_LIBSSH2@") - find_dependency(Libssh2) - list(APPEND _curl_libs CURL::libssh2) -+ set(CMAKE_MODULE_PATH ${_curl_cmake_module_path}) +- find_dependency(Libssh2) +- list(APPEND _curl_libs CURL::libssh2) ++ find_dependency(libssh2 CONFIG) endif() if("@USE_LIBUV@") find_dependency(Libuv) -@@ -177,7 +179,7 @@ endif() + list(APPEND _curl_libs CURL::libuv) + endif() + if("@USE_MBEDTLS@") +- find_dependency(MbedTLS) +- list(APPEND _curl_libs CURL::mbedtls) ++ find_dependency(MbedTLS CONFIG) + endif() + if("@USE_NGHTTP2@") +- find_dependency(NGHTTP2) +- list(APPEND _curl_libs CURL::nghttp2) + endif() + if("@USE_NGHTTP3@") +- find_dependency(NGHTTP3) +- list(APPEND _curl_libs CURL::nghttp3) ++ find_dependency(nghttp3 CONFIG) + endif() + if("@USE_NGTCP2@") +- find_dependency(NGTCP2) +- list(APPEND _curl_libs CURL::ngtcp2) ++ find_dependency(ngtcp2 CONFIG) + endif() + if("@USE_GNUTLS@") +- find_dependency(GnuTLS) +- list(APPEND _curl_libs CURL::gnutls) +- find_dependency(Nettle) +- list(APPEND _curl_libs CURL::nettle) + endif() + if("@USE_QUICHE@") + find_dependency(Quiche) +@@ -128,12 +104,10 @@ if("@USE_RUSTLS@") + list(APPEND _curl_libs CURL::rustls) + endif() + if("@USE_WOLFSSL@") +- find_dependency(WolfSSL) +- list(APPEND _curl_libs CURL::wolfssl) ++ find_dependency(wolfssl CONFIG) + endif() + if("@HAVE_ZSTD@") +- find_dependency(Zstd) +- list(APPEND _curl_libs CURL::zstd) ++ find_dependency(zstd CONFIG) + endif() + + set(CMAKE_MODULE_PATH ${_curl_cmake_module_path_save}) +@@ -177,7 +151,11 @@ endif() # For compatibility with CMake's FindCURL.cmake set(CURL_VERSION_STRING "@CURLVERSION@") set(CURL_LIBRARIES @PROJECT_NAME@::@LIB_NAME@) -set(CURL_LIBRARIES_PRIVATE "@LIBCURL_PC_LIBS_PRIVATE_LIST@") -+set(CURL_LIBRARIES_PRIVATE "") # not multi-config. Relying on wrapper instead. ++set(CURL_LIBRARIES_PRIVATE "") ++# @CMAKE_BUILD_TYPE@ usage requirements ++set(_z_vcpkg_CURL_CONFIG_LIBS "@CURL_CONFIG_LIBS@") ++set(_z_vcpkg_LIBCURL_PC_LDFLAGS_PRIVATE "@LIBCURL_PC_LDFLAGS_PRIVATE@") ++set(_z_vcpkg_LIBCURL_PC_LIBS_PRIVATE_LIST "@LIBCURL_PC_LIBS_PRIVATE_LIST@") set_and_check(CURL_INCLUDE_DIRS "@PACKAGE_CMAKE_INSTALL_INCLUDEDIR@") set(CURL_SUPPORTED_PROTOCOLS "@CURL_SUPPORTED_PROTOCOLS_LIST@") diff --git a/CMakeLists.txt b/CMakeLists.txt -index 685335667b..a824903b48 100644 +index 685335667b..32fd68591d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -754,6 +754,12 @@ if(CURL_USE_OPENSSL) @@ -318,10 +428,10 @@ index 685335667b..a824903b48 100644 set_target_properties(OpenSSL::SSL PROPERTIES INTERFACE_LIBCURL_PC_MODULES "openssl") + find_package(PkgConfig QUIET) + pkg_check_modules(_openssl openssl REQUIRED) -+ set_target_properties(OpenSSL::SSL PROPERTIES INTERFACE_CURL_CONFIG_LIBS "${_openssl_LINK_LIBRARIES}") ++ set_target_properties(OpenSSL::SSL PROPERTIES INTERFACE_LIBCURL_PC_LINK_LIBRARIES "${_openssl_LINK_LIBRARIES}") + set_target_properties(OpenSSL::Crypto PROPERTIES INTERFACE_LIBCURL_PC_MODULES "libcrypto") + pkg_check_modules(_crypto libcrypto REQUIRED) -+ set_target_properties(OpenSSL::Crypto PROPERTIES INTERFACE_CURL_CONFIG_LIBS "${_crypto_LINK_LIBRARIES}") ++ set_target_properties(OpenSSL::Crypto PROPERTIES INTERFACE_LIBCURL_PC_LINK_LIBRARIES "${_crypto_LINK_LIBRARIES}") if(CURL_DEFAULT_SSL_BACKEND AND CURL_DEFAULT_SSL_BACKEND STREQUAL "openssl") set(_valid_default_ssl_backend TRUE) @@ -331,7 +441,7 @@ index 685335667b..a824903b48 100644 set_target_properties(ZLIB::ZLIB PROPERTIES INTERFACE_LIBCURL_PC_MODULES "zlib") + find_package(PkgConfig QUIET) + pkg_check_modules(_zlib zlib) -+ set_target_properties(ZLIB::ZLIB PROPERTIES INTERFACE_CURL_CONFIG_LIBS "${_zlib_LINK_LIBRARIES}") ++ set_target_properties(ZLIB::ZLIB PROPERTIES INTERFACE_LIBCURL_PC_LINK_LIBRARIES "${_zlib_LINK_LIBRARIES}") endif() set(HAVE_BROTLI OFF) @@ -346,54 +456,125 @@ index 685335667b..a824903b48 100644 list(APPEND CURL_LIBS ${_lib}) endif() endforeach() -@@ -2143,8 +2150,17 @@ if(NOT CURL_DISABLE_INSTALL) +@@ -1815,6 +1822,45 @@ if(CMAKE_C_COMPILER_ID STREQUAL "GNU") + endif() + endif() + ++# avoid downstream pkg-config requirement for CURL::dependency interface targets ++set(CURL_LIBS_RAW "${CURL_LIBS}") ++set(CURL_LIBS "") ++find_library(_libdl_absolute dl NO_CACHE) ++find_library(_libm_absolute m NO_CACHE) ++foreach(_lib IN LISTS CURL_LIBS_RAW) ++ if(NOT _lib MATCHES "CURL::") ++ list(APPEND CURL_LIBS ${_lib}) ++ continue() ++ endif() ++ get_target_property(_modules "${_lib}" INTERFACE_LIBCURL_PC_MODULES) ++ if(NOT _modules) ++ list(APPEND CURL_LIBS ${_lib}) ++ continue() ++ endif() ++ get_target_property(_pc_link_libs "${_lib}" INTERFACE_LIBCURL_PC_LINK_LIBRARIES) ++ get_target_property(_link_libs "${_lib}" INTERFACE_LINK_LIBRARIES) ++ if(_pc_link_libs AND NOT TARGET "${_link_libs}") ++ set(_link_libs "${_pc_link_libs}") ++ endif() ++ if(NOT _link_libs) ++ list(APPEND CURL_LIBS ${_lib}) ++ continue() ++ endif() ++ list(APPEND CURL_LIBS $) ++ message(STATUS ",,${_index},${CURL_LIBS}") ++ foreach(_item IN LISTS _link_libs) ++ if(_item STREQUAL "${_libdl_absolute}") ++ set(_item dl) ++ list(REMOVE_ITEM CURL_LIBS $) ++ elseif(_item STREQUAL "${_libm_absolute}") ++ set(_item m) ++ list(REMOVE_ITEM CURL_LIBS $) ++ endif() ++ list(APPEND CURL_LIBS $) ++ message(STATUS ",,,${_index},${CURL_LIBS}") ++ endforeach() ++endforeach() ++ + if(CMAKE_C_COMPILER_ID STREQUAL "MSVC") # MSVC but exclude clang-cl + set_property(DIRECTORY APPEND PROPERTY COMPILE_OPTIONS "-MP") # Parallel compilation + endif() +@@ -2109,7 +2155,7 @@ if(NOT CURL_DISABLE_INSTALL) + set(_explicit_libdirs "") + set(LIBCURL_PC_REQUIRES_PRIVATE "") + set(LIBCURL_PC_LIBS_PRIVATE_LIST "") +- foreach(_lib IN LISTS CURL_LIBS _custom_libs _implicit_libs) ++ foreach(_lib IN LISTS CURL_LIBS_RAW _custom_libs _implicit_libs) + if(TARGET "${_lib}") + set(_explicit_libs "") + get_target_property(_imported "${_lib}" IMPORTED) +@@ -2143,8 +2189,18 @@ if(NOT CURL_DISABLE_INSTALL) get_target_property(_modules "${_lib}" INTERFACE_LIBCURL_PC_MODULES) if(_modules) list(APPEND LIBCURL_PC_REQUIRES_PRIVATE "${_modules}") -+ get_target_property(_link_libs "${_lib}" INTERFACE_CURL_CONFIG_LIBS) -+ message(STATUS "xxx ${_lib} : ${_link_libs}") ++ get_target_property(_link_libs "${_lib}" INTERFACE_LIBCURL_PC_LINK_LIBRARIES) + if(_link_libs) + set(_explicit_libs "${_link_libs}") + endif() ++ message(STATUS "xxx ${_lib} : ${_explicit_libs}") + else() + message(STATUS "xxx ${_lib} : ---") endif() + set(LIBCURL_PC_LIBS_PRIVATE_NO_MODULES "${LIBCURL_PC_LIBS_PRIVATE}") + set(LIBCURL_PC_LIBS_PRIVATE "") ++ set(_original_lib "${_lib}") foreach(_lib IN LISTS _explicit_libs) if(_lib MATCHES "/") # This gets a bit more complex, because we want to specify the -@@ -2163,6 +2179,7 @@ if(NOT CURL_DISABLE_INSTALL) +@@ -2163,24 +2219,43 @@ if(NOT CURL_DISABLE_INSTALL) list(FIND _sys_libdirs "${_libdir}" _libdir_index) if(_libdir_index LESS 0) list(APPEND _ldflags "-L${_libdir}") + message(STATUS "++ ${_lib}") endif() string(REGEX REPLACE "^lib" "" _libname "${_libname}") ++ list(REMOVE_ITEM CURL_CONFIG_LIBS "-l${_libname}") list(APPEND LIBCURL_PC_LIBS_PRIVATE "-l${_libname}") -@@ -2176,11 +2193,20 @@ if(NOT CURL_DISABLE_INSTALL) ++ list(REMOVE_ITEM LIBCURL_PC_LIBS_PRIVATE_LIST "${_lib}") + list(APPEND LIBCURL_PC_LIBS_PRIVATE_LIST "${_lib}") + else() + list(APPEND LIBCURL_PC_LIBS_PRIVATE "${_lib}") ++ list(REMOVE_ITEM LIBCURL_PC_LIBS_PRIVATE_LIST "${_lib}") + list(APPEND LIBCURL_PC_LIBS_PRIVATE_LIST "${_lib}") + endif() + else() ++ list(REMOVE_ITEM CURL_CONFIG_LIBS "-l${_lib}") + list(APPEND LIBCURL_PC_LIBS_PRIVATE "-l${_lib}") ++ list(REMOVE_ITEM LIBCURL_PC_LIBS_PRIVATE_LIST "${_lib}") list(APPEND LIBCURL_PC_LIBS_PRIVATE_LIST "${_lib}") endif() endforeach() + list(APPEND CURL_CONFIG_LIBS ${LIBCURL_PC_LIBS_PRIVATE}) + if(NOT _modules) -+ message(STATUS ">>> ${_lib} : ${LIBCURL_PC_LIBS_PRIVATE}") ++ message(STATUS "[vcpkg] ${_original_lib} does not have a pkgconfig module") + list(APPEND LIBCURL_PC_LIBS_PRIVATE_NO_MODULES ${LIBCURL_PC_LIBS_PRIVATE}) + endif() + set(LIBCURL_PC_LIBS_PRIVATE "${LIBCURL_PC_LIBS_PRIVATE_NO_MODULES}") elseif(_lib MATCHES "^-") # '-framework ' list(APPEND _ldflags "${_lib}") ++ list(REMOVE_ITEM LIBCURL_PC_LIBS_PRIVATE_LIST "${_lib}") list(APPEND LIBCURL_PC_LIBS_PRIVATE_LIST "${_lib}") + message(STATUS " x ${_lib} : ---") else() ++ list(REMOVE_ITEM CURL_CONFIG_LIBS "-l${_lib}") + list(APPEND CURL_CONFIG_LIBS "-l${_lib}") ++ list(REMOVE_ITEM LIBCURL_PC_LIBS_PRIVATE "-l${_lib}") list(APPEND LIBCURL_PC_LIBS_PRIVATE "-l${_lib}") + message(STATUS " x ${_lib} : -l${}_lib") ++ list(REMOVE_ITEM LIBCURL_PC_LIBS_PRIVATE_LIST "${_lib}") list(APPEND LIBCURL_PC_LIBS_PRIVATE_LIST "${_lib}") endif() endforeach() -@@ -2204,6 +2230,7 @@ if(NOT CURL_DISABLE_INSTALL) +@@ -2204,6 +2279,7 @@ if(NOT CURL_DISABLE_INSTALL) if(LIBCURL_PC_LIBS_PRIVATE) string(REPLACE ";" " " LIBCURL_PC_LIBS_PRIVATE "${LIBCURL_PC_LIBS_PRIVATE}") endif() From 02e263bb000dc349c2a016a82165659f52861e18 Mon Sep 17 00:00:00 2001 From: Kai Pastor Date: Tue, 9 Dec 2025 07:30:00 +0100 Subject: [PATCH 08/22] [libssh2] Fix exported config for cmake < 3.18.0 --- ports/libssh2/cmake-config.diff | 18 ++++++++++++++++++ ports/libssh2/portfile.cmake | 3 ++- ports/libssh2/vcpkg.json | 2 +- versions/baseline.json | 2 +- versions/l-/libssh2.json | 5 +++++ 5 files changed, 27 insertions(+), 3 deletions(-) create mode 100644 ports/libssh2/cmake-config.diff diff --git a/ports/libssh2/cmake-config.diff b/ports/libssh2/cmake-config.diff new file mode 100644 index 00000000000000..0743056d27f8e4 --- /dev/null +++ b/ports/libssh2/cmake-config.diff @@ -0,0 +1,18 @@ +diff --git a/cmake/libssh2-config.cmake.in b/cmake/libssh2-config.cmake.in +index edc86d7..0088da2 100644 +--- a/cmake/libssh2-config.cmake.in ++++ b/cmake/libssh2-config.cmake.in +@@ -22,7 +22,13 @@ include("${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@-targets.cmake") + + # Alias for either shared or static library + if(NOT TARGET @PROJECT_NAME@::@LIB_NAME@) ++ if(CMAKE_VERSION VERSION_LESS "3.18.0") ++ # cannot add alias to non-global imported library ++ add_library(@PROJECT_NAME@::@LIB_NAME@ INTERFACE IMPORTED) ++ set_target_properties(@PROJECT_NAME@::@LIB_NAME@ PROPERTIES INTERFACE_LINK_LIBRARIES @PROJECT_NAME@::@LIB_SELECTED@) ++ else() + add_library(@PROJECT_NAME@::@LIB_NAME@ ALIAS @PROJECT_NAME@::@LIB_SELECTED@) ++ endif() + endif() + + # Compatibility alias diff --git a/ports/libssh2/portfile.cmake b/ports/libssh2/portfile.cmake index 2f0bea470d163b..ae4b29cfedd38f 100644 --- a/ports/libssh2/portfile.cmake +++ b/ports/libssh2/portfile.cmake @@ -5,6 +5,7 @@ vcpkg_from_github( SHA512 616efcd7f5c1fb1046104ebce70549e4756e2a55150efa2df5bb7123051d3bf336023cedcbfe932cd7c690a0b4d1f1a93c760ea39f1dba50c2b06d0945dca958 HEAD_REF master PATCHES + cmake-config.diff pkgconfig.diff ) @@ -24,11 +25,11 @@ if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") endif() vcpkg_find_acquire_program(PKGCONFIG) +set(ENV{PKG_CONFIG} "${PKGCONFIG}") vcpkg_cmake_configure( SOURCE_PATH "${SOURCE_PATH}" OPTIONS - "-DPKG_CONFIG_EXECUTABLE=${PKGCONFIG}" -DBUILD_EXAMPLES=OFF -DBUILD_TESTING=OFF -DENABLE_DEBUG_LOGGING=OFF diff --git a/ports/libssh2/vcpkg.json b/ports/libssh2/vcpkg.json index 31e616ad7d1bcf..7b0bd3eb2af497 100644 --- a/ports/libssh2/vcpkg.json +++ b/ports/libssh2/vcpkg.json @@ -1,7 +1,7 @@ { "name": "libssh2", "version": "1.11.1", - "port-version": 1, + "port-version": 2, "description": "libssh2 is a client-side C library implementing the SSH2 protocol.", "homepage": "https://www.libssh2.org", "license": "BSD-3-Clause", diff --git a/versions/baseline.json b/versions/baseline.json index 85f7eb034241c0..c0cea154f79be2 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -5554,7 +5554,7 @@ }, "libssh2": { "baseline": "1.11.1", - "port-version": 1 + "port-version": 2 }, "libstemmer": { "baseline": "2021.2.2.0", diff --git a/versions/l-/libssh2.json b/versions/l-/libssh2.json index b4c5575868c6ec..5bd5e6a3dd10bf 100644 --- a/versions/l-/libssh2.json +++ b/versions/l-/libssh2.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "8b46515f3f213a505c48511e48539b3e6bfb70b9", + "version": "1.11.1", + "port-version": 2 + }, { "git-tree": "01783f68b91820c8270fe759f595b5562fb55a7c", "version": "1.11.1", From bce8a9ea95ab36ade43d2ff86388e64e31dd42f9 Mon Sep 17 00:00:00 2001 From: Kai Pastor Date: Tue, 9 Dec 2025 08:02:08 +0100 Subject: [PATCH 09/22] [vcpkg-ci-curl] Test CMake package without pkgconfig --- scripts/test_ports/vcpkg-ci-curl/portfile.cmake | 3 +-- scripts/test_ports/vcpkg-ci-curl/project/CMakeLists.txt | 6 ++++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/scripts/test_ports/vcpkg-ci-curl/portfile.cmake b/scripts/test_ports/vcpkg-ci-curl/portfile.cmake index d66f1b3c8e3011..d935b1bf64bd54 100644 --- a/scripts/test_ports/vcpkg-ci-curl/portfile.cmake +++ b/scripts/test_ports/vcpkg-ci-curl/portfile.cmake @@ -1,11 +1,10 @@ set(VCPKG_POLICY_EMPTY_PACKAGE enabled) vcpkg_find_acquire_program(PKGCONFIG) +set(ENV{PKG_CONFIG} "${PKGCONFIG}") vcpkg_cmake_configure( SOURCE_PATH "${CURRENT_PORT_DIR}/project" - OPTIONS - "-DPKG_CONFIG_EXECUTABLE=${PKGCONFIG}" OPTIONS_RELEASE "-DCURL_CONFIG=${CURRENT_INSTALLED_DIR}/tools/curl/bin/curl-config" OPTIONS_DEBUG diff --git a/scripts/test_ports/vcpkg-ci-curl/project/CMakeLists.txt b/scripts/test_ports/vcpkg-ci-curl/project/CMakeLists.txt index ae54cc31df2eb8..4e7e1d4b4a6839 100644 --- a/scripts/test_ports/vcpkg-ci-curl/project/CMakeLists.txt +++ b/scripts/test_ports/vcpkg-ci-curl/project/CMakeLists.txt @@ -3,11 +3,17 @@ project(libcurl-test C) block(SCOPE_FOR VARIABLES) # blocked by FindOpenSSL in CMake 3.30: set(CMAKE_DISABLE_FIND_PACKAGE_PkgConfig 1) + set(env_pkg_config_backup "$ENV{PKG_CONFIG}") + set(ENV{PKG_CONFIG} "${CMAKE_COMMAND} -E false") find_package(CURL COMPONENTS libz REQUIRED) add_executable(main main.c) target_link_libraries(main PRIVATE CURL::libcurl) + + unset(PKG_CONFIG_EXECUTABLE CACHE) + unset(PKG_CONFIG_ARGN CACHE) + set(ENV{PKG_CONFIG} "${env_pkg_config_backup}") endblock() block(SCOPE_FOR VARIABLES) From 1a06390f867978888a706b69a20db563d059324b Mon Sep 17 00:00:00 2001 From: Kai Pastor Date: Tue, 9 Dec 2025 09:00:46 +0100 Subject: [PATCH 10/22] WIP [skip actions] --- ports/curl/wip.diff | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/ports/curl/wip.diff b/ports/curl/wip.diff index 3477c83e1b1f72..3265b94c1e26fa 100644 --- a/ports/curl/wip.diff +++ b/ports/curl/wip.diff @@ -419,7 +419,7 @@ index 7f346c832c..083fddbc04 100644 set(CURL_SUPPORTED_PROTOCOLS "@CURL_SUPPORTED_PROTOCOLS_LIST@") diff --git a/CMakeLists.txt b/CMakeLists.txt -index 685335667b..32fd68591d 100644 +index 685335667b..8e49f291c7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -754,6 +754,12 @@ if(CURL_USE_OPENSSL) @@ -456,11 +456,12 @@ index 685335667b..32fd68591d 100644 list(APPEND CURL_LIBS ${_lib}) endif() endforeach() -@@ -1815,6 +1822,45 @@ if(CMAKE_C_COMPILER_ID STREQUAL "GNU") +@@ -1815,6 +1822,46 @@ if(CMAKE_C_COMPILER_ID STREQUAL "GNU") endif() endif() +# avoid downstream pkg-config requirement for CURL::dependency interface targets ++# changing CURL_LIBS before add_subdirectory(src) +set(CURL_LIBS_RAW "${CURL_LIBS}") +set(CURL_LIBS "") +find_library(_libdl_absolute dl NO_CACHE) @@ -502,7 +503,7 @@ index 685335667b..32fd68591d 100644 if(CMAKE_C_COMPILER_ID STREQUAL "MSVC") # MSVC but exclude clang-cl set_property(DIRECTORY APPEND PROPERTY COMPILE_OPTIONS "-MP") # Parallel compilation endif() -@@ -2109,7 +2155,7 @@ if(NOT CURL_DISABLE_INSTALL) +@@ -2109,7 +2156,7 @@ if(NOT CURL_DISABLE_INSTALL) set(_explicit_libdirs "") set(LIBCURL_PC_REQUIRES_PRIVATE "") set(LIBCURL_PC_LIBS_PRIVATE_LIST "") @@ -511,7 +512,7 @@ index 685335667b..32fd68591d 100644 if(TARGET "${_lib}") set(_explicit_libs "") get_target_property(_imported "${_lib}" IMPORTED) -@@ -2143,8 +2189,18 @@ if(NOT CURL_DISABLE_INSTALL) +@@ -2143,8 +2190,18 @@ if(NOT CURL_DISABLE_INSTALL) get_target_property(_modules "${_lib}" INTERFACE_LIBCURL_PC_MODULES) if(_modules) list(APPEND LIBCURL_PC_REQUIRES_PRIVATE "${_modules}") @@ -530,7 +531,7 @@ index 685335667b..32fd68591d 100644 foreach(_lib IN LISTS _explicit_libs) if(_lib MATCHES "/") # This gets a bit more complex, because we want to specify the -@@ -2163,24 +2219,43 @@ if(NOT CURL_DISABLE_INSTALL) +@@ -2163,24 +2220,47 @@ if(NOT CURL_DISABLE_INSTALL) list(FIND _sys_libdirs "${_libdir}" _libdir_index) if(_libdir_index LESS 0) list(APPEND _ldflags "-L${_libdir}") @@ -546,6 +547,10 @@ index 685335667b..32fd68591d 100644 + list(REMOVE_ITEM LIBCURL_PC_LIBS_PRIVATE_LIST "${_lib}") list(APPEND LIBCURL_PC_LIBS_PRIVATE_LIST "${_lib}") endif() ++ elseif(_lib MATCHES "^-") # '-framework ' ++ list(APPEND _ldflags "${_lib}") ++ list(REMOVE_ITEM LIBCURL_PC_LIBS_PRIVATE_LIST "${_lib}") ++ list(APPEND LIBCURL_PC_LIBS_PRIVATE_LIST "${_lib}") else() + list(REMOVE_ITEM CURL_CONFIG_LIBS "-l${_lib}") list(APPEND LIBCURL_PC_LIBS_PRIVATE "-l${_lib}") @@ -574,7 +579,7 @@ index 685335667b..32fd68591d 100644 list(APPEND LIBCURL_PC_LIBS_PRIVATE_LIST "${_lib}") endif() endforeach() -@@ -2204,6 +2279,7 @@ if(NOT CURL_DISABLE_INSTALL) +@@ -2204,6 +2284,7 @@ if(NOT CURL_DISABLE_INSTALL) if(LIBCURL_PC_LIBS_PRIVATE) string(REPLACE ";" " " LIBCURL_PC_LIBS_PRIVATE "${LIBCURL_PC_LIBS_PRIVATE}") endif() From 0c4981b8624444c756bf59df3920c4ef3032e3f2 Mon Sep 17 00:00:00 2001 From: Kai Pastor Date: Tue, 9 Dec 2025 20:59:41 +0100 Subject: [PATCH 11/22] Fixup [skip actions] --- ports/libssh2/cmake-config.diff | 13 +++++++++++-- versions/l-/libssh2.json | 2 +- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/ports/libssh2/cmake-config.diff b/ports/libssh2/cmake-config.diff index 0743056d27f8e4..76ed3d83e7aa44 100644 --- a/ports/libssh2/cmake-config.diff +++ b/ports/libssh2/cmake-config.diff @@ -1,8 +1,8 @@ diff --git a/cmake/libssh2-config.cmake.in b/cmake/libssh2-config.cmake.in -index edc86d7..0088da2 100644 +index edc86d7..fd53d55 100644 --- a/cmake/libssh2-config.cmake.in +++ b/cmake/libssh2-config.cmake.in -@@ -22,7 +22,13 @@ include("${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@-targets.cmake") +@@ -22,10 +22,22 @@ include("${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@-targets.cmake") # Alias for either shared or static library if(NOT TARGET @PROJECT_NAME@::@LIB_NAME@) @@ -16,3 +16,12 @@ index edc86d7..0088da2 100644 endif() # Compatibility alias + if(NOT TARGET Libssh2::@LIB_NAME@) ++ if(CMAKE_VERSION VERSION_LESS "3.18.0") ++ # cannot add alias to non-global imported library ++ add_library(Libssh2::@LIB_NAME@ INTERFACE IMPORTED) ++ set_target_properties(Libssh2::@LIB_NAME@ PROPERTIES INTERFACE_LINK_LIBRARIES @PROJECT_NAME@::@LIB_SELECTED@) ++ else() + add_library(Libssh2::@LIB_NAME@ ALIAS @PROJECT_NAME@::@LIB_SELECTED@) ++ endif() + endif() diff --git a/versions/l-/libssh2.json b/versions/l-/libssh2.json index 5bd5e6a3dd10bf..33ffd6413e8b1e 100644 --- a/versions/l-/libssh2.json +++ b/versions/l-/libssh2.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "8b46515f3f213a505c48511e48539b3e6bfb70b9", + "git-tree": "6c7dcac34e292ddbac4c17716d218f35606c65a6", "version": "1.11.1", "port-version": 2 }, From b9df94dbe480e4c046256139f728accbb692588f Mon Sep 17 00:00:00 2001 From: Kai Pastor Date: Wed, 10 Dec 2025 08:22:09 +0100 Subject: [PATCH 12/22] [curl] Simplify wrapper --- ports/curl/vcpkg-cmake-wrapper.cmake | 47 ++++++++++++++-------------- 1 file changed, 23 insertions(+), 24 deletions(-) diff --git a/ports/curl/vcpkg-cmake-wrapper.cmake b/ports/curl/vcpkg-cmake-wrapper.cmake index 99ce35dd3d34ec..e89f11e95fc445 100644 --- a/ports/curl/vcpkg-cmake-wrapper.cmake +++ b/ports/curl/vcpkg-cmake-wrapper.cmake @@ -1,19 +1,17 @@ list(REMOVE_ITEM ARGS "NO_MODULE" "CONFIG" "MODULE") +list(GET ARGS 0 _z_vcpg_curl_name) _find_package(${ARGS} CONFIG) -if(CURL_FOUND) +if(${_z_vcpg_curl_name}_FOUND) cmake_policy(PUSH) cmake_policy(SET CMP0012 NEW) cmake_policy(SET CMP0054 NEW) cmake_policy(SET CMP0057 NEW) - include("${CMAKE_ROOT}/Modules/SelectLibraryConfigurations.cmake") - set(_curl_target CURL::libcurl_shared) if(TARGET CURL::libcurl_static) set(_curl_target CURL::libcurl_static) endif() - get_target_property(_curl_include_dirs ${_curl_target} INTERFACE_INCLUDE_DIRECTORIES) get_target_property(_curl_link_libraries ${_curl_target} INTERFACE_LINK_LIBRARIES) if(NOT _curl_link_libraries) set(_curl_link_libraries "") @@ -25,30 +23,31 @@ if(CURL_FOUND) string(REGEX REPLACE "([\$]<[^;]*)?OpenSSL::(SSL|Crypto)([^;]*>)?" "${OPENSSL_LIBRARIES}" _curl_link_libraries "${_curl_link_libraries}") endif() if(_curl_link_libraries MATCHES "::") - message(WARNING "CURL_LIBRARIES list at least one target. This will not work for use cases where targets are not resolved.") - endif() + # leave CURL_LIBRARIES as set by upstream (imported target) + message(WARNING "Cannot easily unroll CURL_LIBRARIES (\"${CURL_LIBRARIES}\") to filepaths. Exported CMake config must use \"find_dependency(CURL)\".") + else() + # resolve CURL_LIBRARIES to filepaths. + if(WIN32) + get_target_property(_curl_location_debug ${_curl_target} IMPORTED_IMPLIB_DEBUG) + get_target_property(_curl_location_release ${_curl_target} IMPORTED_IMPLIB_RELEASE) + endif() - if(WIN32) - get_target_property(_curl_location_debug ${_curl_target} IMPORTED_IMPLIB_DEBUG) - get_target_property(_curl_location_release ${_curl_target} IMPORTED_IMPLIB_RELEASE) - endif() + if(NOT _curl_location_debug AND NOT _curl_location_release) + get_target_property(_curl_location_debug ${_curl_target} IMPORTED_LOCATION_DEBUG) + get_target_property(_curl_location_release ${_curl_target} IMPORTED_LOCATION_RELEASE) + endif() - if(NOT _curl_location_debug AND NOT _curl_location_release) - get_target_property(_curl_location_debug ${_curl_target} IMPORTED_LOCATION_DEBUG) - get_target_property(_curl_location_release ${_curl_target} IMPORTED_LOCATION_RELEASE) - endif() + set(CURL_LIBRARY_DEBUG "${_curl_location_debug}" CACHE INTERNAL "vcpkg") + set(CURL_LIBRARY_RELEASE "${_curl_location_release}" CACHE INTERNAL "vcpkg") + include("${CMAKE_ROOT}/Modules/SelectLibraryConfigurations.cmake") + select_library_configurations(CURL) + set(CURL_LIBRARIES ${CURL_LIBRARY} ${_curl_link_libraries}) - set(CURL_INCLUDE_DIRS "${_curl_include_dirs}") - set(CURL_LIBRARY_DEBUG "${_curl_location_debug}" CACHE INTERNAL "vcpkg") - set(CURL_LIBRARY_RELEASE "${_curl_location_release}" CACHE INTERNAL "vcpkg") - select_library_configurations(CURL) - set(CURL_LIBRARIES ${CURL_LIBRARY} ${_curl_link_libraries}) - set(CURL_VERSION_STRING "${CURL_VERSION}") + unset(_curl_link_libraries) + unset(_curl_location_debug) + unset(_curl_location_release) + endif() - unset(_curl_include_dirs) - unset(_curl_link_libraries) - unset(_curl_location_debug) - unset(_curl_location_release) unset(_curl_target) cmake_policy(POP) endif() From 3ee4b12e439438c8ef249ce686b0d60c3d528036 Mon Sep 17 00:00:00 2001 From: Kai Pastor Date: Wed, 10 Dec 2025 08:30:23 +0100 Subject: [PATCH 13/22] [curl] Cleanup the patches [skip actions] --- ports/curl/dependencies.patch | 752 ++++++++++++++++++++----- ports/curl/pkgconfig-curl-config.patch | 106 ---- ports/curl/portfile.cmake | 4 +- ports/curl/wip.diff | 628 --------------------- 4 files changed, 601 insertions(+), 889 deletions(-) delete mode 100644 ports/curl/pkgconfig-curl-config.patch delete mode 100644 ports/curl/wip.diff diff --git a/ports/curl/dependencies.patch b/ports/curl/dependencies.patch index e435ee57676c68..f5c94b0e4bc4dc 100644 --- a/ports/curl/dependencies.patch +++ b/ports/curl/dependencies.patch @@ -1,169 +1,617 @@ +diff --git a/CMake/FindBrotli.cmake b/CMake/FindBrotli.cmake +index 981b30cafd..e7bfbca0b2 100644 +--- a/CMake/FindBrotli.cmake ++++ b/CMake/FindBrotli.cmake +@@ -50,6 +50,17 @@ if(_brotli_FOUND) + set(BROTLI_FOUND TRUE) + set(BROTLI_VERSION ${_brotli_libbrotlicommon_VERSION}) + message(STATUS "Found Brotli (via pkg-config): ${_brotli_INCLUDE_DIRS} (found version \"${BROTLI_VERSION}\")") ++ find_package(_brotli_cmake NAMES unofficial-brotli) ++ if(TARGET unofficial::brotli::brotlidec AND NOT TARGET CURL::brotli) ++ add_library(CURL::brotli INTERFACE IMPORTED) ++ set_target_properties(CURL::brotli PROPERTIES ++ INTERFACE_LIBCURL_PC_LINK_LIBRARIES "${_brotli_LINK_LIBRARIES}" ++ INTERFACE_LIBCURL_PC_MODULES "${_brotli_pc_requires}" ++ INTERFACE_LINK_LIBRARIES unofficial::brotli::brotlidec) ++ endif() ++elseif(1) ++ set(Brotli_FOUND FALSE) ++ set(BROTLI_FOUND FALSE) + else() + find_path(BROTLI_INCLUDE_DIR "brotli/decode.h") + find_library(BROTLICOMMON_LIBRARY NAMES "brotlicommon") +diff --git a/CMake/FindCares.cmake b/CMake/FindCares.cmake +index 4a20bc0af4..fcb113e0a7 100644 +--- a/CMake/FindCares.cmake ++++ b/CMake/FindCares.cmake +@@ -48,6 +48,17 @@ if(_cares_FOUND) + set(CARES_FOUND TRUE) + set(CARES_VERSION ${_cares_VERSION}) + message(STATUS "Found Cares (via pkg-config): ${_cares_INCLUDE_DIRS} (found version \"${CARES_VERSION}\")") ++ find_package(_cares_cmake NAMES c-ares) ++ if(TARGET c-ares::cares AND NOT TARGET CURL::cares) ++ add_library(CURL::cares INTERFACE IMPORTED) ++ set_target_properties(CURL::cares PROPERTIES ++ INTERFACE_LIBCURL_PC_LINK_LIBRARIES "${_cares_LINK_LIBRARIES}" ++ INTERFACE_LIBCURL_PC_MODULES "${_cares_pc_requires}" ++ INTERFACE_LINK_LIBRARIES c-ares::cares) ++ endif() ++elseif(1) ++ set(Cares_FOUND FALSE) ++ set(CARES_FOUND FALSE) + else() + find_path(CARES_INCLUDE_DIR NAMES "ares.h") + find_library(CARES_LIBRARY NAMES ${CARES_NAMES} "cares") +diff --git a/CMake/FindGSS.cmake b/CMake/FindGSS.cmake +index 106c4c4edd..a027983929 100644 +--- a/CMake/FindGSS.cmake ++++ b/CMake/FindGSS.cmake +@@ -269,7 +269,6 @@ if(GSS_FOUND) + INTERFACE_LIBCURL_PC_MODULES "${_gss_pc_requires}" + INTERFACE_COMPILE_OPTIONS "${_gss_CFLAGS}" + INTERFACE_INCLUDE_DIRECTORIES "${_gss_INCLUDE_DIRS}" +- INTERFACE_LINK_DIRECTORIES "${_gss_LIBRARY_DIRS}" +- INTERFACE_LINK_LIBRARIES "${_gss_LIBRARIES}") ++ INTERFACE_LINK_LIBRARIES "${_gss_LINK_LIBRARIES}") + endif() + endif() diff --git a/CMake/FindGnuTLS.cmake b/CMake/FindGnuTLS.cmake -index 4de4f82eee..f47e049101 100644 +index fff57b2c29..7d81acd99a 100644 --- a/CMake/FindGnuTLS.cmake +++ b/CMake/FindGnuTLS.cmake -@@ -40,6 +40,7 @@ +@@ -36,6 +36,7 @@ - set(GNUTLS_PC_REQUIRES "gnutls") + set(_gnutls_pc_requires "gnutls") +unset(GNUTLS_LIBRARY CACHE) # from shiftmedia-libgnutls cmake wrapper if(CURL_USE_PKGCONFIG AND NOT DEFINED GNUTLS_INCLUDE_DIR AND NOT DEFINED GNUTLS_LIBRARY) +@@ -90,7 +91,6 @@ if(GNUTLS_FOUND) + INTERFACE_LIBCURL_PC_MODULES "${_gnutls_pc_requires}" + INTERFACE_COMPILE_OPTIONS "${_gnutls_CFLAGS}" + INTERFACE_INCLUDE_DIRECTORIES "${_gnutls_INCLUDE_DIRS}" +- INTERFACE_LINK_DIRECTORIES "${_gnutls_LIBRARY_DIRS}" +- INTERFACE_LINK_LIBRARIES "${_gnutls_LIBRARIES}") ++ INTERFACE_LINK_LIBRARIES "${_gnutls_LINK_LIBRARIES}") + endif() + endif() +diff --git a/CMake/FindLDAP.cmake b/CMake/FindLDAP.cmake +index 2f5cc713c7..63c1b0800f 100644 +--- a/CMake/FindLDAP.cmake ++++ b/CMake/FindLDAP.cmake +@@ -113,7 +113,6 @@ if(LDAP_FOUND) + INTERFACE_LIBCURL_PC_MODULES "${_ldap_pc_requires}" + INTERFACE_COMPILE_OPTIONS "${_ldap_CFLAGS}" + INTERFACE_INCLUDE_DIRECTORIES "${_ldap_INCLUDE_DIRS}" +- INTERFACE_LINK_DIRECTORIES "${_ldap_LIBRARY_DIRS}" +- INTERFACE_LINK_LIBRARIES "${_ldap_LIBRARIES}") ++ INTERFACE_LINK_LIBRARIES "${_ldap_LINK_LIBRARIES}") + endif() + endif() +diff --git a/CMake/FindLibgsasl.cmake b/CMake/FindLibgsasl.cmake +index 5ddf957d72..db462466e4 100644 +--- a/CMake/FindLibgsasl.cmake ++++ b/CMake/FindLibgsasl.cmake +@@ -89,7 +89,6 @@ if(LIBGSASL_FOUND) + INTERFACE_LIBCURL_PC_MODULES "${_libgsasl_pc_requires}" + INTERFACE_COMPILE_OPTIONS "${_libgsasl_CFLAGS}" + INTERFACE_INCLUDE_DIRECTORIES "${_libgsasl_INCLUDE_DIRS}" +- INTERFACE_LINK_DIRECTORIES "${_libgsasl_LIBRARY_DIRS}" +- INTERFACE_LINK_LIBRARIES "${_libgsasl_LIBRARIES}") ++ INTERFACE_LINK_LIBRARIES "${_libgsasl_LINK_LIBRARIES}") + endif() + endif() +diff --git a/CMake/FindLibidn2.cmake b/CMake/FindLibidn2.cmake +index 336a7f7b40..b2f3eaf534 100644 +--- a/CMake/FindLibidn2.cmake ++++ b/CMake/FindLibidn2.cmake +@@ -90,7 +90,6 @@ if(LIBIDN2_FOUND) + INTERFACE_LIBCURL_PC_MODULES "${_libidn2_pc_requires}" + INTERFACE_COMPILE_OPTIONS "${_libidn2_CFLAGS}" + INTERFACE_INCLUDE_DIRECTORIES "${_libidn2_INCLUDE_DIRS}" +- INTERFACE_LINK_DIRECTORIES "${_libidn2_LIBRARY_DIRS}" +- INTERFACE_LINK_LIBRARIES "${_libidn2_LIBRARIES}") ++ INTERFACE_LINK_LIBRARIES "${_libidn2_LINK_LIBRARIES}") + endif() + endif() +diff --git a/CMake/FindLibpsl.cmake b/CMake/FindLibpsl.cmake +index 9b1a0cdd97..a7fe288883 100644 +--- a/CMake/FindLibpsl.cmake ++++ b/CMake/FindLibpsl.cmake +@@ -90,7 +90,6 @@ if(LIBPSL_FOUND) + INTERFACE_LIBCURL_PC_MODULES "${_libpsl_pc_requires}" + INTERFACE_COMPILE_OPTIONS "${_libpsl_CFLAGS}" + INTERFACE_INCLUDE_DIRECTORIES "${_libpsl_INCLUDE_DIRS}" +- INTERFACE_LINK_DIRECTORIES "${_libpsl_LIBRARY_DIRS}" +- INTERFACE_LINK_LIBRARIES "${_libpsl_LIBRARIES}") ++ INTERFACE_LINK_LIBRARIES "${_libpsl_LINK_LIBRARIES}") + endif() + endif() +diff --git a/CMake/FindLibrtmp.cmake b/CMake/FindLibrtmp.cmake +index 070538578e..9b5370be17 100644 +--- a/CMake/FindLibrtmp.cmake ++++ b/CMake/FindLibrtmp.cmake +@@ -110,7 +110,6 @@ if(LIBRTMP_FOUND) + INTERFACE_LIBCURL_PC_MODULES "${_librtmp_pc_requires}" + INTERFACE_COMPILE_OPTIONS "${_librtmp_CFLAGS}" + INTERFACE_INCLUDE_DIRECTORIES "${_librtmp_INCLUDE_DIRS}" +- INTERFACE_LINK_DIRECTORIES "${_librtmp_LIBRARY_DIRS}" +- INTERFACE_LINK_LIBRARIES "${_librtmp_LIBRARIES}") ++ INTERFACE_LINK_LIBRARIES "${_librtmp_LINK_LIBRARIES}") + endif() + endif() +diff --git a/CMake/FindLibssh2.cmake b/CMake/FindLibssh2.cmake +index 330611bfe5..94b5567c0e 100644 +--- a/CMake/FindLibssh2.cmake ++++ b/CMake/FindLibssh2.cmake +@@ -48,6 +48,17 @@ if(_libssh2_FOUND AND _libssh2_INCLUDE_DIRS) + set(LIBSSH2_FOUND TRUE) + set(LIBSSH2_VERSION ${_libssh2_VERSION}) + message(STATUS "Found Libssh2 (via pkg-config): ${_libssh2_INCLUDE_DIRS} (found version \"${LIBSSH2_VERSION}\")") ++ find_package(_libssh2_cmake NAMES libssh2) ++ if(TARGET libssh2::libssh2 AND NOT TARGET CURL::libssh2) ++ add_library(CURL::libssh2 INTERFACE IMPORTED) ++ set_target_properties(CURL::libssh2 PROPERTIES ++ INTERFACE_LIBCURL_PC_LINK_LIBRARIES "${_libssh2_LINK_LIBRARIES}" ++ INTERFACE_LIBCURL_PC_MODULES "${_libssh2_pc_requires}" ++ INTERFACE_LINK_LIBRARIES libssh2::libssh2) ++ endif() ++elseif(1) ++ set(Libssh2_FOUND FALSE) ++ set(LIBSSH2_FOUND FALSE) + else() + find_path(LIBSSH2_INCLUDE_DIR NAMES "libssh2.h") + find_library(LIBSSH2_LIBRARY NAMES "ssh2" "libssh2") +diff --git a/CMake/FindMbedTLS.cmake b/CMake/FindMbedTLS.cmake +index 97201ab2b3..794460b0af 100644 +--- a/CMake/FindMbedTLS.cmake ++++ b/CMake/FindMbedTLS.cmake +@@ -58,6 +58,17 @@ if(_mbedtls_FOUND) + set(MBEDTLS_FOUND TRUE) + set(MBEDTLS_VERSION ${_mbedtls_mbedtls_VERSION}) + message(STATUS "Found MbedTLS (via pkg-config): ${_mbedtls_INCLUDE_DIRS} (found version \"${MBEDTLS_VERSION}\")") ++ find_package(_mbedtls_cmake NAMES MbedTLS) ++ if(TARGET MbedTLS::mbedtls AND NOT TARGET CURL::mbedtls) ++ add_library(CURL::mbedtls INTERFACE IMPORTED) ++ set_target_properties(CURL::mbedtls PROPERTIES ++ INTERFACE_LIBCURL_PC_LINK_LIBRARIES "${_mbedtls_LINK_LIBRARIES}" ++ INTERFACE_LIBCURL_PC_MODULES "${_mbedtls_pc_requires}" ++ INTERFACE_LINK_LIBRARIES MbedTLS::mbedtls MbedTLS::mbedx509 MbedTLS::mbedcrypto) ++ endif() ++elseif(1) ++ set(MbedTLS_FOUND FALSE) ++ set(MBEDTLS_FOUND FALSE) + else() + set(_mbedtls_pc_requires "") # Depend on pkg-config only when found via pkg-config + +diff --git a/CMake/FindNGHTTP2.cmake b/CMake/FindNGHTTP2.cmake +index 8304345a38..e66c3f40fa 100644 +--- a/CMake/FindNGHTTP2.cmake ++++ b/CMake/FindNGHTTP2.cmake +@@ -89,7 +89,6 @@ if(NGHTTP2_FOUND) + INTERFACE_LIBCURL_PC_MODULES "${_nghttp2_pc_requires}" + INTERFACE_COMPILE_OPTIONS "${_nghttp2_CFLAGS}" + INTERFACE_INCLUDE_DIRECTORIES "${_nghttp2_INCLUDE_DIRS}" +- INTERFACE_LINK_DIRECTORIES "${_nghttp2_LIBRARY_DIRS}" +- INTERFACE_LINK_LIBRARIES "${_nghttp2_LIBRARIES}") ++ INTERFACE_LINK_LIBRARIES "${_nghttp2_LINK_LIBRARIES}") + endif() + endif() +diff --git a/CMake/FindNGHTTP3.cmake b/CMake/FindNGHTTP3.cmake +index 37ebfe1114..1aedcd983c 100644 +--- a/CMake/FindNGHTTP3.cmake ++++ b/CMake/FindNGHTTP3.cmake +@@ -47,6 +47,16 @@ if(_nghttp3_FOUND) + set(NGHTTP3_FOUND TRUE) + set(NGHTTP3_VERSION ${_nghttp3_VERSION}) + message(STATUS "Found NGHTTP3 (via pkg-config): ${_nghttp3_INCLUDE_DIRS} (found version \"${NGHTTP3_VERSION}\")") ++ find_package(_nghttp3_cmake NAMES nghttp3) ++ if((TARGET nghttp3::nghttp3 OR TARGET nghttp3::nghttp3_static) AND NOT TARGET CURL::nghttp3) ++ add_library(CURL::nghttp3 INTERFACE IMPORTED) ++ set_target_properties(CURL::nghttp3 PROPERTIES ++ INTERFACE_LIBCURL_PC_LINK_LIBRARIES "${_nghttp3_LINK_LIBRARIES}" ++ INTERFACE_LIBCURL_PC_MODULES "${_nghttp3_pc_requires}" ++ INTERFACE_LINK_LIBRARIES $,nghttp3::nghttp3,nghttp3::nghttp3_static>) ++ endif() ++elseif(1) ++ set(NGHTTP3_FOUND FALSE) + else() + find_path(NGHTTP3_INCLUDE_DIR NAMES "nghttp3/nghttp3.h") + find_library(NGHTTP3_LIBRARY NAMES "nghttp3") +diff --git a/CMake/FindNGTCP2.cmake b/CMake/FindNGTCP2.cmake +index 416ea459f6..13010958be 100644 +--- a/CMake/FindNGTCP2.cmake ++++ b/CMake/FindNGTCP2.cmake +@@ -85,6 +85,24 @@ if(_ngtcp2_FOUND) + set(NGTCP2_FOUND TRUE) + set(NGTCP2_VERSION ${_ngtcp2_libngtcp2_VERSION}) + message(STATUS "Found NGTCP2 (via pkg-config): ${_ngtcp2_INCLUDE_DIRS} (found version \"${NGTCP2_VERSION}\")") ++ find_package(_ngtcp2_cmake NAMES ngtcp2) ++ set(_ngtcp2_cmake_target ngtcp2::ngtcp2) ++ if(_ngtcp2_crypto_backend) ++ # ngtcp2::ngtcp2 is a public link library of the crypto backend. ++ set(_ngtcp2_cmake_target ngtcp2::ngtcp2_crypto_${_ngtcp2_crypto_backend}) ++ endif() ++ if(TARGET ${_ngtcp2_cmake_target}_static) ++ string(APPEND _ngtcp2_cmake_target "_static") ++ endif() ++ if(TARGET ${_ngtcp2_cmake_target} AND NOT TARGET CURL::ngtcp2) ++ add_library(CURL::ngtcp2 INTERFACE IMPORTED) ++ set_target_properties(CURL::ngtcp2 PROPERTIES ++ INTERFACE_LIBCURL_PC_LINK_LIBRARIES "${_ngtcp2_LINK_LIBRARIES}" ++ INTERFACE_LIBCURL_PC_MODULES "${_ngtcp2_pc_requires}" ++ INTERFACE_LINK_LIBRARIES ${_ngtcp2_cmake_target}) ++ endif() ++elseif(0) ++ set(NGTCP2_FOUND FALSE) + else() + find_path(NGTCP2_INCLUDE_DIR NAMES "ngtcp2/ngtcp2.h") + find_library(NGTCP2_LIBRARY NAMES "ngtcp2") +diff --git a/CMake/FindNettle.cmake b/CMake/FindNettle.cmake +index d22865ffad..049265bc8b 100644 +--- a/CMake/FindNettle.cmake ++++ b/CMake/FindNettle.cmake +@@ -95,7 +95,6 @@ if(NETTLE_FOUND) + INTERFACE_LIBCURL_PC_MODULES "${_nettle_pc_requires}" + INTERFACE_COMPILE_OPTIONS "${_nettle_CFLAGS}" + INTERFACE_INCLUDE_DIRECTORIES "${_nettle_INCLUDE_DIRS}" +- INTERFACE_LINK_DIRECTORIES "${_nettle_LIBRARY_DIRS}" +- INTERFACE_LINK_LIBRARIES "${_nettle_LIBRARIES}") ++ INTERFACE_LINK_LIBRARIES "${_nettle_LINK_LIBRARIES}") + endif() + endif() +diff --git a/CMake/FindWolfSSL.cmake b/CMake/FindWolfSSL.cmake +index 3a3c05f0fd..4c1b832898 100644 +--- a/CMake/FindWolfSSL.cmake ++++ b/CMake/FindWolfSSL.cmake +@@ -57,6 +57,17 @@ if(_wolfssl_FOUND) + set(WOLFSSL_FOUND TRUE) + set(WOLFSSL_VERSION ${_wolfssl_VERSION}) + message(STATUS "Found WolfSSL (via pkg-config): ${_wolfssl_INCLUDE_DIRS} (found version \"${WOLFSSL_VERSION}\")") ++ find_package(_wolfssl_cmake NAMES wolfssl) ++ if(TARGET wolfssl::wolfssl AND NOT TARGET CURL::wolfssl) ++ add_library(CURL::wolfssl INTERFACE IMPORTED) ++ set_target_properties(CURL::wolfssl PROPERTIES ++ INTERFACE_LIBCURL_PC_LINK_LIBRARIES "${_wolfssl_LINK_LIBRARIES}" ++ INTERFACE_LIBCURL_PC_MODULES "${_wolfssl_pc_requires}" ++ INTERFACE_LINK_LIBRARIES wolfssl::wolfssl) ++ endif() ++elseif(1) ++ set(WolfSSL_FOUND FALSE) ++ set(WOLFSSL_FOUND FALSE) + else() + find_path(WOLFSSL_INCLUDE_DIR NAMES "wolfssl/ssl.h") + find_library(WOLFSSL_LIBRARY NAMES "wolfssl") +diff --git a/CMake/FindZstd.cmake b/CMake/FindZstd.cmake +index 954a827b6f..f3bf53dab5 100644 +--- a/CMake/FindZstd.cmake ++++ b/CMake/FindZstd.cmake +@@ -57,6 +57,17 @@ if(_zstd_FOUND) + set(ZSTD_FOUND TRUE) + set(ZSTD_VERSION ${_zstd_VERSION}) + message(STATUS "Found Zstd (via pkg-config): ${_zstd_INCLUDE_DIRS} (found version \"${ZSTD_VERSION}\")") ++ find_package(_zstd_cmake NAMES zstd) ++ if(TARGET zstd::libzstd AND NOT TARGET CURL::zstd) ++ add_library(CURL::zstd INTERFACE IMPORTED) ++ set_target_properties(CURL::zstd PROPERTIES ++ INTERFACE_LIBCURL_PC_LINK_LIBRARIES "${_zstd_LINK_LIBRARIES}" ++ INTERFACE_LIBCURL_PC_MODULES "${_zstd_pc_requires}" ++ INTERFACE_LINK_LIBRARIES zstd::libzstd) ++ endif() ++elseif(1) ++ set(Zstd_FOUND TRUE) ++ set(ZSTD_FOUND TRUE) + else() + find_path(ZSTD_INCLUDE_DIR NAMES "zstd.h") + find_library(ZSTD_LIBRARY NAMES "zstd") +diff --git a/CMake/curl-config.cmake.in b/CMake/curl-config.cmake.in +index 7f346c832c..083fddbc04 100644 +--- a/CMake/curl-config.cmake.in ++++ b/CMake/curl-config.cmake.in +@@ -50,74 +50,50 @@ set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR} ${CMAKE_MODULE_PATH}) + set(_curl_libs "") + + if("@HAVE_BROTLI@") +- find_dependency(Brotli) +- list(APPEND _curl_libs CURL::brotli) ++ find_dependency(unofficial-brotli CONFIG) + endif() + if("@USE_ARES@") +- find_dependency(Cares) +- list(APPEND _curl_libs CURL::cares) ++ find_dependency(c-ares CONFIG) + endif() + if("@HAVE_GSSAPI@") +- find_dependency(GSS) +- list(APPEND _curl_libs CURL::gss) + endif() + if("@USE_BACKTRACE@") + find_dependency(Libbacktrace) + list(APPEND _curl_libs CURL::libbacktrace) + endif() + if("@USE_GSASL@") +- find_dependency(Libgsasl) +- list(APPEND _curl_libs CURL::libgsasl) + endif() + if(NOT "@USE_WIN32_LDAP@" AND NOT "@CURL_DISABLE_LDAP@") +- find_dependency(LDAP) +- list(APPEND _curl_libs CURL::ldap) + endif() + if("@HAVE_LIBIDN2@") +- find_dependency(Libidn2) +- list(APPEND _curl_libs CURL::libidn2) + endif() + if("@USE_LIBPSL@") +- find_dependency(Libpsl) +- list(APPEND _curl_libs CURL::libpsl) + endif() + if("@USE_LIBRTMP@") +- find_dependency(Librtmp) +- list(APPEND _curl_libs CURL::librtmp) + endif() + if("@USE_LIBSSH@") + find_dependency(Libssh) + list(APPEND _curl_libs CURL::libssh) + endif() + if("@USE_LIBSSH2@") +- find_dependency(Libssh2) +- list(APPEND _curl_libs CURL::libssh2) ++ find_dependency(libssh2 CONFIG) + endif() + if("@USE_LIBUV@") + find_dependency(Libuv) + list(APPEND _curl_libs CURL::libuv) + endif() + if("@USE_MBEDTLS@") +- find_dependency(MbedTLS) +- list(APPEND _curl_libs CURL::mbedtls) ++ find_dependency(MbedTLS CONFIG) + endif() + if("@USE_NGHTTP2@") +- find_dependency(NGHTTP2) +- list(APPEND _curl_libs CURL::nghttp2) + endif() + if("@USE_NGHTTP3@") +- find_dependency(NGHTTP3) +- list(APPEND _curl_libs CURL::nghttp3) ++ find_dependency(nghttp3 CONFIG) + endif() + if("@USE_NGTCP2@") +- find_dependency(NGTCP2) +- list(APPEND _curl_libs CURL::ngtcp2) ++ find_dependency(ngtcp2 CONFIG) + endif() + if("@USE_GNUTLS@") +- find_dependency(GnuTLS) +- list(APPEND _curl_libs CURL::gnutls) +- find_dependency(Nettle) +- list(APPEND _curl_libs CURL::nettle) + endif() + if("@USE_QUICHE@") + find_dependency(Quiche) +@@ -128,12 +104,10 @@ if("@USE_RUSTLS@") + list(APPEND _curl_libs CURL::rustls) + endif() + if("@USE_WOLFSSL@") +- find_dependency(WolfSSL) +- list(APPEND _curl_libs CURL::wolfssl) ++ find_dependency(wolfssl CONFIG) + endif() + if("@HAVE_ZSTD@") +- find_dependency(Zstd) +- list(APPEND _curl_libs CURL::zstd) ++ find_dependency(zstd CONFIG) + endif() + + set(CMAKE_MODULE_PATH ${_curl_cmake_module_path_save}) +@@ -177,7 +151,11 @@ endif() + # For compatibility with CMake's FindCURL.cmake + set(CURL_VERSION_STRING "@CURLVERSION@") + set(CURL_LIBRARIES @PROJECT_NAME@::@LIB_NAME@) +-set(CURL_LIBRARIES_PRIVATE "@LIBCURL_PC_LIBS_PRIVATE_LIST@") ++set(CURL_LIBRARIES_PRIVATE "") ++# @CMAKE_BUILD_TYPE@ usage requirements ++set(_z_vcpkg_CURL_CONFIG_LIBS "@CURL_CONFIG_LIBS@") ++set(_z_vcpkg_LIBCURL_PC_LDFLAGS_PRIVATE "@LIBCURL_PC_LDFLAGS_PRIVATE@") ++set(_z_vcpkg_LIBCURL_PC_LIBS_PRIVATE_LIST "@LIBCURL_PC_LIBS_PRIVATE_LIST@") + set_and_check(CURL_INCLUDE_DIRS "@PACKAGE_CMAKE_INSTALL_INCLUDEDIR@") + + set(CURL_SUPPORTED_PROTOCOLS "@CURL_SUPPORTED_PROTOCOLS_LIST@") diff --git a/CMakeLists.txt b/CMakeLists.txt -index 4772a6219a..7befd05c34 100644 +index 685335667b..a01a50ac3d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -401,7 +401,7 @@ set(LIBCURL_PC_REQUIRES_PRIVATE "") - if(ENABLE_ARES) - set(USE_ARES 1) - find_package(Cares REQUIRED) -- list(APPEND CURL_LIBS ${CARES_LIBRARIES}) -+ list(APPEND CURL_LIBS ${CARES_LINK_LIBRARIES}) - list(APPEND CURL_LIBDIRS ${CARES_LIBRARY_DIRS}) - list(APPEND LIBCURL_PC_REQUIRES_PRIVATE ${CARES_PC_REQUIRES}) - include_directories(SYSTEM ${CARES_INCLUDE_DIRS}) -@@ -855,7 +855,7 @@ if(CURL_USE_MBEDTLS) - endif() - set(_ssl_enabled ON) - set(USE_MBEDTLS ON) -- list(APPEND CURL_LIBS ${MBEDTLS_LIBRARIES}) -+ list(APPEND CURL_LIBS ${MBEDTLS_LINK_LIBRARIES}) - list(APPEND CURL_LIBDIRS ${MBEDTLS_LIBRARY_DIRS}) - list(APPEND LIBCURL_PC_REQUIRES_PRIVATE ${MBEDTLS_PC_REQUIRES}) - include_directories(SYSTEM ${MBEDTLS_INCLUDE_DIRS}) -@@ -886,7 +886,7 @@ if(CURL_USE_WOLFSSL) - find_package(WolfSSL REQUIRED) - set(_ssl_enabled ON) - set(USE_WOLFSSL ON) -- list(APPEND CURL_LIBS ${WOLFSSL_LIBRARIES}) -+ list(APPEND CURL_LIBS ${WOLFSSL_LINK_LIBRARIES}) - list(APPEND CURL_LIBDIRS ${WOLFSSL_LIBRARY_DIRS}) - list(APPEND LIBCURL_PC_REQUIRES_PRIVATE ${WOLFSSL_PC_REQUIRES}) - include_directories(SYSTEM ${WOLFSSL_INCLUDE_DIRS}) -@@ -903,7 +903,7 @@ endif() +@@ -754,6 +754,12 @@ if(CURL_USE_OPENSSL) + # get our dependencies transitively. + list(APPEND CURL_LIBS OpenSSL::SSL OpenSSL::Crypto) + set_target_properties(OpenSSL::SSL PROPERTIES INTERFACE_LIBCURL_PC_MODULES "openssl") ++ find_package(PkgConfig QUIET) ++ pkg_check_modules(_openssl openssl REQUIRED) ++ set_target_properties(OpenSSL::SSL PROPERTIES INTERFACE_LIBCURL_PC_LINK_LIBRARIES "${_openssl_LINK_LIBRARIES}") ++ set_target_properties(OpenSSL::Crypto PROPERTIES INTERFACE_LIBCURL_PC_MODULES "libcrypto") ++ pkg_check_modules(_crypto libcrypto REQUIRED) ++ set_target_properties(OpenSSL::Crypto PROPERTIES INTERFACE_LIBCURL_PC_LINK_LIBRARIES "${_crypto_LINK_LIBRARIES}") - if(CURL_USE_GNUTLS) - find_package(GnuTLS REQUIRED) -- list(APPEND CURL_LIBS ${GNUTLS_LIBRARIES}) -+ list(APPEND CURL_LIBS ${GNUTLS_LINK_LIBRARIES}) - list(APPEND CURL_LIBDIRS ${GNUTLS_LIBRARY_DIRS}) - list(APPEND LIBCURL_PC_REQUIRES_PRIVATE ${GNUTLS_PC_REQUIRES}) - include_directories(SYSTEM ${GNUTLS_INCLUDE_DIRS}) -@@ -915,7 +915,7 @@ if(CURL_USE_GNUTLS) - find_package(Nettle REQUIRED) - set(_ssl_enabled ON) - set(USE_GNUTLS ON) -- list(APPEND CURL_LIBS ${NETTLE_LIBRARIES}) -+ list(APPEND CURL_LIBS ${NETTLE_LINK_LIBRARIES}) - list(APPEND CURL_LIBDIRS ${NETTLE_LIBRARY_DIRS}) - list(APPEND LIBCURL_PC_REQUIRES_PRIVATE ${NETTLE_PC_REQUIRES}) - include_directories(SYSTEM ${NETTLE_INCLUDE_DIRS}) -@@ -995,7 +995,7 @@ set(HAVE_BROTLI OFF) - curl_dependency_option(CURL_BROTLI Brotli "brotli") - if(BROTLI_FOUND) - set(HAVE_BROTLI ON) -- list(APPEND CURL_LIBS ${BROTLI_LIBRARIES}) -+ list(APPEND CURL_LIBS ${BROTLI_LINK_LIBRARIES}) - list(APPEND CURL_LIBDIRS ${BROTLI_LIBRARY_DIRS}) - list(APPEND LIBCURL_PC_REQUIRES_PRIVATE ${BROTLI_PC_REQUIRES}) - include_directories(SYSTEM ${BROTLI_INCLUDE_DIRS}) -@@ -1010,7 +1010,7 @@ curl_dependency_option(CURL_ZSTD Zstd "zstd") - if(ZSTD_FOUND) - if(ZSTD_VERSION VERSION_GREATER_EQUAL 1.0.0) - set(HAVE_ZSTD ON) -- list(APPEND CURL_LIBS ${ZSTD_LIBRARIES}) -+ list(APPEND CURL_LIBS ${ZSTD_LINK_LIBRARIES}) - list(APPEND CURL_LIBDIRS ${ZSTD_LIBRARY_DIRS}) - list(APPEND LIBCURL_PC_REQUIRES_PRIVATE ${ZSTD_PC_REQUIRES}) - include_directories(SYSTEM ${ZSTD_INCLUDE_DIRS}) -@@ -1141,7 +1141,7 @@ option(USE_NGHTTP2 "Use nghttp2 library" ON) - if(USE_NGHTTP2) - find_package(NGHTTP2) - if(NGHTTP2_FOUND) -- list(APPEND CURL_LIBS ${NGHTTP2_LIBRARIES}) -+ list(APPEND CURL_LIBS ${NGHTTP2_LINK_LIBRARIES}) - list(APPEND CURL_LIBDIRS ${NGHTTP2_LIBRARY_DIRS}) - list(APPEND LIBCURL_PC_REQUIRES_PRIVATE ${NGHTTP2_PC_REQUIRES}) - include_directories(SYSTEM ${NGHTTP2_INCLUDE_DIRS}) -@@ -1184,7 +1184,7 @@ if(USE_NGTCP2) - else() - message(FATAL_ERROR "ngtcp2 requires a supported TLS-backend") + if(CURL_DEFAULT_SSL_BACKEND AND CURL_DEFAULT_SSL_BACKEND STREQUAL "openssl") + set(_valid_default_ssl_backend TRUE) +@@ -894,6 +900,9 @@ if(ZLIB_FOUND) + # get our dependencies transitively. + list(APPEND CURL_LIBS ZLIB::ZLIB) + set_target_properties(ZLIB::ZLIB PROPERTIES INTERFACE_LIBCURL_PC_MODULES "zlib") ++ find_package(PkgConfig QUIET) ++ pkg_check_modules(_zlib zlib) ++ set_target_properties(ZLIB::ZLIB PROPERTIES INTERFACE_LIBCURL_PC_LINK_LIBRARIES "${_zlib_LINK_LIBRARIES}") + endif() + + set(HAVE_BROTLI OFF) +@@ -1802,9 +1811,7 @@ endif() + if(CMAKE_C_COMPILER_ID STREQUAL "GNU") + foreach(_lib IN ITEMS OpenSSL::Crypto ZLIB::ZLIB) + if(TARGET "${_lib}") +- add_library(CURL::${_lib} INTERFACE IMPORTED) +- get_target_property(_libname "${_lib}" LOCATION) +- set_target_properties(${_lib} PROPERTIES INTERFACE_LINK_LIBRARIES "${_libname}") ++ list(REMOVE_ITEM CURL_LIBS ${_lib}) + list(APPEND CURL_LIBS ${_lib}) + endif() + endforeach() +@@ -1815,6 +1822,44 @@ if(CMAKE_C_COMPILER_ID STREQUAL "GNU") endif() -- list(APPEND CURL_LIBS ${NGTCP2_LIBRARIES}) -+ list(APPEND CURL_LIBS ${NGTCP2_LINK_LIBRARIES}) - list(APPEND CURL_LIBDIRS ${NGTCP2_LIBRARY_DIRS}) - list(APPEND LIBCURL_PC_REQUIRES_PRIVATE ${NGTCP2_PC_REQUIRES}) - include_directories(SYSTEM ${NGTCP2_INCLUDE_DIRS}) -@@ -1195,7 +1195,7 @@ if(USE_NGTCP2) + endif() - find_package(NGHTTP3 REQUIRED) - set(USE_NGHTTP3 ON) -- list(APPEND CURL_LIBS ${NGHTTP3_LIBRARIES}) -+ list(APPEND CURL_LIBS ${NGHTTP3_LINK_LIBRARIES}) - list(APPEND CURL_LIBDIRS ${NGHTTP3_LIBRARY_DIRS}) - list(APPEND LIBCURL_PC_REQUIRES_PRIVATE ${NGHTTP3_PC_REQUIRES}) - include_directories(SYSTEM ${NGHTTP3_INCLUDE_DIRS}) -@@ -1279,7 +1279,7 @@ if(NOT CURL_DISABLE_LDAP) - find_package(LDAP) - if(LDAP_FOUND) - set(HAVE_LBER_H 1) -- set(CURL_LIBS ${LDAP_LIBRARIES} ${CURL_LIBS}) -+ list(PREPEND CURL_LIBS ${LDAP_LINK_LIBRARIES}) - list(APPEND CURL_LIBDIRS ${LDAP_LIBRARY_DIRS}) - if(LDAP_PC_REQUIRES) - set(LIBCURL_PC_REQUIRES_PRIVATE ${LDAP_PC_REQUIRES} ${LIBCURL_PC_REQUIRES_PRIVATE}) -@@ -1356,7 +1356,7 @@ set(HAVE_LIBIDN2 OFF) - if(USE_LIBIDN2 AND NOT USE_APPLE_IDN AND NOT USE_WIN32_IDN) - find_package(Libidn2) - if(LIBIDN2_FOUND) -- set(CURL_LIBS ${LIBIDN2_LIBRARIES} ${CURL_LIBS}) -+ list(PREPEND CURL_LIBS ${LIBIDN2_LINK_LIBRARIES}) - list(APPEND CURL_LIBDIRS ${LIBIDN2_LIBRARY_DIRS}) - set(LIBCURL_PC_REQUIRES_PRIVATE ${LIBIDN2_PC_REQUIRES} ${LIBCURL_PC_REQUIRES_PRIVATE}) - include_directories(SYSTEM ${LIBIDN2_INCLUDE_DIRS}) -@@ -1376,7 +1376,7 @@ set(USE_LIBPSL OFF) ++# avoid downstream pkg-config requirement for CURL::dependency interface targets ++# changing CURL_LIBS before add_subdirectory(src) ++set(CURL_LIBS_RAW "${CURL_LIBS}") ++set(CURL_LIBS "") ++find_library(_libdl_absolute dl NO_CACHE) ++find_library(_libm_absolute m NO_CACHE) ++foreach(_lib IN LISTS CURL_LIBS_RAW) ++ if(NOT _lib MATCHES "CURL::") ++ list(APPEND CURL_LIBS ${_lib}) ++ continue() ++ endif() ++ get_target_property(_modules "${_lib}" INTERFACE_LIBCURL_PC_MODULES) ++ if(NOT _modules) ++ list(APPEND CURL_LIBS ${_lib}) ++ continue() ++ endif() ++ get_target_property(_pc_link_libs "${_lib}" INTERFACE_LIBCURL_PC_LINK_LIBRARIES) ++ get_target_property(_link_libs "${_lib}" INTERFACE_LINK_LIBRARIES) ++ if(_pc_link_libs AND NOT TARGET "${_link_libs}") ++ set(_link_libs "${_pc_link_libs}") ++ endif() ++ if(NOT _link_libs) ++ list(APPEND CURL_LIBS ${_lib}) ++ continue() ++ endif() ++ list(APPEND CURL_LIBS $) ++ foreach(_item IN LISTS _link_libs) ++ if(_item STREQUAL "${_libdl_absolute}") ++ set(_item dl) ++ list(REMOVE_ITEM CURL_LIBS $) ++ elseif(_item STREQUAL "${_libm_absolute}") ++ set(_item m) ++ list(REMOVE_ITEM CURL_LIBS $) ++ endif() ++ list(APPEND CURL_LIBS $) ++ endforeach() ++endforeach() ++ + if(CMAKE_C_COMPILER_ID STREQUAL "MSVC") # MSVC but exclude clang-cl + set_property(DIRECTORY APPEND PROPERTY COMPILE_OPTIONS "-MP") # Parallel compilation + endif() +@@ -2109,7 +2154,7 @@ if(NOT CURL_DISABLE_INSTALL) + set(_explicit_libdirs "") + set(LIBCURL_PC_REQUIRES_PRIVATE "") + set(LIBCURL_PC_LIBS_PRIVATE_LIST "") +- foreach(_lib IN LISTS CURL_LIBS _custom_libs _implicit_libs) ++ foreach(_lib IN LISTS CURL_LIBS_RAW _custom_libs _implicit_libs) + if(TARGET "${_lib}") + set(_explicit_libs "") + get_target_property(_imported "${_lib}" IMPORTED) +@@ -2143,8 +2188,15 @@ if(NOT CURL_DISABLE_INSTALL) + get_target_property(_modules "${_lib}" INTERFACE_LIBCURL_PC_MODULES) + if(_modules) + list(APPEND LIBCURL_PC_REQUIRES_PRIVATE "${_modules}") ++ get_target_property(_link_libs "${_lib}" INTERFACE_LIBCURL_PC_LINK_LIBRARIES) ++ if(_link_libs) ++ set(_explicit_libs "${_link_libs}") ++ endif() + endif() - if(CURL_USE_LIBPSL) - find_package(Libpsl REQUIRED) -- list(APPEND CURL_LIBS ${LIBPSL_LIBRARIES}) -+ list(APPEND CURL_LIBS ${LIBPSL_LINK_LIBRARIES}) - list(APPEND CURL_LIBDIRS ${LIBPSL_LIBRARY_DIRS}) - list(APPEND LIBCURL_PC_REQUIRES_PRIVATE ${LIBPSL_PC_REQUIRES}) - include_directories(SYSTEM ${LIBPSL_INCLUDE_DIRS}) -@@ -1395,7 +1395,7 @@ set(USE_LIBSSH2 OFF) - if(CURL_USE_LIBSSH2) - find_package(Libssh2) - if(LIBSSH2_FOUND) -- set(CURL_LIBS ${LIBSSH2_LIBRARIES} ${CURL_LIBS}) # keep it before TLS-crypto, compression -+ list(PREPEND CURL_LIBS ${LIBSSH2_LINK_LIBRARIES}) # keep it before TLS-crypto, compression - list(APPEND CURL_LIBDIRS ${LIBSSH2_LIBRARY_DIRS}) - set(LIBCURL_PC_REQUIRES_PRIVATE ${LIBSSH2_PC_REQUIRES} ${LIBCURL_PC_REQUIRES_PRIVATE}) - include_directories(SYSTEM ${LIBSSH2_INCLUDE_DIRS}) -@@ -1427,7 +1427,7 @@ option(CURL_USE_GSASL "Use libgsasl" OFF) - mark_as_advanced(CURL_USE_GSASL) - if(CURL_USE_GSASL) - find_package(Libgsasl REQUIRED) -- list(APPEND CURL_LIBS ${LIBGSASL_LIBRARIES}) -+ list(APPEND CURL_LIBS ${LIBGSASL_LINK_LIBRARIES}) - list(APPEND CURL_LIBDIRS ${LIBGSASL_LIBRARY_DIRS}) - list(APPEND LIBCURL_PC_REQUIRES_PRIVATE ${LIBGSASL_PC_REQUIRES}) - include_directories(SYSTEM ${LIBGSASL_INCLUDE_DIRS}) -@@ -1446,7 +1446,7 @@ if(CURL_USE_GSSAPI) ++ set(LIBCURL_PC_LIBS_PRIVATE_NO_MODULES "${LIBCURL_PC_LIBS_PRIVATE}") ++ set(LIBCURL_PC_LIBS_PRIVATE "") ++ set(_original_lib "${_lib}") + foreach(_lib IN LISTS _explicit_libs) + if(_lib MATCHES "/") + # This gets a bit more complex, because we want to specify the +@@ -2165,22 +2217,41 @@ if(NOT CURL_DISABLE_INSTALL) + list(APPEND _ldflags "-L${_libdir}") + endif() + string(REGEX REPLACE "^lib" "" _libname "${_libname}") ++ list(REMOVE_ITEM CURL_CONFIG_LIBS "-l${_libname}") + list(APPEND LIBCURL_PC_LIBS_PRIVATE "-l${_libname}") ++ list(REMOVE_ITEM LIBCURL_PC_LIBS_PRIVATE_LIST "${_lib}") + list(APPEND LIBCURL_PC_LIBS_PRIVATE_LIST "${_lib}") + else() + list(APPEND LIBCURL_PC_LIBS_PRIVATE "${_lib}") ++ list(REMOVE_ITEM LIBCURL_PC_LIBS_PRIVATE_LIST "${_lib}") + list(APPEND LIBCURL_PC_LIBS_PRIVATE_LIST "${_lib}") + endif() ++ elseif(_lib MATCHES "^-") # '-framework ' ++ list(APPEND _ldflags "${_lib}") ++ list(REMOVE_ITEM LIBCURL_PC_LIBS_PRIVATE_LIST "${_lib}") ++ list(APPEND LIBCURL_PC_LIBS_PRIVATE_LIST "${_lib}") + else() ++ list(REMOVE_ITEM CURL_CONFIG_LIBS "-l${_lib}") + list(APPEND LIBCURL_PC_LIBS_PRIVATE "-l${_lib}") ++ list(REMOVE_ITEM LIBCURL_PC_LIBS_PRIVATE_LIST "${_lib}") + list(APPEND LIBCURL_PC_LIBS_PRIVATE_LIST "${_lib}") + endif() + endforeach() ++ list(APPEND CURL_CONFIG_LIBS ${LIBCURL_PC_LIBS_PRIVATE}) ++ if(NOT _modules) ++ list(APPEND LIBCURL_PC_LIBS_PRIVATE_NO_MODULES ${LIBCURL_PC_LIBS_PRIVATE}) ++ endif() ++ set(LIBCURL_PC_LIBS_PRIVATE "${LIBCURL_PC_LIBS_PRIVATE_NO_MODULES}") + elseif(_lib MATCHES "^-") # '-framework ' + list(APPEND _ldflags "${_lib}") ++ list(REMOVE_ITEM LIBCURL_PC_LIBS_PRIVATE_LIST "${_lib}") + list(APPEND LIBCURL_PC_LIBS_PRIVATE_LIST "${_lib}") + else() ++ list(REMOVE_ITEM CURL_CONFIG_LIBS "-l${_lib}") ++ list(APPEND CURL_CONFIG_LIBS "-l${_lib}") ++ list(REMOVE_ITEM LIBCURL_PC_LIBS_PRIVATE "-l${_lib}") + list(APPEND LIBCURL_PC_LIBS_PRIVATE "-l${_lib}") ++ list(REMOVE_ITEM LIBCURL_PC_LIBS_PRIVATE_LIST "${_lib}") + list(APPEND LIBCURL_PC_LIBS_PRIVATE_LIST "${_lib}") + endif() + endforeach() +@@ -2204,6 +2275,7 @@ if(NOT CURL_DISABLE_INSTALL) + if(LIBCURL_PC_LIBS_PRIVATE) + string(REPLACE ";" " " LIBCURL_PC_LIBS_PRIVATE "${LIBCURL_PC_LIBS_PRIVATE}") + endif() ++ string(REPLACE ";" " " CURL_CONFIG_LIBS "${CURL_CONFIG_LIBS}") + if(_ldflags) + list(REMOVE_DUPLICATES _ldflags) + string(REPLACE ";" " " _ldflags "${_ldflags}") +diff --git a/curl-config.in b/curl-config.in +index ce23519c33..603375a5bc 100644 +--- a/curl-config.in ++++ b/curl-config.in +@@ -155,7 +155,7 @@ while test "$#" -gt 0; do + curllibdir='' + fi + if test '@ENABLE_SHARED@' = 'no'; then +- echo "${curllibdir}-lcurl @LIBCURL_PC_LIBS_PRIVATE@" ++ echo "${curllibdir}-lcurl @LIBCURL_PC_LDFLAGS_PRIVATE@ @CURL_CONFIG_LIBS@" + else + echo "${curllibdir}-lcurl" + fi +@@ -167,7 +167,7 @@ while test "$#" -gt 0; do - set(HAVE_GSSAPI ${GSS_FOUND}) - if(GSS_FOUND) -- list(APPEND CURL_LIBS ${GSS_LIBRARIES}) -+ list(APPEND CURL_LIBS ${_gss_LINK_LIBRARIES}) - list(APPEND CURL_LIBDIRS ${GSS_LIBRARY_DIRS}) - list(APPEND LIBCURL_PC_REQUIRES_PRIVATE ${GSS_PC_REQUIRES}) - include_directories(SYSTEM ${GSS_INCLUDE_DIRS}) -@@ -1487,7 +1487,7 @@ endif() - option(USE_LIBRTMP "Enable librtmp from rtmpdump" OFF) - if(USE_LIBRTMP) - find_package(Librtmp REQUIRED) -- list(APPEND CURL_LIBS ${LIBRTMP_LIBRARIES}) -+ list(APPEND CURL_LIBS ${LIBRTMP_LINK_LIBRARIES}) - list(APPEND CURL_LIBDIRS ${LIBRTMP_LIBRARY_DIRS}) - list(APPEND LIBCURL_PC_REQUIRES_PRIVATE ${LIBRTMP_PC_REQUIRES}) - include_directories(SYSTEM ${LIBRTMP_INCLUDE_DIRS}) + --static-libs) + if test '@ENABLE_STATIC@' != 'no'; then +- echo "@libdir@/libcurl.@libext@ @LIBCURL_PC_LDFLAGS_PRIVATE@ @LIBCURL_PC_LIBS_PRIVATE@" ++ echo "@libdir@/libcurl.@libext@ @LIBCURL_PC_LDFLAGS_PRIVATE@ @CURL_CONFIG_LIBS@" + else + echo 'curl was built with static libraries disabled' >&2 + exit 1 +diff --git a/libcurl.pc.in b/libcurl.pc.in +index c0ba5244a8..17b7db9220 100644 +--- a/libcurl.pc.in ++++ b/libcurl.pc.in +@@ -33,9 +33,9 @@ Name: libcurl + URL: https://curl.se/ + Description: Library to transfer files with HTTP, FTP, etc. + Version: @CURLVERSION@ +-Requires: @LIBCURL_PC_REQUIRES@ ++Requires: + Requires.private: @LIBCURL_PC_REQUIRES_PRIVATE@ +-Libs: -L${libdir} -lcurl @LIBCURL_PC_LIBS@ ++Libs: -L${libdir} -lcurl + Libs.private: @LIBCURL_PC_LDFLAGS_PRIVATE@ @LIBCURL_PC_LIBS_PRIVATE@ +-Cflags: -I${includedir} @LIBCURL_PC_CFLAGS@ ++Cflags: -I${includedir} + Cflags.private: @LIBCURL_PC_CFLAGS_PRIVATE@ diff --git a/ports/curl/pkgconfig-curl-config.patch b/ports/curl/pkgconfig-curl-config.patch deleted file mode 100644 index e00b209e07690e..00000000000000 --- a/ports/curl/pkgconfig-curl-config.patch +++ /dev/null @@ -1,106 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index be7b193..a3f5918 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -2280,7 +2280,30 @@ if(NOT CURL_DISABLE_INSTALL) - set(_implicit_libs "${CMAKE_C_IMPLICIT_LINK_LIBRARIES}") - endif() - -- foreach(_lib IN LISTS _implicit_libs _custom_libs CURL_LIBS) -+ find_package(PkgConfig) -+ pkg_check_modules(CURL_PC_REQUIRED REQUIRED ${LIBCURL_PC_REQUIRES_PRIVATE}) -+ # Libs which are resolved by pkg-config via Requires (LIBCURL_PC_REQUIRES_PRIVATE) -+ # don't need to be written to `libcurl.pc` (LIBCURL_PC_LIBS_PRIVATE), -+ # but still need to be written `to curl-config` (CURL_CONFIG_LIBS_PRIVATE) -+ set(CURL_CONFIG_LIBS_PRIVATE "") -+ -+ # Imported multi-config targets in CURL_LIBS can't be exported easily to -+ # `libcurl.pc` and `curl-config`. Export link libraries as used by pkg-config. -+ set(curl_libs "${CURL_LIBS}") -+ if(ZLIB::ZLIB IN_LIST CURL_LIBS) -+ pkg_check_modules(CURL_PC_ZLIB REQUIRED zlib) -+ string(REPLACE "ZLIB::ZLIB" "${CURL_PC_ZLIB_LINK_LIBRARIES}" curl_libs "${curl_libs}") -+ endif() -+ if(OpenSSL::SSL IN_LIST CURL_LIBS) -+ pkg_check_modules(CURL_PC_LIBSSL REQUIRED libssl) -+ string(REPLACE "OpenSSL::SSL" "${CURL_PC_LIBSSL_LINK_LIBRARIES}" curl_libs "${curl_libs}") -+ endif() -+ if(OpenSSL::Crypto IN_LIST CURL_LIBS) -+ pkg_check_modules(CURL_PC_LIBCRYPTO REQUIRED libcrypto) -+ string(REPLACE "OpenSSL::Crypto" "${CURL_PC_LIBCRYPTO_LINK_LIBRARIES}" curl_libs "${curl_libs}") -+ endif() -+ -+ foreach(_lib IN LISTS _custom_libs curl_libs) - if(TARGET "${_lib}") - set(_libname "${_lib}") - get_target_property(_imported "${_libname}" IMPORTED) -@@ -2295,6 +2318,10 @@ if(NOT CURL_DISABLE_INSTALL) - continue() - endif() - endif() -+ set(out_list LIBCURL_PC_LIBS_PRIVATE) -+ if(_lib IN_LIST CURL_PC_REQUIRED_LINK_LIBRARIES) -+ set(out_list CURL_CONFIG_LIBS_PRIVATE) -+ endif() - if(_lib MATCHES "^-") # '-framework ' - list(APPEND _ldflags "${_lib}") - elseif(_lib MATCHES "/") -@@ -2311,12 +2338,18 @@ if(NOT CURL_DISABLE_INSTALL) - list(APPEND _ldflags "-L${_libdir}") - endif() - string(REGEX REPLACE "^lib" "" _libname "${_libname}") -- list(APPEND LIBCURL_PC_LIBS_PRIVATE "-l${_libname}") -+ list(APPEND ${out_list} "-l${_libname}") -+ if(TARGET "${LIB_STATIC}" AND _libdir IN_LIST CMAKE_C_IMPLICIT_LINK_DIRECTORIES) -+ # Avoid absolute path to system lib in exported CMake config -+ get_target_property(static_link_libs "${LIB_STATIC}" INTERFACE_LINK_LIBRARIES) -+ string(REPLACE "${_lib}" "${_libname}" static_link_libs "${static_link_libs}") -+ set_target_properties("${LIB_STATIC}" PROPERTIES INTERFACE_LINK_LIBRARIES "${static_link_libs}") -+ endif() - else() -- list(APPEND LIBCURL_PC_LIBS_PRIVATE "${_lib}") -+ list(APPEND ${out_list} "${_lib}") - endif() - else() -- list(APPEND LIBCURL_PC_LIBS_PRIVATE "-l${_lib}") -+ list(APPEND ${out_list} "-l${_lib}") - endif() - endforeach() - -@@ -2342,11 +2375,11 @@ if(NOT CURL_DISABLE_INSTALL) - set(LIBCURL_PC_REQUIRES "") - set(LIBCURL_PC_LIBS "") - set(LIBCURL_PC_CFLAGS "") -+ set(CURL_CONFIG_LIBS_PRIVATE "") - else() -+ string(REPLACE ";" " " CURL_CONFIG_LIBS_PRIVATE "${CURL_CONFIG_LIBS_PRIVATE}") - set(ENABLE_SHARED "no") -- set(LIBCURL_PC_REQUIRES "${LIBCURL_PC_REQUIRES_PRIVATE}") -- set(LIBCURL_PC_LIBS "${LIBCURL_PC_LIBS_PRIVATE}") -- set(LIBCURL_PC_CFLAGS "${LIBCURL_PC_CFLAGS_PRIVATE}") -+ # (processing by vcpkg_fixup_pkgconfig) - endif() - if(BUILD_STATIC_LIBS) - set(ENABLE_STATIC "yes") -diff --git a/curl-config.in b/curl-config.in -index 5518416..c0c29da 100644 ---- a/curl-config.in -+++ b/curl-config.in -@@ -155,7 +155,7 @@ while test "$#" -gt 0; do - curllibdir='' - fi - if test '@ENABLE_SHARED@' = 'no'; then -- echo "${curllibdir}-lcurl @LIBCURL_PC_LIBS_PRIVATE@" -+ echo "@libdir@/libcurl.@libext@ @LIBCURL_PC_LDFLAGS_PRIVATE@ @CURL_CONFIG_LIBS_PRIVATE@ @LIBCURL_PC_LIBS_PRIVATE@" - else - echo "${curllibdir}-lcurl" - fi -@@ -167,7 +167,7 @@ while test "$#" -gt 0; do - - --static-libs) - if test '@ENABLE_STATIC@' != 'no'; then -- echo "@libdir@/libcurl.@libext@ @LIBCURL_PC_LDFLAGS_PRIVATE@ @LIBCURL_PC_LIBS_PRIVATE@" -+ echo "@libdir@/libcurl.@libext@ @LIBCURL_PC_LDFLAGS_PRIVATE@ @CURL_CONFIG_LIBS_PRIVATE@ @LIBCURL_PC_LIBS_PRIVATE@" - else - echo 'curl was built with static libraries disabled' >&2 - exit 1 diff --git a/ports/curl/portfile.cmake b/ports/curl/portfile.cmake index e887f2e28a3edc..514b312ca9af7e 100644 --- a/ports/curl/portfile.cmake +++ b/ports/curl/portfile.cmake @@ -7,9 +7,7 @@ vcpkg_from_github( SHA512 5223c84dc5fc48353e0743d7443e26dbe0c691241862f81cbcaf9ca009c65f9e1d5ead5b1ac70cc056e07fb1b6aa700a2e6a0878929fe82cbd7ac067249323f3 HEAD_REF master PATCHES - #dependencies.patch - #pkgconfig-curl-config.patch - wip.diff + dependencies.patch ) # The on-the-fly tarballs do not carry the details of release tarballs. vcpkg_replace_string("${SOURCE_PATH}/include/curl/curlver.h" [[-DEV"]] [["]]) diff --git a/ports/curl/wip.diff b/ports/curl/wip.diff deleted file mode 100644 index 3265b94c1e26fa..00000000000000 --- a/ports/curl/wip.diff +++ /dev/null @@ -1,628 +0,0 @@ -diff --git a/CMake/FindBrotli.cmake b/CMake/FindBrotli.cmake -index 981b30cafd..e7bfbca0b2 100644 ---- a/CMake/FindBrotli.cmake -+++ b/CMake/FindBrotli.cmake -@@ -50,6 +50,17 @@ if(_brotli_FOUND) - set(BROTLI_FOUND TRUE) - set(BROTLI_VERSION ${_brotli_libbrotlicommon_VERSION}) - message(STATUS "Found Brotli (via pkg-config): ${_brotli_INCLUDE_DIRS} (found version \"${BROTLI_VERSION}\")") -+ find_package(_brotli_cmake NAMES unofficial-brotli) -+ if(TARGET unofficial::brotli::brotlidec AND NOT TARGET CURL::brotli) -+ add_library(CURL::brotli INTERFACE IMPORTED) -+ set_target_properties(CURL::brotli PROPERTIES -+ INTERFACE_LIBCURL_PC_LINK_LIBRARIES "${_brotli_LINK_LIBRARIES}" -+ INTERFACE_LIBCURL_PC_MODULES "${_brotli_pc_requires}" -+ INTERFACE_LINK_LIBRARIES unofficial::brotli::brotlidec) -+ endif() -+elseif(1) -+ set(Brotli_FOUND FALSE) -+ set(BROTLI_FOUND FALSE) - else() - find_path(BROTLI_INCLUDE_DIR "brotli/decode.h") - find_library(BROTLICOMMON_LIBRARY NAMES "brotlicommon") -diff --git a/CMake/FindCares.cmake b/CMake/FindCares.cmake -index 4a20bc0af4..fcb113e0a7 100644 ---- a/CMake/FindCares.cmake -+++ b/CMake/FindCares.cmake -@@ -48,6 +48,17 @@ if(_cares_FOUND) - set(CARES_FOUND TRUE) - set(CARES_VERSION ${_cares_VERSION}) - message(STATUS "Found Cares (via pkg-config): ${_cares_INCLUDE_DIRS} (found version \"${CARES_VERSION}\")") -+ find_package(_cares_cmake NAMES c-ares) -+ if(TARGET c-ares::cares AND NOT TARGET CURL::cares) -+ add_library(CURL::cares INTERFACE IMPORTED) -+ set_target_properties(CURL::cares PROPERTIES -+ INTERFACE_LIBCURL_PC_LINK_LIBRARIES "${_cares_LINK_LIBRARIES}" -+ INTERFACE_LIBCURL_PC_MODULES "${_cares_pc_requires}" -+ INTERFACE_LINK_LIBRARIES c-ares::cares) -+ endif() -+elseif(1) -+ set(Cares_FOUND FALSE) -+ set(CARES_FOUND FALSE) - else() - find_path(CARES_INCLUDE_DIR NAMES "ares.h") - find_library(CARES_LIBRARY NAMES ${CARES_NAMES} "cares") -diff --git a/CMake/FindGSS.cmake b/CMake/FindGSS.cmake -index 106c4c4edd..a027983929 100644 ---- a/CMake/FindGSS.cmake -+++ b/CMake/FindGSS.cmake -@@ -269,7 +269,6 @@ if(GSS_FOUND) - INTERFACE_LIBCURL_PC_MODULES "${_gss_pc_requires}" - INTERFACE_COMPILE_OPTIONS "${_gss_CFLAGS}" - INTERFACE_INCLUDE_DIRECTORIES "${_gss_INCLUDE_DIRS}" -- INTERFACE_LINK_DIRECTORIES "${_gss_LIBRARY_DIRS}" -- INTERFACE_LINK_LIBRARIES "${_gss_LIBRARIES}") -+ INTERFACE_LINK_LIBRARIES "${_gss_LINK_LIBRARIES}") - endif() - endif() -diff --git a/CMake/FindGnuTLS.cmake b/CMake/FindGnuTLS.cmake -index fff57b2c29..7d81acd99a 100644 ---- a/CMake/FindGnuTLS.cmake -+++ b/CMake/FindGnuTLS.cmake -@@ -36,6 +36,7 @@ - - set(_gnutls_pc_requires "gnutls") - -+unset(GNUTLS_LIBRARY CACHE) # from shiftmedia-libgnutls cmake wrapper - if(CURL_USE_PKGCONFIG AND - NOT DEFINED GNUTLS_INCLUDE_DIR AND - NOT DEFINED GNUTLS_LIBRARY) -@@ -90,7 +91,6 @@ if(GNUTLS_FOUND) - INTERFACE_LIBCURL_PC_MODULES "${_gnutls_pc_requires}" - INTERFACE_COMPILE_OPTIONS "${_gnutls_CFLAGS}" - INTERFACE_INCLUDE_DIRECTORIES "${_gnutls_INCLUDE_DIRS}" -- INTERFACE_LINK_DIRECTORIES "${_gnutls_LIBRARY_DIRS}" -- INTERFACE_LINK_LIBRARIES "${_gnutls_LIBRARIES}") -+ INTERFACE_LINK_LIBRARIES "${_gnutls_LINK_LIBRARIES}") - endif() - endif() -diff --git a/CMake/FindLDAP.cmake b/CMake/FindLDAP.cmake -index 2f5cc713c7..63c1b0800f 100644 ---- a/CMake/FindLDAP.cmake -+++ b/CMake/FindLDAP.cmake -@@ -113,7 +113,6 @@ if(LDAP_FOUND) - INTERFACE_LIBCURL_PC_MODULES "${_ldap_pc_requires}" - INTERFACE_COMPILE_OPTIONS "${_ldap_CFLAGS}" - INTERFACE_INCLUDE_DIRECTORIES "${_ldap_INCLUDE_DIRS}" -- INTERFACE_LINK_DIRECTORIES "${_ldap_LIBRARY_DIRS}" -- INTERFACE_LINK_LIBRARIES "${_ldap_LIBRARIES}") -+ INTERFACE_LINK_LIBRARIES "${_ldap_LINK_LIBRARIES}") - endif() - endif() -diff --git a/CMake/FindLibgsasl.cmake b/CMake/FindLibgsasl.cmake -index 5ddf957d72..db462466e4 100644 ---- a/CMake/FindLibgsasl.cmake -+++ b/CMake/FindLibgsasl.cmake -@@ -89,7 +89,6 @@ if(LIBGSASL_FOUND) - INTERFACE_LIBCURL_PC_MODULES "${_libgsasl_pc_requires}" - INTERFACE_COMPILE_OPTIONS "${_libgsasl_CFLAGS}" - INTERFACE_INCLUDE_DIRECTORIES "${_libgsasl_INCLUDE_DIRS}" -- INTERFACE_LINK_DIRECTORIES "${_libgsasl_LIBRARY_DIRS}" -- INTERFACE_LINK_LIBRARIES "${_libgsasl_LIBRARIES}") -+ INTERFACE_LINK_LIBRARIES "${_libgsasl_LINK_LIBRARIES}") - endif() - endif() -diff --git a/CMake/FindLibidn2.cmake b/CMake/FindLibidn2.cmake -index 336a7f7b40..b2f3eaf534 100644 ---- a/CMake/FindLibidn2.cmake -+++ b/CMake/FindLibidn2.cmake -@@ -90,7 +90,6 @@ if(LIBIDN2_FOUND) - INTERFACE_LIBCURL_PC_MODULES "${_libidn2_pc_requires}" - INTERFACE_COMPILE_OPTIONS "${_libidn2_CFLAGS}" - INTERFACE_INCLUDE_DIRECTORIES "${_libidn2_INCLUDE_DIRS}" -- INTERFACE_LINK_DIRECTORIES "${_libidn2_LIBRARY_DIRS}" -- INTERFACE_LINK_LIBRARIES "${_libidn2_LIBRARIES}") -+ INTERFACE_LINK_LIBRARIES "${_libidn2_LINK_LIBRARIES}") - endif() - endif() -diff --git a/CMake/FindLibpsl.cmake b/CMake/FindLibpsl.cmake -index 9b1a0cdd97..a7fe288883 100644 ---- a/CMake/FindLibpsl.cmake -+++ b/CMake/FindLibpsl.cmake -@@ -90,7 +90,6 @@ if(LIBPSL_FOUND) - INTERFACE_LIBCURL_PC_MODULES "${_libpsl_pc_requires}" - INTERFACE_COMPILE_OPTIONS "${_libpsl_CFLAGS}" - INTERFACE_INCLUDE_DIRECTORIES "${_libpsl_INCLUDE_DIRS}" -- INTERFACE_LINK_DIRECTORIES "${_libpsl_LIBRARY_DIRS}" -- INTERFACE_LINK_LIBRARIES "${_libpsl_LIBRARIES}") -+ INTERFACE_LINK_LIBRARIES "${_libpsl_LINK_LIBRARIES}") - endif() - endif() -diff --git a/CMake/FindLibrtmp.cmake b/CMake/FindLibrtmp.cmake -index 070538578e..9b5370be17 100644 ---- a/CMake/FindLibrtmp.cmake -+++ b/CMake/FindLibrtmp.cmake -@@ -110,7 +110,6 @@ if(LIBRTMP_FOUND) - INTERFACE_LIBCURL_PC_MODULES "${_librtmp_pc_requires}" - INTERFACE_COMPILE_OPTIONS "${_librtmp_CFLAGS}" - INTERFACE_INCLUDE_DIRECTORIES "${_librtmp_INCLUDE_DIRS}" -- INTERFACE_LINK_DIRECTORIES "${_librtmp_LIBRARY_DIRS}" -- INTERFACE_LINK_LIBRARIES "${_librtmp_LIBRARIES}") -+ INTERFACE_LINK_LIBRARIES "${_librtmp_LINK_LIBRARIES}") - endif() - endif() -diff --git a/CMake/FindLibssh2.cmake b/CMake/FindLibssh2.cmake -index 330611bfe5..94b5567c0e 100644 ---- a/CMake/FindLibssh2.cmake -+++ b/CMake/FindLibssh2.cmake -@@ -48,6 +48,17 @@ if(_libssh2_FOUND AND _libssh2_INCLUDE_DIRS) - set(LIBSSH2_FOUND TRUE) - set(LIBSSH2_VERSION ${_libssh2_VERSION}) - message(STATUS "Found Libssh2 (via pkg-config): ${_libssh2_INCLUDE_DIRS} (found version \"${LIBSSH2_VERSION}\")") -+ find_package(_libssh2_cmake NAMES libssh2) -+ if(TARGET libssh2::libssh2 AND NOT TARGET CURL::libssh2) -+ add_library(CURL::libssh2 INTERFACE IMPORTED) -+ set_target_properties(CURL::libssh2 PROPERTIES -+ INTERFACE_LIBCURL_PC_LINK_LIBRARIES "${_libssh2_LINK_LIBRARIES}" -+ INTERFACE_LIBCURL_PC_MODULES "${_libssh2_pc_requires}" -+ INTERFACE_LINK_LIBRARIES libssh2::libssh2) -+ endif() -+elseif(1) -+ set(Libssh2_FOUND FALSE) -+ set(LIBSSH2_FOUND FALSE) - else() - find_path(LIBSSH2_INCLUDE_DIR NAMES "libssh2.h") - find_library(LIBSSH2_LIBRARY NAMES "ssh2" "libssh2") -diff --git a/CMake/FindMbedTLS.cmake b/CMake/FindMbedTLS.cmake -index 97201ab2b3..794460b0af 100644 ---- a/CMake/FindMbedTLS.cmake -+++ b/CMake/FindMbedTLS.cmake -@@ -58,6 +58,17 @@ if(_mbedtls_FOUND) - set(MBEDTLS_FOUND TRUE) - set(MBEDTLS_VERSION ${_mbedtls_mbedtls_VERSION}) - message(STATUS "Found MbedTLS (via pkg-config): ${_mbedtls_INCLUDE_DIRS} (found version \"${MBEDTLS_VERSION}\")") -+ find_package(_mbedtls_cmake NAMES MbedTLS) -+ if(TARGET MbedTLS::mbedtls AND NOT TARGET CURL::mbedtls) -+ add_library(CURL::mbedtls INTERFACE IMPORTED) -+ set_target_properties(CURL::mbedtls PROPERTIES -+ INTERFACE_LIBCURL_PC_LINK_LIBRARIES "${_mbedtls_LINK_LIBRARIES}" -+ INTERFACE_LIBCURL_PC_MODULES "${_mbedtls_pc_requires}" -+ INTERFACE_LINK_LIBRARIES MbedTLS::mbedtls MbedTLS::mbedx509 MbedTLS::mbedcrypto) -+ endif() -+elseif(1) -+ set(MbedTLS_FOUND FALSE) -+ set(MBEDTLS_FOUND FALSE) - else() - set(_mbedtls_pc_requires "") # Depend on pkg-config only when found via pkg-config - -diff --git a/CMake/FindNGHTTP2.cmake b/CMake/FindNGHTTP2.cmake -index 8304345a38..e66c3f40fa 100644 ---- a/CMake/FindNGHTTP2.cmake -+++ b/CMake/FindNGHTTP2.cmake -@@ -89,7 +89,6 @@ if(NGHTTP2_FOUND) - INTERFACE_LIBCURL_PC_MODULES "${_nghttp2_pc_requires}" - INTERFACE_COMPILE_OPTIONS "${_nghttp2_CFLAGS}" - INTERFACE_INCLUDE_DIRECTORIES "${_nghttp2_INCLUDE_DIRS}" -- INTERFACE_LINK_DIRECTORIES "${_nghttp2_LIBRARY_DIRS}" -- INTERFACE_LINK_LIBRARIES "${_nghttp2_LIBRARIES}") -+ INTERFACE_LINK_LIBRARIES "${_nghttp2_LINK_LIBRARIES}") - endif() - endif() -diff --git a/CMake/FindNGHTTP3.cmake b/CMake/FindNGHTTP3.cmake -index 37ebfe1114..1aedcd983c 100644 ---- a/CMake/FindNGHTTP3.cmake -+++ b/CMake/FindNGHTTP3.cmake -@@ -47,6 +47,16 @@ if(_nghttp3_FOUND) - set(NGHTTP3_FOUND TRUE) - set(NGHTTP3_VERSION ${_nghttp3_VERSION}) - message(STATUS "Found NGHTTP3 (via pkg-config): ${_nghttp3_INCLUDE_DIRS} (found version \"${NGHTTP3_VERSION}\")") -+ find_package(_nghttp3_cmake NAMES nghttp3) -+ if((TARGET nghttp3::nghttp3 OR TARGET nghttp3::nghttp3_static) AND NOT TARGET CURL::nghttp3) -+ add_library(CURL::nghttp3 INTERFACE IMPORTED) -+ set_target_properties(CURL::nghttp3 PROPERTIES -+ INTERFACE_LIBCURL_PC_LINK_LIBRARIES "${_nghttp3_LINK_LIBRARIES}" -+ INTERFACE_LIBCURL_PC_MODULES "${_nghttp3_pc_requires}" -+ INTERFACE_LINK_LIBRARIES $,nghttp3::nghttp3,nghttp3::nghttp3_static>) -+ endif() -+elseif(1) -+ set(NGHTTP3_FOUND FALSE) - else() - find_path(NGHTTP3_INCLUDE_DIR NAMES "nghttp3/nghttp3.h") - find_library(NGHTTP3_LIBRARY NAMES "nghttp3") -diff --git a/CMake/FindNGTCP2.cmake b/CMake/FindNGTCP2.cmake -index 416ea459f6..13010958be 100644 ---- a/CMake/FindNGTCP2.cmake -+++ b/CMake/FindNGTCP2.cmake -@@ -85,6 +85,24 @@ if(_ngtcp2_FOUND) - set(NGTCP2_FOUND TRUE) - set(NGTCP2_VERSION ${_ngtcp2_libngtcp2_VERSION}) - message(STATUS "Found NGTCP2 (via pkg-config): ${_ngtcp2_INCLUDE_DIRS} (found version \"${NGTCP2_VERSION}\")") -+ find_package(_ngtcp2_cmake NAMES ngtcp2) -+ set(_ngtcp2_cmake_target ngtcp2::ngtcp2) -+ if(_ngtcp2_crypto_backend) -+ # ngtcp2::ngtcp2 is a public link library of the crypto backend. -+ set(_ngtcp2_cmake_target ngtcp2::ngtcp2_crypto_${_ngtcp2_crypto_backend}) -+ endif() -+ if(TARGET ${_ngtcp2_cmake_target}_static) -+ string(APPEND _ngtcp2_cmake_target "_static") -+ endif() -+ if(TARGET ${_ngtcp2_cmake_target} AND NOT TARGET CURL::ngtcp2) -+ add_library(CURL::ngtcp2 INTERFACE IMPORTED) -+ set_target_properties(CURL::ngtcp2 PROPERTIES -+ INTERFACE_LIBCURL_PC_LINK_LIBRARIES "${_ngtcp2_LINK_LIBRARIES}" -+ INTERFACE_LIBCURL_PC_MODULES "${_ngtcp2_pc_requires}" -+ INTERFACE_LINK_LIBRARIES ${_ngtcp2_cmake_target}) -+ endif() -+elseif(0) -+ set(NGTCP2_FOUND FALSE) - else() - find_path(NGTCP2_INCLUDE_DIR NAMES "ngtcp2/ngtcp2.h") - find_library(NGTCP2_LIBRARY NAMES "ngtcp2") -diff --git a/CMake/FindNettle.cmake b/CMake/FindNettle.cmake -index d22865ffad..049265bc8b 100644 ---- a/CMake/FindNettle.cmake -+++ b/CMake/FindNettle.cmake -@@ -95,7 +95,6 @@ if(NETTLE_FOUND) - INTERFACE_LIBCURL_PC_MODULES "${_nettle_pc_requires}" - INTERFACE_COMPILE_OPTIONS "${_nettle_CFLAGS}" - INTERFACE_INCLUDE_DIRECTORIES "${_nettle_INCLUDE_DIRS}" -- INTERFACE_LINK_DIRECTORIES "${_nettle_LIBRARY_DIRS}" -- INTERFACE_LINK_LIBRARIES "${_nettle_LIBRARIES}") -+ INTERFACE_LINK_LIBRARIES "${_nettle_LINK_LIBRARIES}") - endif() - endif() -diff --git a/CMake/FindWolfSSL.cmake b/CMake/FindWolfSSL.cmake -index 3a3c05f0fd..4c1b832898 100644 ---- a/CMake/FindWolfSSL.cmake -+++ b/CMake/FindWolfSSL.cmake -@@ -57,6 +57,17 @@ if(_wolfssl_FOUND) - set(WOLFSSL_FOUND TRUE) - set(WOLFSSL_VERSION ${_wolfssl_VERSION}) - message(STATUS "Found WolfSSL (via pkg-config): ${_wolfssl_INCLUDE_DIRS} (found version \"${WOLFSSL_VERSION}\")") -+ find_package(_wolfssl_cmake NAMES wolfssl) -+ if(TARGET wolfssl::wolfssl AND NOT TARGET CURL::wolfssl) -+ add_library(CURL::wolfssl INTERFACE IMPORTED) -+ set_target_properties(CURL::wolfssl PROPERTIES -+ INTERFACE_LIBCURL_PC_LINK_LIBRARIES "${_wolfssl_LINK_LIBRARIES}" -+ INTERFACE_LIBCURL_PC_MODULES "${_wolfssl_pc_requires}" -+ INTERFACE_LINK_LIBRARIES wolfssl::wolfssl) -+ endif() -+elseif(1) -+ set(WolfSSL_FOUND FALSE) -+ set(WOLFSSL_FOUND FALSE) - else() - find_path(WOLFSSL_INCLUDE_DIR NAMES "wolfssl/ssl.h") - find_library(WOLFSSL_LIBRARY NAMES "wolfssl") -diff --git a/CMake/FindZstd.cmake b/CMake/FindZstd.cmake -index 954a827b6f..f3bf53dab5 100644 ---- a/CMake/FindZstd.cmake -+++ b/CMake/FindZstd.cmake -@@ -57,6 +57,17 @@ if(_zstd_FOUND) - set(ZSTD_FOUND TRUE) - set(ZSTD_VERSION ${_zstd_VERSION}) - message(STATUS "Found Zstd (via pkg-config): ${_zstd_INCLUDE_DIRS} (found version \"${ZSTD_VERSION}\")") -+ find_package(_zstd_cmake NAMES zstd) -+ if(TARGET zstd::libzstd AND NOT TARGET CURL::zstd) -+ add_library(CURL::zstd INTERFACE IMPORTED) -+ set_target_properties(CURL::zstd PROPERTIES -+ INTERFACE_LIBCURL_PC_LINK_LIBRARIES "${_zstd_LINK_LIBRARIES}" -+ INTERFACE_LIBCURL_PC_MODULES "${_zstd_pc_requires}" -+ INTERFACE_LINK_LIBRARIES zstd::libzstd) -+ endif() -+elseif(1) -+ set(Zstd_FOUND TRUE) -+ set(ZSTD_FOUND TRUE) - else() - find_path(ZSTD_INCLUDE_DIR NAMES "zstd.h") - find_library(ZSTD_LIBRARY NAMES "zstd") -diff --git a/CMake/curl-config.cmake.in b/CMake/curl-config.cmake.in -index 7f346c832c..083fddbc04 100644 ---- a/CMake/curl-config.cmake.in -+++ b/CMake/curl-config.cmake.in -@@ -50,74 +50,50 @@ set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR} ${CMAKE_MODULE_PATH}) - set(_curl_libs "") - - if("@HAVE_BROTLI@") -- find_dependency(Brotli) -- list(APPEND _curl_libs CURL::brotli) -+ find_dependency(unofficial-brotli CONFIG) - endif() - if("@USE_ARES@") -- find_dependency(Cares) -- list(APPEND _curl_libs CURL::cares) -+ find_dependency(c-ares CONFIG) - endif() - if("@HAVE_GSSAPI@") -- find_dependency(GSS) -- list(APPEND _curl_libs CURL::gss) - endif() - if("@USE_BACKTRACE@") - find_dependency(Libbacktrace) - list(APPEND _curl_libs CURL::libbacktrace) - endif() - if("@USE_GSASL@") -- find_dependency(Libgsasl) -- list(APPEND _curl_libs CURL::libgsasl) - endif() - if(NOT "@USE_WIN32_LDAP@" AND NOT "@CURL_DISABLE_LDAP@") -- find_dependency(LDAP) -- list(APPEND _curl_libs CURL::ldap) - endif() - if("@HAVE_LIBIDN2@") -- find_dependency(Libidn2) -- list(APPEND _curl_libs CURL::libidn2) - endif() - if("@USE_LIBPSL@") -- find_dependency(Libpsl) -- list(APPEND _curl_libs CURL::libpsl) - endif() - if("@USE_LIBRTMP@") -- find_dependency(Librtmp) -- list(APPEND _curl_libs CURL::librtmp) - endif() - if("@USE_LIBSSH@") - find_dependency(Libssh) - list(APPEND _curl_libs CURL::libssh) - endif() - if("@USE_LIBSSH2@") -- find_dependency(Libssh2) -- list(APPEND _curl_libs CURL::libssh2) -+ find_dependency(libssh2 CONFIG) - endif() - if("@USE_LIBUV@") - find_dependency(Libuv) - list(APPEND _curl_libs CURL::libuv) - endif() - if("@USE_MBEDTLS@") -- find_dependency(MbedTLS) -- list(APPEND _curl_libs CURL::mbedtls) -+ find_dependency(MbedTLS CONFIG) - endif() - if("@USE_NGHTTP2@") -- find_dependency(NGHTTP2) -- list(APPEND _curl_libs CURL::nghttp2) - endif() - if("@USE_NGHTTP3@") -- find_dependency(NGHTTP3) -- list(APPEND _curl_libs CURL::nghttp3) -+ find_dependency(nghttp3 CONFIG) - endif() - if("@USE_NGTCP2@") -- find_dependency(NGTCP2) -- list(APPEND _curl_libs CURL::ngtcp2) -+ find_dependency(ngtcp2 CONFIG) - endif() - if("@USE_GNUTLS@") -- find_dependency(GnuTLS) -- list(APPEND _curl_libs CURL::gnutls) -- find_dependency(Nettle) -- list(APPEND _curl_libs CURL::nettle) - endif() - if("@USE_QUICHE@") - find_dependency(Quiche) -@@ -128,12 +104,10 @@ if("@USE_RUSTLS@") - list(APPEND _curl_libs CURL::rustls) - endif() - if("@USE_WOLFSSL@") -- find_dependency(WolfSSL) -- list(APPEND _curl_libs CURL::wolfssl) -+ find_dependency(wolfssl CONFIG) - endif() - if("@HAVE_ZSTD@") -- find_dependency(Zstd) -- list(APPEND _curl_libs CURL::zstd) -+ find_dependency(zstd CONFIG) - endif() - - set(CMAKE_MODULE_PATH ${_curl_cmake_module_path_save}) -@@ -177,7 +151,11 @@ endif() - # For compatibility with CMake's FindCURL.cmake - set(CURL_VERSION_STRING "@CURLVERSION@") - set(CURL_LIBRARIES @PROJECT_NAME@::@LIB_NAME@) --set(CURL_LIBRARIES_PRIVATE "@LIBCURL_PC_LIBS_PRIVATE_LIST@") -+set(CURL_LIBRARIES_PRIVATE "") -+# @CMAKE_BUILD_TYPE@ usage requirements -+set(_z_vcpkg_CURL_CONFIG_LIBS "@CURL_CONFIG_LIBS@") -+set(_z_vcpkg_LIBCURL_PC_LDFLAGS_PRIVATE "@LIBCURL_PC_LDFLAGS_PRIVATE@") -+set(_z_vcpkg_LIBCURL_PC_LIBS_PRIVATE_LIST "@LIBCURL_PC_LIBS_PRIVATE_LIST@") - set_and_check(CURL_INCLUDE_DIRS "@PACKAGE_CMAKE_INSTALL_INCLUDEDIR@") - - set(CURL_SUPPORTED_PROTOCOLS "@CURL_SUPPORTED_PROTOCOLS_LIST@") -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 685335667b..8e49f291c7 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -754,6 +754,12 @@ if(CURL_USE_OPENSSL) - # get our dependencies transitively. - list(APPEND CURL_LIBS OpenSSL::SSL OpenSSL::Crypto) - set_target_properties(OpenSSL::SSL PROPERTIES INTERFACE_LIBCURL_PC_MODULES "openssl") -+ find_package(PkgConfig QUIET) -+ pkg_check_modules(_openssl openssl REQUIRED) -+ set_target_properties(OpenSSL::SSL PROPERTIES INTERFACE_LIBCURL_PC_LINK_LIBRARIES "${_openssl_LINK_LIBRARIES}") -+ set_target_properties(OpenSSL::Crypto PROPERTIES INTERFACE_LIBCURL_PC_MODULES "libcrypto") -+ pkg_check_modules(_crypto libcrypto REQUIRED) -+ set_target_properties(OpenSSL::Crypto PROPERTIES INTERFACE_LIBCURL_PC_LINK_LIBRARIES "${_crypto_LINK_LIBRARIES}") - - if(CURL_DEFAULT_SSL_BACKEND AND CURL_DEFAULT_SSL_BACKEND STREQUAL "openssl") - set(_valid_default_ssl_backend TRUE) -@@ -894,6 +900,9 @@ if(ZLIB_FOUND) - # get our dependencies transitively. - list(APPEND CURL_LIBS ZLIB::ZLIB) - set_target_properties(ZLIB::ZLIB PROPERTIES INTERFACE_LIBCURL_PC_MODULES "zlib") -+ find_package(PkgConfig QUIET) -+ pkg_check_modules(_zlib zlib) -+ set_target_properties(ZLIB::ZLIB PROPERTIES INTERFACE_LIBCURL_PC_LINK_LIBRARIES "${_zlib_LINK_LIBRARIES}") - endif() - - set(HAVE_BROTLI OFF) -@@ -1802,9 +1811,7 @@ endif() - if(CMAKE_C_COMPILER_ID STREQUAL "GNU") - foreach(_lib IN ITEMS OpenSSL::Crypto ZLIB::ZLIB) - if(TARGET "${_lib}") -- add_library(CURL::${_lib} INTERFACE IMPORTED) -- get_target_property(_libname "${_lib}" LOCATION) -- set_target_properties(${_lib} PROPERTIES INTERFACE_LINK_LIBRARIES "${_libname}") -+ list(REMOVE_ITEM CURL_LIBS ${_lib}) - list(APPEND CURL_LIBS ${_lib}) - endif() - endforeach() -@@ -1815,6 +1822,46 @@ if(CMAKE_C_COMPILER_ID STREQUAL "GNU") - endif() - endif() - -+# avoid downstream pkg-config requirement for CURL::dependency interface targets -+# changing CURL_LIBS before add_subdirectory(src) -+set(CURL_LIBS_RAW "${CURL_LIBS}") -+set(CURL_LIBS "") -+find_library(_libdl_absolute dl NO_CACHE) -+find_library(_libm_absolute m NO_CACHE) -+foreach(_lib IN LISTS CURL_LIBS_RAW) -+ if(NOT _lib MATCHES "CURL::") -+ list(APPEND CURL_LIBS ${_lib}) -+ continue() -+ endif() -+ get_target_property(_modules "${_lib}" INTERFACE_LIBCURL_PC_MODULES) -+ if(NOT _modules) -+ list(APPEND CURL_LIBS ${_lib}) -+ continue() -+ endif() -+ get_target_property(_pc_link_libs "${_lib}" INTERFACE_LIBCURL_PC_LINK_LIBRARIES) -+ get_target_property(_link_libs "${_lib}" INTERFACE_LINK_LIBRARIES) -+ if(_pc_link_libs AND NOT TARGET "${_link_libs}") -+ set(_link_libs "${_pc_link_libs}") -+ endif() -+ if(NOT _link_libs) -+ list(APPEND CURL_LIBS ${_lib}) -+ continue() -+ endif() -+ list(APPEND CURL_LIBS $) -+ message(STATUS ",,${_index},${CURL_LIBS}") -+ foreach(_item IN LISTS _link_libs) -+ if(_item STREQUAL "${_libdl_absolute}") -+ set(_item dl) -+ list(REMOVE_ITEM CURL_LIBS $) -+ elseif(_item STREQUAL "${_libm_absolute}") -+ set(_item m) -+ list(REMOVE_ITEM CURL_LIBS $) -+ endif() -+ list(APPEND CURL_LIBS $) -+ message(STATUS ",,,${_index},${CURL_LIBS}") -+ endforeach() -+endforeach() -+ - if(CMAKE_C_COMPILER_ID STREQUAL "MSVC") # MSVC but exclude clang-cl - set_property(DIRECTORY APPEND PROPERTY COMPILE_OPTIONS "-MP") # Parallel compilation - endif() -@@ -2109,7 +2156,7 @@ if(NOT CURL_DISABLE_INSTALL) - set(_explicit_libdirs "") - set(LIBCURL_PC_REQUIRES_PRIVATE "") - set(LIBCURL_PC_LIBS_PRIVATE_LIST "") -- foreach(_lib IN LISTS CURL_LIBS _custom_libs _implicit_libs) -+ foreach(_lib IN LISTS CURL_LIBS_RAW _custom_libs _implicit_libs) - if(TARGET "${_lib}") - set(_explicit_libs "") - get_target_property(_imported "${_lib}" IMPORTED) -@@ -2143,8 +2190,18 @@ if(NOT CURL_DISABLE_INSTALL) - get_target_property(_modules "${_lib}" INTERFACE_LIBCURL_PC_MODULES) - if(_modules) - list(APPEND LIBCURL_PC_REQUIRES_PRIVATE "${_modules}") -+ get_target_property(_link_libs "${_lib}" INTERFACE_LIBCURL_PC_LINK_LIBRARIES) -+ if(_link_libs) -+ set(_explicit_libs "${_link_libs}") -+ endif() -+ message(STATUS "xxx ${_lib} : ${_explicit_libs}") -+ else() -+ message(STATUS "xxx ${_lib} : ---") - endif() - -+ set(LIBCURL_PC_LIBS_PRIVATE_NO_MODULES "${LIBCURL_PC_LIBS_PRIVATE}") -+ set(LIBCURL_PC_LIBS_PRIVATE "") -+ set(_original_lib "${_lib}") - foreach(_lib IN LISTS _explicit_libs) - if(_lib MATCHES "/") - # This gets a bit more complex, because we want to specify the -@@ -2163,24 +2220,47 @@ if(NOT CURL_DISABLE_INSTALL) - list(FIND _sys_libdirs "${_libdir}" _libdir_index) - if(_libdir_index LESS 0) - list(APPEND _ldflags "-L${_libdir}") -+ message(STATUS "++ ${_lib}") - endif() - string(REGEX REPLACE "^lib" "" _libname "${_libname}") -+ list(REMOVE_ITEM CURL_CONFIG_LIBS "-l${_libname}") - list(APPEND LIBCURL_PC_LIBS_PRIVATE "-l${_libname}") -+ list(REMOVE_ITEM LIBCURL_PC_LIBS_PRIVATE_LIST "${_lib}") - list(APPEND LIBCURL_PC_LIBS_PRIVATE_LIST "${_lib}") - else() - list(APPEND LIBCURL_PC_LIBS_PRIVATE "${_lib}") -+ list(REMOVE_ITEM LIBCURL_PC_LIBS_PRIVATE_LIST "${_lib}") - list(APPEND LIBCURL_PC_LIBS_PRIVATE_LIST "${_lib}") - endif() -+ elseif(_lib MATCHES "^-") # '-framework ' -+ list(APPEND _ldflags "${_lib}") -+ list(REMOVE_ITEM LIBCURL_PC_LIBS_PRIVATE_LIST "${_lib}") -+ list(APPEND LIBCURL_PC_LIBS_PRIVATE_LIST "${_lib}") - else() -+ list(REMOVE_ITEM CURL_CONFIG_LIBS "-l${_lib}") - list(APPEND LIBCURL_PC_LIBS_PRIVATE "-l${_lib}") -+ list(REMOVE_ITEM LIBCURL_PC_LIBS_PRIVATE_LIST "${_lib}") - list(APPEND LIBCURL_PC_LIBS_PRIVATE_LIST "${_lib}") - endif() - endforeach() -+ list(APPEND CURL_CONFIG_LIBS ${LIBCURL_PC_LIBS_PRIVATE}) -+ if(NOT _modules) -+ message(STATUS "[vcpkg] ${_original_lib} does not have a pkgconfig module") -+ list(APPEND LIBCURL_PC_LIBS_PRIVATE_NO_MODULES ${LIBCURL_PC_LIBS_PRIVATE}) -+ endif() -+ set(LIBCURL_PC_LIBS_PRIVATE "${LIBCURL_PC_LIBS_PRIVATE_NO_MODULES}") - elseif(_lib MATCHES "^-") # '-framework ' - list(APPEND _ldflags "${_lib}") -+ list(REMOVE_ITEM LIBCURL_PC_LIBS_PRIVATE_LIST "${_lib}") - list(APPEND LIBCURL_PC_LIBS_PRIVATE_LIST "${_lib}") -+ message(STATUS " x ${_lib} : ---") - else() -+ list(REMOVE_ITEM CURL_CONFIG_LIBS "-l${_lib}") -+ list(APPEND CURL_CONFIG_LIBS "-l${_lib}") -+ list(REMOVE_ITEM LIBCURL_PC_LIBS_PRIVATE "-l${_lib}") - list(APPEND LIBCURL_PC_LIBS_PRIVATE "-l${_lib}") -+ message(STATUS " x ${_lib} : -l${}_lib") -+ list(REMOVE_ITEM LIBCURL_PC_LIBS_PRIVATE_LIST "${_lib}") - list(APPEND LIBCURL_PC_LIBS_PRIVATE_LIST "${_lib}") - endif() - endforeach() -@@ -2204,6 +2284,7 @@ if(NOT CURL_DISABLE_INSTALL) - if(LIBCURL_PC_LIBS_PRIVATE) - string(REPLACE ";" " " LIBCURL_PC_LIBS_PRIVATE "${LIBCURL_PC_LIBS_PRIVATE}") - endif() -+ string(REPLACE ";" " " CURL_CONFIG_LIBS "${CURL_CONFIG_LIBS}") - if(_ldflags) - list(REMOVE_DUPLICATES _ldflags) - string(REPLACE ";" " " _ldflags "${_ldflags}") -diff --git a/curl-config.in b/curl-config.in -index ce23519c33..603375a5bc 100644 ---- a/curl-config.in -+++ b/curl-config.in -@@ -155,7 +155,7 @@ while test "$#" -gt 0; do - curllibdir='' - fi - if test '@ENABLE_SHARED@' = 'no'; then -- echo "${curllibdir}-lcurl @LIBCURL_PC_LIBS_PRIVATE@" -+ echo "${curllibdir}-lcurl @LIBCURL_PC_LDFLAGS_PRIVATE@ @CURL_CONFIG_LIBS@" - else - echo "${curllibdir}-lcurl" - fi -@@ -167,7 +167,7 @@ while test "$#" -gt 0; do - - --static-libs) - if test '@ENABLE_STATIC@' != 'no'; then -- echo "@libdir@/libcurl.@libext@ @LIBCURL_PC_LDFLAGS_PRIVATE@ @LIBCURL_PC_LIBS_PRIVATE@" -+ echo "@libdir@/libcurl.@libext@ @LIBCURL_PC_LDFLAGS_PRIVATE@ @CURL_CONFIG_LIBS@" - else - echo 'curl was built with static libraries disabled' >&2 - exit 1 -diff --git a/libcurl.pc.in b/libcurl.pc.in -index c0ba5244a8..17b7db9220 100644 ---- a/libcurl.pc.in -+++ b/libcurl.pc.in -@@ -33,9 +33,9 @@ Name: libcurl - URL: https://curl.se/ - Description: Library to transfer files with HTTP, FTP, etc. - Version: @CURLVERSION@ --Requires: @LIBCURL_PC_REQUIRES@ -+Requires: - Requires.private: @LIBCURL_PC_REQUIRES_PRIVATE@ --Libs: -L${libdir} -lcurl @LIBCURL_PC_LIBS@ -+Libs: -L${libdir} -lcurl - Libs.private: @LIBCURL_PC_LDFLAGS_PRIVATE@ @LIBCURL_PC_LIBS_PRIVATE@ --Cflags: -I${includedir} @LIBCURL_PC_CFLAGS@ -+Cflags: -I${includedir} - Cflags.private: @LIBCURL_PC_CFLAGS_PRIVATE@ From 70b09f4c7ebd353d0277510b17833c953513ecc2 Mon Sep 17 00:00:00 2001 From: Kai Pastor Date: Wed, 17 Dec 2025 06:05:32 +0100 Subject: [PATCH 14/22] RC2 [skip actions] --- ports/curl/portfile.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/curl/portfile.cmake b/ports/curl/portfile.cmake index 514b312ca9af7e..956e8f7788c141 100644 --- a/ports/curl/portfile.cmake +++ b/ports/curl/portfile.cmake @@ -3,8 +3,8 @@ string(REPLACE "." "_" curl_version "curl-${VERSION}") vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO curl/curl - REF #[[ ${curl_version} ]] rc-8_18_0-1 - SHA512 5223c84dc5fc48353e0743d7443e26dbe0c691241862f81cbcaf9ca009c65f9e1d5ead5b1ac70cc056e07fb1b6aa700a2e6a0878929fe82cbd7ac067249323f3 + REF #[[ ${curl_version} ]] rc-8_18_0-2 + SHA512 b4aee851468209a342361efb52ffa93cf6383c348eeb6e1954a2b3a813750d45ec330ef20a3586860bf69d621f1f0d22f43a614375b9f2751fd1f475a69b2c27 HEAD_REF master PATCHES dependencies.patch From e66f5bf7c8089f77baa18f6d0b17d1deaf6a9c6c Mon Sep 17 00:00:00 2001 From: Kai Pastor Date: Mon, 22 Dec 2025 15:22:51 +0100 Subject: [PATCH 15/22] Sync with curl master --- ports/curl/dependencies.patch | 24 ++++++++++++------------ ports/curl/portfile.cmake | 4 ++-- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/ports/curl/dependencies.patch b/ports/curl/dependencies.patch index f5c94b0e4bc4dc..dc006126544cb1 100644 --- a/ports/curl/dependencies.patch +++ b/ports/curl/dependencies.patch @@ -129,7 +129,7 @@ index 9b1a0cdd97..a7fe288883 100644 endif() endif() diff --git a/CMake/FindLibrtmp.cmake b/CMake/FindLibrtmp.cmake -index 070538578e..9b5370be17 100644 +index 853ba63ad0..a9d24d9b3a 100644 --- a/CMake/FindLibrtmp.cmake +++ b/CMake/FindLibrtmp.cmake @@ -110,7 +110,6 @@ if(LIBRTMP_FOUND) @@ -305,10 +305,10 @@ index 954a827b6f..f3bf53dab5 100644 else() find_path(ZSTD_INCLUDE_DIR NAMES "zstd.h") find_library(ZSTD_LIBRARY NAMES "zstd") -diff --git a/CMake/curl-config.cmake.in b/CMake/curl-config.cmake.in +diff --git a/CMake/curl-config.in.cmake b/CMake/curl-config.in.cmake index 7f346c832c..083fddbc04 100644 ---- a/CMake/curl-config.cmake.in -+++ b/CMake/curl-config.cmake.in +--- a/CMake/curl-config.in.cmake ++++ b/CMake/curl-config.in.cmake @@ -50,74 +50,50 @@ set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR} ${CMAKE_MODULE_PATH}) set(_curl_libs "") @@ -419,10 +419,10 @@ index 7f346c832c..083fddbc04 100644 set(CURL_SUPPORTED_PROTOCOLS "@CURL_SUPPORTED_PROTOCOLS_LIST@") diff --git a/CMakeLists.txt b/CMakeLists.txt -index 685335667b..a01a50ac3d 100644 +index 43ec013508..0111a00bde 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -754,6 +754,12 @@ if(CURL_USE_OPENSSL) +@@ -755,6 +755,12 @@ if(CURL_USE_OPENSSL) # get our dependencies transitively. list(APPEND CURL_LIBS OpenSSL::SSL OpenSSL::Crypto) set_target_properties(OpenSSL::SSL PROPERTIES INTERFACE_LIBCURL_PC_MODULES "openssl") @@ -435,7 +435,7 @@ index 685335667b..a01a50ac3d 100644 if(CURL_DEFAULT_SSL_BACKEND AND CURL_DEFAULT_SSL_BACKEND STREQUAL "openssl") set(_valid_default_ssl_backend TRUE) -@@ -894,6 +900,9 @@ if(ZLIB_FOUND) +@@ -895,6 +901,9 @@ if(ZLIB_FOUND) # get our dependencies transitively. list(APPEND CURL_LIBS ZLIB::ZLIB) set_target_properties(ZLIB::ZLIB PROPERTIES INTERFACE_LIBCURL_PC_MODULES "zlib") @@ -501,7 +501,7 @@ index 685335667b..a01a50ac3d 100644 if(CMAKE_C_COMPILER_ID STREQUAL "MSVC") # MSVC but exclude clang-cl set_property(DIRECTORY APPEND PROPERTY COMPILE_OPTIONS "-MP") # Parallel compilation endif() -@@ -2109,7 +2154,7 @@ if(NOT CURL_DISABLE_INSTALL) +@@ -2107,7 +2152,7 @@ if(NOT CURL_DISABLE_INSTALL) set(_explicit_libdirs "") set(LIBCURL_PC_REQUIRES_PRIVATE "") set(LIBCURL_PC_LIBS_PRIVATE_LIST "") @@ -510,7 +510,7 @@ index 685335667b..a01a50ac3d 100644 if(TARGET "${_lib}") set(_explicit_libs "") get_target_property(_imported "${_lib}" IMPORTED) -@@ -2143,8 +2188,15 @@ if(NOT CURL_DISABLE_INSTALL) +@@ -2141,8 +2186,15 @@ if(NOT CURL_DISABLE_INSTALL) get_target_property(_modules "${_lib}" INTERFACE_LIBCURL_PC_MODULES) if(_modules) list(APPEND LIBCURL_PC_REQUIRES_PRIVATE "${_modules}") @@ -526,7 +526,7 @@ index 685335667b..a01a50ac3d 100644 foreach(_lib IN LISTS _explicit_libs) if(_lib MATCHES "/") # This gets a bit more complex, because we want to specify the -@@ -2165,22 +2217,41 @@ if(NOT CURL_DISABLE_INSTALL) +@@ -2163,22 +2215,41 @@ if(NOT CURL_DISABLE_INSTALL) list(APPEND _ldflags "-L${_libdir}") endif() string(REGEX REPLACE "^lib" "" _libname "${_libname}") @@ -568,7 +568,7 @@ index 685335667b..a01a50ac3d 100644 list(APPEND LIBCURL_PC_LIBS_PRIVATE_LIST "${_lib}") endif() endforeach() -@@ -2204,6 +2275,7 @@ if(NOT CURL_DISABLE_INSTALL) +@@ -2202,6 +2273,7 @@ if(NOT CURL_DISABLE_INSTALL) if(LIBCURL_PC_LIBS_PRIVATE) string(REPLACE ";" " " LIBCURL_PC_LIBS_PRIVATE "${LIBCURL_PC_LIBS_PRIVATE}") endif() @@ -577,7 +577,7 @@ index 685335667b..a01a50ac3d 100644 list(REMOVE_DUPLICATES _ldflags) string(REPLACE ";" " " _ldflags "${_ldflags}") diff --git a/curl-config.in b/curl-config.in -index ce23519c33..603375a5bc 100644 +index a1c8185875..bb6e053d23 100644 --- a/curl-config.in +++ b/curl-config.in @@ -155,7 +155,7 @@ while test "$#" -gt 0; do diff --git a/ports/curl/portfile.cmake b/ports/curl/portfile.cmake index 956e8f7788c141..92e759bf987ac2 100644 --- a/ports/curl/portfile.cmake +++ b/ports/curl/portfile.cmake @@ -3,8 +3,8 @@ string(REPLACE "." "_" curl_version "curl-${VERSION}") vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO curl/curl - REF #[[ ${curl_version} ]] rc-8_18_0-2 - SHA512 b4aee851468209a342361efb52ffa93cf6383c348eeb6e1954a2b3a813750d45ec330ef20a3586860bf69d621f1f0d22f43a614375b9f2751fd1f475a69b2c27 + REF #[[ ${curl_version} ]] 6b9c75e219cdcfd3e17e7858e8ac3b59eb386ade + SHA512 804abbaa7d321e98ebc149e389c8fea56970d816403cbe8e2255a6a5c0e578b75c2634a940ee2b4b5822dd2e048eda62c2a4190c69d3356ecfc9b6ec03ffb195 HEAD_REF master PATCHES dependencies.patch From f892e629418902844daa1bc72b8dbf1428f9b31c Mon Sep 17 00:00:00 2001 From: Kai Pastor Date: Mon, 22 Dec 2025 16:46:30 +0100 Subject: [PATCH 16/22] watch variable CURL_LIBARIES [skip actions] --- ports/curl/vcpkg-cmake-wrapper.cmake | 16 ++++++++++++++-- .../vcpkg-ci-curl/project/CMakeLists.txt | 7 +++++-- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/ports/curl/vcpkg-cmake-wrapper.cmake b/ports/curl/vcpkg-cmake-wrapper.cmake index e89f11e95fc445..a2deadfd5189db 100644 --- a/ports/curl/vcpkg-cmake-wrapper.cmake +++ b/ports/curl/vcpkg-cmake-wrapper.cmake @@ -1,3 +1,15 @@ +function(z_vcpkg_curl_libraries_warning variable access value current_list_file stack) + if(variable STREQUAL "CURL_LIBRARIES" + AND access STREQUAL "READ_ACCESS" + AND NOT z_vcpkg_curl_libraries_warning_issued) + set(z_vcpkg_curl_libraries_warning_issued 1 PARENT_SCOPE) + message(FATAL_ERROR # TODO: WARNING + "CURL_LIBRARIES is '${CURL_LIBRARIES}'. " + "When linking imported targets, exported CMake config must use \"find_dependency(CURL)\"." + ) + endif() +endfunction() + list(REMOVE_ITEM ARGS "NO_MODULE" "CONFIG" "MODULE") list(GET ARGS 0 _z_vcpg_curl_name) _find_package(${ARGS} CONFIG) @@ -23,8 +35,8 @@ if(${_z_vcpg_curl_name}_FOUND) string(REGEX REPLACE "([\$]<[^;]*)?OpenSSL::(SSL|Crypto)([^;]*>)?" "${OPENSSL_LIBRARIES}" _curl_link_libraries "${_curl_link_libraries}") endif() if(_curl_link_libraries MATCHES "::") - # leave CURL_LIBRARIES as set by upstream (imported target) - message(WARNING "Cannot easily unroll CURL_LIBRARIES (\"${CURL_LIBRARIES}\") to filepaths. Exported CMake config must use \"find_dependency(CURL)\".") + # leave CURL_LIBRARIES as set by upstream (imported target), but add information. + variable_watch(CURL_LIBRARIES "z_vcpkg_curl_libraries_warning") else() # resolve CURL_LIBRARIES to filepaths. if(WIN32) diff --git a/scripts/test_ports/vcpkg-ci-curl/project/CMakeLists.txt b/scripts/test_ports/vcpkg-ci-curl/project/CMakeLists.txt index 4e7e1d4b4a6839..ad6c3fd49bcb23 100644 --- a/scripts/test_ports/vcpkg-ci-curl/project/CMakeLists.txt +++ b/scripts/test_ports/vcpkg-ci-curl/project/CMakeLists.txt @@ -8,8 +8,11 @@ block(SCOPE_FOR VARIABLES) find_package(CURL COMPONENTS libz REQUIRED) - add_executable(main main.c) - target_link_libraries(main PRIVATE CURL::libcurl) + add_executable(main-targets main.c) + target_link_libraries(main-targets PRIVATE CURL::libcurl) + + add_executable(main-variable main.c) + target_link_libraries(main-variable PRIVATE ${CURL_LIBRARIES}) unset(PKG_CONFIG_EXECUTABLE CACHE) unset(PKG_CONFIG_ARGN CACHE) From bad307287b69bb2bb938e77009d72ee84936f1a4 Mon Sep 17 00:00:00 2001 From: Kai Pastor Date: Fri, 26 Dec 2025 09:53:07 +0100 Subject: [PATCH 17/22] Revert "[ngtcp2] Export cmake targets for openssl backend" This reverts commit 1a5c8ef9009812779c2ff396c993b96a6fc350b0. --- ports/ngtcp2/export-crypto-targets.diff | 58 ------------------------- ports/ngtcp2/portfile.cmake | 2 - ports/ngtcp2/vcpkg.json | 1 - 3 files changed, 61 deletions(-) delete mode 100644 ports/ngtcp2/export-crypto-targets.diff diff --git a/ports/ngtcp2/export-crypto-targets.diff b/ports/ngtcp2/export-crypto-targets.diff deleted file mode 100644 index 2b5befaf4c57be..00000000000000 --- a/ports/ngtcp2/export-crypto-targets.diff +++ /dev/null @@ -1,58 +0,0 @@ -diff --git a/crypto/ossl/CMakeLists.txt b/crypto/ossl/CMakeLists.txt -index da2ef2df..1a108ada 100644 ---- a/crypto/ossl/CMakeLists.txt -+++ b/crypto/ossl/CMakeLists.txt -@@ -29,14 +29,11 @@ set(ngtcp2_crypto_ossl_SOURCES - ) - - set(ngtcp2_crypto_ossl_INCLUDE_DIRS -- "${CMAKE_CURRENT_SOURCE_DIR}/../../lib/includes" -- "${CMAKE_CURRENT_BINARY_DIR}/../../lib/includes" -- "${CMAKE_CURRENT_SOURCE_DIR}/../../lib" -- "${CMAKE_CURRENT_SOURCE_DIR}/../../crypto/includes" -- "${CMAKE_CURRENT_BINARY_DIR}/../../crypto/includes" -- "${CMAKE_CURRENT_SOURCE_DIR}/../../crypto" -- "${CMAKE_CURRENT_BINARY_DIR}/../../crypto" -- "${OPENSSL_INCLUDE_DIRS}" -+ "$" -+ "$" -+ "$" -+ "$" -+ "$" - ) - - foreach(name libngtcp2_crypto_ossl.pc) -@@ -55,9 +52,10 @@ if(ENABLE_SHARED_LIB) - ) - target_include_directories(ngtcp2_crypto_ossl PUBLIC - ${ngtcp2_crypto_ossl_INCLUDE_DIRS}) -- target_link_libraries(ngtcp2_crypto_ossl ngtcp2 ${OPENSSL_LIBRARIES}) -+ target_link_libraries(ngtcp2_crypto_ossl PUBLIC ngtcp2 OpenSSL::SSL) - - install(TARGETS ngtcp2_crypto_ossl -+ EXPORT "${PROJECT_NAME}Targets" - ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" - LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" - RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}") -@@ -77,8 +75,10 @@ if(ENABLE_STATIC_LIB) - "-DNGTCP2_STATICLIB") - target_include_directories(ngtcp2_crypto_ossl_static PUBLIC - ${ngtcp2_crypto_ossl_INCLUDE_DIRS}) -+ target_link_libraries(ngtcp2_crypto_ossl_static PUBLIC ngtcp2_static OpenSSL::SSL) - - install(TARGETS ngtcp2_crypto_ossl_static -+ EXPORT "${PROJECT_NAME}Targets" - DESTINATION "${CMAKE_INSTALL_LIBDIR}") - endif() - -diff --git a/lib/config.cmake.in b/lib/config.cmake.in -index 435a4d4a..fffcd517 100644 ---- a/lib/config.cmake.in -+++ b/lib/config.cmake.in -@@ -1,3 +1,6 @@ - include(CMakeFindDependencyMacro) -+if("@HAVE_OSSL@") -+ find_dependency(OpenSSL) -+endif() - - include("${CMAKE_CURRENT_LIST_DIR}/@NGTCP2_TARGETS_EXPORT_NAME@.cmake") diff --git a/ports/ngtcp2/portfile.cmake b/ports/ngtcp2/portfile.cmake index aee1042c003836..4a72bcaf57c7d7 100644 --- a/ports/ngtcp2/portfile.cmake +++ b/ports/ngtcp2/portfile.cmake @@ -4,8 +4,6 @@ vcpkg_from_github( REF "v${VERSION}" SHA512 bd68cc652edba8b5619370729b88cc0dccd9c0542391b12b87b5a106e7982a984c9a1f1dea8817f8953318bc12967878498fbc50e221ec465e77422e5ae1ddcf HEAD_REF main - PATCHES - export-crypto-targets.diff ) string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" ENABLE_STATIC_LIB) diff --git a/ports/ngtcp2/vcpkg.json b/ports/ngtcp2/vcpkg.json index f038d284019d94..ece81631036f17 100644 --- a/ports/ngtcp2/vcpkg.json +++ b/ports/ngtcp2/vcpkg.json @@ -1,7 +1,6 @@ { "name": "ngtcp2", "version": "1.18.0", - "port-version": 1, "description": "ngtcp2 project is an effort to implement RFC9000 QUIC protocol.", "homepage": "https://github.com/ngtcp2/ngtcp2", "license": "MIT", From 882ef92eb047061360246f4a29f1966a4e3c6edb Mon Sep 17 00:00:00 2001 From: Kai Pastor Date: Mon, 29 Dec 2025 08:12:20 +0100 Subject: [PATCH 18/22] Update to rc3+5 --- ports/curl/portfile.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/curl/portfile.cmake b/ports/curl/portfile.cmake index 92e759bf987ac2..cdbc7c6ed3c30d 100644 --- a/ports/curl/portfile.cmake +++ b/ports/curl/portfile.cmake @@ -3,8 +3,8 @@ string(REPLACE "." "_" curl_version "curl-${VERSION}") vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO curl/curl - REF #[[ ${curl_version} ]] 6b9c75e219cdcfd3e17e7858e8ac3b59eb386ade - SHA512 804abbaa7d321e98ebc149e389c8fea56970d816403cbe8e2255a6a5c0e578b75c2634a940ee2b4b5822dd2e048eda62c2a4190c69d3356ecfc9b6ec03ffb195 + REF #[[ ${curl_version} ]] 5c0cdd26d66342efaaf2685f2a539be5db21cacd + SHA512 22a8050d39d2759128aa4a0e4edbd1ad9fe88c29192fa9c42acd8240eb4deec5181cead3bf7781c695e565a2e17e3b4673ececc72634ad503eac1437772ed2c1 HEAD_REF master PATCHES dependencies.patch From 7be97cd75d0d53e9221774de1012a05b0d90c41b Mon Sep 17 00:00:00 2001 From: Kai Pastor Date: Tue, 6 Jan 2026 22:06:20 +0100 Subject: [PATCH 19/22] WIP --- ports/curl/portfile.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/curl/portfile.cmake b/ports/curl/portfile.cmake index cdbc7c6ed3c30d..ab6418413b04a8 100644 --- a/ports/curl/portfile.cmake +++ b/ports/curl/portfile.cmake @@ -3,8 +3,8 @@ string(REPLACE "." "_" curl_version "curl-${VERSION}") vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO curl/curl - REF #[[ ${curl_version} ]] 5c0cdd26d66342efaaf2685f2a539be5db21cacd - SHA512 22a8050d39d2759128aa4a0e4edbd1ad9fe88c29192fa9c42acd8240eb4deec5181cead3bf7781c695e565a2e17e3b4673ececc72634ad503eac1437772ed2c1 + REF #[[ ${curl_version} ]] e2d61a6b306cece5f194d70c05e55352f525dff9 + SHA512 83b6c93ae7c3802f5f75b03bc74944d58ffc173e269b80bc52cbf287be2946bb5dd3ffecfd8907a9e9c163f78386bd1a18bd8d9afaae4f943ba0262668989a0b HEAD_REF master PATCHES dependencies.patch From 5c8f4b2f0ae6af427680d4dd8bf656c50a1f0077 Mon Sep 17 00:00:00 2001 From: Kai Pastor Date: Wed, 7 Jan 2026 08:06:30 +0100 Subject: [PATCH 20/22] Use official tag --- ports/curl/portfile.cmake | 4 ++-- versions/baseline.json | 2 +- versions/c-/curl.json | 5 +++++ 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/ports/curl/portfile.cmake b/ports/curl/portfile.cmake index ab6418413b04a8..3a0412e00b8924 100644 --- a/ports/curl/portfile.cmake +++ b/ports/curl/portfile.cmake @@ -3,8 +3,8 @@ string(REPLACE "." "_" curl_version "curl-${VERSION}") vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO curl/curl - REF #[[ ${curl_version} ]] e2d61a6b306cece5f194d70c05e55352f525dff9 - SHA512 83b6c93ae7c3802f5f75b03bc74944d58ffc173e269b80bc52cbf287be2946bb5dd3ffecfd8907a9e9c163f78386bd1a18bd8d9afaae4f943ba0262668989a0b + REF ${curl_version} + SHA512 1dca42354d29b9326a3e9be34c74433c3a7364318d69519e2f5b9a164e81db739d3ef1eed79e3313296fe72af73281e0fc61e57a21e9dede1ef240c8fa6af4fe HEAD_REF master PATCHES dependencies.patch diff --git a/versions/baseline.json b/versions/baseline.json index 1bb5d9268df3ab..3d58a1af3518ac 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -2249,7 +2249,7 @@ "port-version": 8 }, "curl": { - "baseline": "8.17.0", + "baseline": "8.18.0", "port-version": 0 }, "curlcpp": { diff --git a/versions/c-/curl.json b/versions/c-/curl.json index 14f588c41ca02e..b6de4248111608 100644 --- a/versions/c-/curl.json +++ b/versions/c-/curl.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "99d67753c939b62032b389067accd49e54d4d6af", + "version": "8.18.0", + "port-version": 0 + }, { "git-tree": "e5ec3165c979aad7e25d907ffb82e7b6ad0f8f92", "version": "8.17.0", From d5aa20b4cf40158cbb00f1d8bc08e3b7b8a69b12 Mon Sep 17 00:00:00 2001 From: Kai Pastor Date: Wed, 7 Jan 2026 13:52:01 +0100 Subject: [PATCH 21/22] Fixup --- ports/curl/vcpkg-cmake-wrapper.cmake | 3 ++- versions/c-/curl.json | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/ports/curl/vcpkg-cmake-wrapper.cmake b/ports/curl/vcpkg-cmake-wrapper.cmake index a2deadfd5189db..a8edc1651219db 100644 --- a/ports/curl/vcpkg-cmake-wrapper.cmake +++ b/ports/curl/vcpkg-cmake-wrapper.cmake @@ -3,7 +3,7 @@ function(z_vcpkg_curl_libraries_warning variable access value current_list_file AND access STREQUAL "READ_ACCESS" AND NOT z_vcpkg_curl_libraries_warning_issued) set(z_vcpkg_curl_libraries_warning_issued 1 PARENT_SCOPE) - message(FATAL_ERROR # TODO: WARNING + message(WARNING "CURL_LIBRARIES is '${CURL_LIBRARIES}'. " "When linking imported targets, exported CMake config must use \"find_dependency(CURL)\"." ) @@ -38,6 +38,7 @@ if(${_z_vcpg_curl_name}_FOUND) # leave CURL_LIBRARIES as set by upstream (imported target), but add information. variable_watch(CURL_LIBRARIES "z_vcpkg_curl_libraries_warning") else() + get_target_property(CURL_INCLUDE_DIRS ${_curl_target} INTERFACE_INCLUDE_DIRECTORIES) # resolve CURL_LIBRARIES to filepaths. if(WIN32) get_target_property(_curl_location_debug ${_curl_target} IMPORTED_IMPLIB_DEBUG) diff --git a/versions/c-/curl.json b/versions/c-/curl.json index b6de4248111608..99a068888edc0b 100644 --- a/versions/c-/curl.json +++ b/versions/c-/curl.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "99d67753c939b62032b389067accd49e54d4d6af", + "git-tree": "f01a26a6b8c210cf94b38303afc93d984a75aab9", "version": "8.18.0", "port-version": 0 }, From f3a6918c874afe5960c9ef5e748171c1b8cc3325 Mon Sep 17 00:00:00 2001 From: Kai Pastor Date: Thu, 8 Jan 2026 09:21:26 +0100 Subject: [PATCH 22/22] Fixup --- scripts/test_ports/vcpkg-ci-curl/project/CMakeLists.txt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/test_ports/vcpkg-ci-curl/project/CMakeLists.txt b/scripts/test_ports/vcpkg-ci-curl/project/CMakeLists.txt index ad6c3fd49bcb23..32286e601bc978 100644 --- a/scripts/test_ports/vcpkg-ci-curl/project/CMakeLists.txt +++ b/scripts/test_ports/vcpkg-ci-curl/project/CMakeLists.txt @@ -11,8 +11,9 @@ block(SCOPE_FOR VARIABLES) add_executable(main-targets main.c) target_link_libraries(main-targets PRIVATE CURL::libcurl) - add_executable(main-variable main.c) - target_link_libraries(main-variable PRIVATE ${CURL_LIBRARIES}) + add_executable(main-variables main.c) + target_include_directories(main-variables PRIVATE ${CURL_INCLUDE_DIRS}) + target_link_libraries(main-variables PRIVATE ${CURL_LIBRARIES}) unset(PKG_CONFIG_EXECUTABLE CACHE) unset(PKG_CONFIG_ARGN CACHE)