aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/curl
diff options
context:
space:
mode:
Diffstat (limited to 'vcpkg/ports/curl')
-rw-r--r--vcpkg/ports/curl/cmake-project-include.cmake8
-rw-r--r--vcpkg/ports/curl/dependencies.patch169
-rw-r--r--vcpkg/ports/curl/pkgconfig-curl-config.patch106
-rw-r--r--vcpkg/ports/curl/portfile.cmake153
-rw-r--r--vcpkg/ports/curl/usage4
-rw-r--r--vcpkg/ports/curl/vcpkg-cmake-wrapper.cmake54
-rw-r--r--vcpkg/ports/curl/vcpkg.json263
7 files changed, 757 insertions, 0 deletions
diff --git a/vcpkg/ports/curl/cmake-project-include.cmake b/vcpkg/ports/curl/cmake-project-include.cmake
new file mode 100644
index 0000000..8d6b493
--- /dev/null
+++ b/vcpkg/ports/curl/cmake-project-include.cmake
@@ -0,0 +1,8 @@
+if(ANDROID AND ANDROID_NATIVE_API_LEVEL LESS 24)
+ # https://android.googlesource.com/platform/bionic/+/master/docs/32-bit-abi.md
+ set(HAVE_FILE_OFFSET_BITS FALSE CACHE INTERNAL "")
+endif()
+
+if(CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
+ add_compile_definitions(_WINSOCK_DEPRECATED_NO_WARNINGS)
+endif()
diff --git a/vcpkg/ports/curl/dependencies.patch b/vcpkg/ports/curl/dependencies.patch
new file mode 100644
index 0000000..e435ee5
--- /dev/null
+++ b/vcpkg/ports/curl/dependencies.patch
@@ -0,0 +1,169 @@
+diff --git a/CMake/FindGnuTLS.cmake b/CMake/FindGnuTLS.cmake
+index 4de4f82eee..f47e049101 100644
+--- a/CMake/FindGnuTLS.cmake
++++ b/CMake/FindGnuTLS.cmake
+@@ -40,6 +40,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)
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 4772a6219a..7befd05c34 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()
+
+ 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")
+ 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)
+
+ 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)
+
+ 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(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})
diff --git a/vcpkg/ports/curl/pkgconfig-curl-config.patch b/vcpkg/ports/curl/pkgconfig-curl-config.patch
new file mode 100644
index 0000000..e00b209
--- /dev/null
+++ b/vcpkg/ports/curl/pkgconfig-curl-config.patch
@@ -0,0 +1,106 @@
+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 <name>'
+ 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/vcpkg/ports/curl/portfile.cmake b/vcpkg/ports/curl/portfile.cmake
new file mode 100644
index 0000000..d884af0
--- /dev/null
+++ b/vcpkg/ports/curl/portfile.cmake
@@ -0,0 +1,153 @@
+string(REPLACE "." "_" curl_version "curl-${VERSION}")
+
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO curl/curl
+ REF ${curl_version}
+ SHA512 ec2fa6c47d52feed943421b00e98370971bcc73b82842a85426ea9e42d36eaab51258a8d00197fdaaf5ec39e19385280fe387765f27e3b3dc1086c46236dc0bf
+ HEAD_REF master
+ PATCHES
+ dependencies.patch
+ pkgconfig-curl-config.patch
+)
+
+vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
+ FEATURES
+ http2 USE_NGHTTP2
+ http3 USE_NGTCP2
+ wolfssl CURL_USE_WOLFSSL
+ openssl CURL_USE_OPENSSL
+ openssl CURL_CA_FALLBACK
+ mbedtls CURL_USE_MBEDTLS
+ ssh CURL_USE_LIBSSH2
+ tool BUILD_CURL_EXE
+ c-ares ENABLE_ARES
+ sspi CURL_WINDOWS_SSPI
+ brotli CURL_BROTLI
+ idn2 USE_LIBIDN2
+ winidn USE_WIN32_IDN
+ zstd CURL_ZSTD
+ psl CURL_USE_LIBPSL
+ gssapi CURL_USE_GSSAPI
+ gsasl CURL_USE_GSASL
+ gnutls CURL_USE_GNUTLS
+ rtmp USE_LIBRTMP
+ httpsrr USE_HTTPSRR
+ ssls-export USE_SSLS_EXPORT
+ INVERTED_FEATURES
+ ldap CURL_DISABLE_LDAP
+ ldap CURL_DISABLE_LDAPS
+ non-http HTTP_ONLY
+ websockets CURL_DISABLE_WEBSOCKETS
+)
+
+if("ssl" IN_LIST FEATURES AND
+ NOT "http3" IN_LIST FEATURES AND
+ # (windows & !uwp) | mingw to match curl[ssl]'s "platform"
+ ((VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_UWP) OR VCPKG_TARGET_IS_MINGW))
+ list(APPEND FEATURE_OPTIONS -DCURL_USE_SCHANNEL=ON)
+endif()
+
+if("http3" IN_LIST FEATURES AND
+ ("wolfssl" IN_LIST FEATURES OR
+ "mbedtls" IN_LIST FEATURES OR
+ "gnutls" IN_LIST FEATURES))
+ message(FATAL_ERROR "http3 is incompatible with curl multi-ssl, preventing combination with wolfssl, mbedtls or \
+gnutls in vcpkg's curated registry. To use curl http3 on ngtcp2 on one of the other TLS backends, author an \
+overlay-port which exchanges curl[ssl]'s and curl[http3]'s openssl dependencies with the backend you want.")
+endif()
+
+set(OPTIONS "")
+
+if(VCPKG_TARGET_IS_UWP)
+ list(APPEND OPTIONS
+ -DCURL_DISABLE_TELNET=ON
+ -DENABLE_UNIX_SOCKETS=OFF
+ )
+endif()
+
+if(VCPKG_TARGET_IS_WINDOWS)
+ list(APPEND OPTIONS -DENABLE_UNICODE=ON)
+endif()
+
+vcpkg_find_acquire_program(PKGCONFIG)
+
+vcpkg_cmake_configure(
+ SOURCE_PATH "${SOURCE_PATH}"
+ OPTIONS
+ "-DCMAKE_PROJECT_INCLUDE=${CMAKE_CURRENT_LIST_DIR}/cmake-project-include.cmake"
+ "-DPKG_CONFIG_EXECUTABLE=${PKGCONFIG}"
+ ${FEATURE_OPTIONS}
+ ${OPTIONS}
+ -DBUILD_TESTING=OFF
+ -DENABLE_CURL_MANUAL=OFF
+ -DIMPORT_LIB_SUFFIX= # empty
+ -DSHARE_LIB_OBJECT=OFF
+ -DCURL_USE_PKGCONFIG=ON
+ -DCMAKE_DISABLE_FIND_PACKAGE_Perl=ON
+ MAYBE_UNUSED_VARIABLES
+ PKG_CONFIG_EXECUTABLE
+)
+vcpkg_cmake_install()
+vcpkg_copy_pdbs()
+
+if ("tool" IN_LIST FEATURES)
+ vcpkg_copy_tools(TOOL_NAMES curl AUTO_CLEAN)
+endif()
+
+vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/CURL)
+
+vcpkg_fixup_pkgconfig()
+set(namespec "curl")
+if(VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW)
+ set(namespec "libcurl")
+ vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/lib/pkgconfig/libcurl.pc" " -lcurl" " -l${namespec}")
+endif()
+if(NOT DEFINED VCPKG_BUILD_TYPE)
+ vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libcurl.pc" " -lcurl" " -l${namespec}-d")
+endif()
+
+#Fix install path
+vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/bin/curl-config" "${CURRENT_PACKAGES_DIR}" "\${prefix}")
+vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/bin/curl-config" "${CURRENT_INSTALLED_DIR}" "\${prefix}" IGNORE_UNCHANGED)
+vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/bin/curl-config" "\nprefix='\${prefix}'" [=[prefix=$(CDPATH= cd -- "$(dirname -- "$0")"/../../.. && pwd -P)]=])
+file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/tools/${PORT}/bin")
+file(RENAME "${CURRENT_PACKAGES_DIR}/bin/curl-config" "${CURRENT_PACKAGES_DIR}/tools/${PORT}/bin/curl-config")
+if(EXISTS "${CURRENT_PACKAGES_DIR}/debug/bin/curl-config")
+ vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/bin/curl-config" "${CURRENT_PACKAGES_DIR}" "\${prefix}")
+ vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/bin/curl-config" "${CURRENT_INSTALLED_DIR}" "\${prefix}" IGNORE_UNCHANGED)
+ vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/bin/curl-config" "\nprefix='\${prefix}/debug'" [=[prefix=$(CDPATH= cd -- "$(dirname -- "$0")"/../../../.. && pwd -P)]=])
+ vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/bin/curl-config" "\nexec_prefix=\"\${prefix}\"" "\nexec_prefix=\"\${prefix}/debug\"")
+ vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/bin/curl-config" "-lcurl" "-l${namespec}-d")
+ vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/bin/curl-config" "curl." "curl-d.")
+ file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/tools/${PORT}/debug/bin")
+ file(RENAME "${CURRENT_PACKAGES_DIR}/debug/bin/curl-config" "${CURRENT_PACKAGES_DIR}/tools/${PORT}/debug/bin/curl-config")
+endif()
+
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
+if(VCPKG_LIBRARY_LINKAGE STREQUAL "static" OR NOT VCPKG_TARGET_IS_WINDOWS)
+ file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin")
+ file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/bin")
+endif()
+
+if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
+ vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/curl/curl.h"
+ "#ifdef CURL_STATICLIB"
+ "#if 1"
+ )
+endif()
+
+file(INSTALL "${CURRENT_PORT_DIR}/vcpkg-cmake-wrapper.cmake" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
+file(INSTALL "${CURRENT_PORT_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
+
+file(READ "${SOURCE_PATH}/lib/curlx/inet_ntop.c" inet_ntop_c)
+string(REGEX REPLACE "#i.*" "" inet_ntop_c "${inet_ntop_c}")
+set(inet_ntop_copyright "${CURRENT_BUILDTREES_DIR}/inet_ntop.c and inet_pton.c Notice")
+file(WRITE "${inet_ntop_copyright}" "${inet_ntop_c}")
+
+vcpkg_install_copyright(
+ FILE_LIST
+ "${SOURCE_PATH}/COPYING"
+ "${inet_ntop_copyright}"
+)
diff --git a/vcpkg/ports/curl/usage b/vcpkg/ports/curl/usage
new file mode 100644
index 0000000..eea1140
--- /dev/null
+++ b/vcpkg/ports/curl/usage
@@ -0,0 +1,4 @@
+curl is compatible with built-in CMake targets:
+
+ find_package(CURL REQUIRED)
+ target_link_libraries(main PRIVATE CURL::libcurl)
diff --git a/vcpkg/ports/curl/vcpkg-cmake-wrapper.cmake b/vcpkg/ports/curl/vcpkg-cmake-wrapper.cmake
new file mode 100644
index 0000000..99ce35d
--- /dev/null
+++ b/vcpkg/ports/curl/vcpkg-cmake-wrapper.cmake
@@ -0,0 +1,54 @@
+list(REMOVE_ITEM ARGS "NO_MODULE" "CONFIG" "MODULE")
+_find_package(${ARGS} CONFIG)
+
+if(CURL_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 "")
+ endif()
+ if(_curl_link_libraries MATCHES "ZLIB::ZLIB")
+ string(REGEX REPLACE "([\$]<[^;]*)?ZLIB::ZLIB([^;]*>)?" "${ZLIB_LIBRARIES}" _curl_link_libraries "${_curl_link_libraries}")
+ endif()
+ if(_curl_link_libraries MATCHES "OpenSSL::")
+ 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()
+
+ 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()
+
+ 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_include_dirs)
+ unset(_curl_link_libraries)
+ unset(_curl_location_debug)
+ unset(_curl_location_release)
+ unset(_curl_target)
+ cmake_policy(POP)
+endif()
diff --git a/vcpkg/ports/curl/vcpkg.json b/vcpkg/ports/curl/vcpkg.json
new file mode 100644
index 0000000..1769b31
--- /dev/null
+++ b/vcpkg/ports/curl/vcpkg.json
@@ -0,0 +1,263 @@
+{
+ "name": "curl",
+ "version": "8.17.0",
+ "description": "A library for transferring data with URLs",
+ "homepage": "https://curl.se/",
+ "license": "curl AND ISC AND BSD-3-Clause",
+ "dependencies": [
+ {
+ "name": "vcpkg-cmake",
+ "host": true
+ },
+ {
+ "name": "vcpkg-cmake-config",
+ "host": true
+ },
+ "zlib"
+ ],
+ "default-features": [
+ "non-http",
+ "ssl"
+ ],
+ "features": {
+ "brotli": {
+ "description": "brotli support (brotli)",
+ "dependencies": [
+ "brotli"
+ ]
+ },
+ "c-ares": {
+ "description": "c-ares support",
+ "dependencies": [
+ "c-ares"
+ ]
+ },
+ "gnutls": {
+ "description": "TLS support (gnutls)",
+ "dependencies": [
+ {
+ "name": "libgnutls",
+ "platform": "!windows | mingw"
+ },
+ {
+ "name": "shiftmedia-libgnutls",
+ "platform": "windows & !mingw"
+ }
+ ]
+ },
+ "gsasl": {
+ "description": "GSASL support (libgsasl)",
+ "dependencies": [
+ "gsasl"
+ ]
+ },
+ "gssapi": {
+ "description": "krb5 support",
+ "supports": "!windows",
+ "dependencies": [
+ "krb5"
+ ]
+ },
+ "http2": {
+ "description": "HTTP2 support",
+ "dependencies": [
+ {
+ "name": "curl",
+ "default-features": false,
+ "features": [
+ "ssl"
+ ]
+ },
+ "nghttp2"
+ ]
+ },
+ "http3": {
+ "description": "HTTP3 support with ngtcp2 on openssl",
+ "dependencies": [
+ {
+ "name": "curl",
+ "default-features": false,
+ "features": [
+ "openssl"
+ ]
+ },
+ "nghttp3",
+ {
+ "name": "ngtcp2",
+ "default-features": false,
+ "features": [
+ "openssl"
+ ]
+ }
+ ]
+ },
+ "httpsrr": {
+ "description": "enable support for HTTPS RR"
+ },
+ "idn": {
+ "description": "Default IDN support",
+ "dependencies": [
+ {
+ "name": "curl",
+ "default-features": false,
+ "features": [
+ "winidn"
+ ],
+ "platform": "windows"
+ },
+ {
+ "name": "curl",
+ "default-features": false,
+ "features": [
+ "idn2"
+ ],
+ "platform": "!windows"
+ }
+ ]
+ },
+ "idn2": {
+ "description": "idn2 support (libidn2)",
+ "dependencies": [
+ "libidn2"
+ ]
+ },
+ "ldap": {
+ "description": "LDAP support",
+ "supports": "!uwp",
+ "dependencies": [
+ {
+ "name": "curl",
+ "default-features": false,
+ "features": [
+ "non-http"
+ ]
+ },
+ {
+ "name": "openldap",
+ "platform": "!windows"
+ }
+ ]
+ },
+ "mbedtls": {
+ "description": "TLS support (mbedTLS)",
+ "dependencies": [
+ "mbedtls"
+ ]
+ },
+ "non-http": {
+ "description": "Enables protocols beyond HTTP/HTTPS/HTTP2/HTTP3"
+ },
+ "openssl": {
+ "description": "TLS support (OpenSSL)",
+ "dependencies": [
+ "openssl"
+ ]
+ },
+ "psl": {
+ "description": "Use psl support (libpsl)",
+ "dependencies": [
+ "libpsl"
+ ]
+ },
+ "rtmp": {
+ "description": "RTMP support",
+ "dependencies": [
+ "librtmp"
+ ]
+ },
+ "ssh": {
+ "description": "SSH support via libssh2",
+ "dependencies": [
+ {
+ "name": "curl",
+ "default-features": false,
+ "features": [
+ "non-http"
+ ]
+ },
+ {
+ "name": "curl",
+ "default-features": false,
+ "features": [
+ "openssl"
+ ]
+ },
+ "libssh2"
+ ]
+ },
+ "ssl": {
+ "description": "Default SSL / TLS implementation.",
+ "dependencies": [
+ {
+ "$comment": "Defaults to schannel on Windows, unless http3 is also enabled",
+ "name": "curl",
+ "default-features": false,
+ "features": [
+ "sspi"
+ ],
+ "platform": "(windows & !uwp) | mingw"
+ },
+ {
+ "$comment": "Otherwise, defaults to OpenSSL.",
+ "name": "curl",
+ "default-features": false,
+ "features": [
+ "openssl"
+ ],
+ "platform": "(uwp | !windows) & !mingw"
+ }
+ ]
+ },
+ "ssls-export": {
+ "description": "SSL session import/export",
+ "dependencies": [
+ {
+ "name": "curl",
+ "default-features": false,
+ "features": [
+ "ssl"
+ ]
+ }
+ ]
+ },
+ "sspi": {
+ "description": "SSPI support",
+ "supports": "(windows & !uwp) | mingw"
+ },
+ "tool": {
+ "description": "Builds curl executable",
+ "supports": "!uwp"
+ },
+ "websockets": {
+ "description": "WebSocket support"
+ },
+ "winidn": {
+ "description": "WinIDN support",
+ "supports": "windows"
+ },
+ "winldap": {
+ "description": "Obsolete. Use feature 'ldap' instead.",
+ "dependencies": [
+ {
+ "name": "curl",
+ "default-features": false,
+ "features": [
+ "ldap"
+ ]
+ }
+ ]
+ },
+ "wolfssl": {
+ "description": "SSL support (wolfSSL)",
+ "dependencies": [
+ "wolfssl"
+ ]
+ },
+ "zstd": {
+ "description": "ZStandard support (zstd)",
+ "dependencies": [
+ "zstd"
+ ]
+ }
+ }
+}