2023-07-08 01:09:39 +08:00
|
|
|
diff --git a/CMake/curl-config.cmake.in b/CMake/curl-config.cmake.in
|
2023-07-21 23:46:53 +08:00
|
|
|
index dbe4ed2..edf87fa 100644
|
2023-07-08 01:09:39 +08:00
|
|
|
--- a/CMake/curl-config.cmake.in
|
|
|
|
+++ b/CMake/curl-config.cmake.in
|
2023-07-21 23:46:53 +08:00
|
|
|
@@ -31,5 +31,15 @@ if(@USE_ZLIB@)
|
2023-07-08 01:09:39 +08:00
|
|
|
find_dependency(ZLIB @ZLIB_VERSION_MAJOR@)
|
|
|
|
endif()
|
2023-07-21 23:46:53 +08:00
|
|
|
|
2023-07-08 01:09:39 +08:00
|
|
|
+if("@USE_ARES@")
|
|
|
|
+ find_dependency(c-ares CONFIG)
|
|
|
|
+endif()
|
|
|
|
+if("@USE_LIBSSH2@")
|
|
|
|
+ find_dependency(Libssh2 CONFIG)
|
|
|
|
+endif()
|
|
|
|
+if("@HAVE_BROTLI@")
|
|
|
|
+ find_dependency(unofficial-brotli CONFIG)
|
|
|
|
+endif()
|
2023-07-21 23:46:53 +08:00
|
|
|
+
|
2023-07-08 01:09:39 +08:00
|
|
|
include("${CMAKE_CURRENT_LIST_DIR}/@TARGETS_EXPORT_NAME@.cmake")
|
|
|
|
check_required_components("@PROJECT_NAME@")
|
|
|
|
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
2023-07-21 23:46:53 +08:00
|
|
|
index ad3a63d..917cdbf 100644
|
2023-07-08 01:09:39 +08:00
|
|
|
--- a/CMakeLists.txt
|
|
|
|
+++ b/CMakeLists.txt
|
2023-07-21 23:46:53 +08:00
|
|
|
@@ -151,7 +151,8 @@ set(CURL_LIBS "")
|
2023-07-08 01:09:39 +08:00
|
|
|
|
|
|
|
if(ENABLE_ARES)
|
|
|
|
set(USE_ARES 1)
|
|
|
|
- find_package(CARES REQUIRED)
|
|
|
|
+ find_package(CARES NAMES c-ares CONFIG REQUIRED)
|
|
|
|
+ set(CARES_LIBRARY c-ares::cares)
|
|
|
|
list(APPEND CURL_LIBS ${CARES_LIBRARY})
|
|
|
|
endif()
|
|
|
|
|
2023-07-21 23:46:53 +08:00
|
|
|
@@ -524,7 +525,9 @@ endif()
|
2023-07-08 01:09:39 +08:00
|
|
|
option(CURL_BROTLI "Set to ON to enable building curl with brotli support." OFF)
|
|
|
|
set(HAVE_BROTLI OFF)
|
|
|
|
if(CURL_BROTLI)
|
2023-07-21 23:46:53 +08:00
|
|
|
- find_package(Brotli REQUIRED)
|
2023-07-08 01:09:39 +08:00
|
|
|
+ find_package(BROTLI NAMES unofficial-brotli REQUIRED)
|
|
|
|
+ set(BROTLI_INCLUDE_DIRS "")
|
|
|
|
+ set(BROTLI_LIBRARIES "unofficial::brotli::brotlidec")
|
|
|
|
if(BROTLI_FOUND)
|
|
|
|
set(HAVE_BROTLI ON)
|
|
|
|
set(CURL_LIBS "${BROTLI_LIBRARIES};${CURL_LIBS}") # For 'ld' linker. Emulate `list(PREPEND ...)` to stay compatible with <v3.15 CMake.
|
2023-07-21 23:46:53 +08:00
|
|
|
@@ -796,7 +799,13 @@ mark_as_advanced(CURL_USE_LIBSSH2)
|
2023-07-08 01:09:39 +08:00
|
|
|
set(USE_LIBSSH2 OFF)
|
|
|
|
|
|
|
|
if(CURL_USE_LIBSSH2)
|
|
|
|
- find_package(LibSSH2)
|
|
|
|
+ find_package(LIBSSH2 NAMES Libssh2 REQUIRED)
|
|
|
|
+ if(TARGET Libssh2::libssh2_shared)
|
|
|
|
+ set(LIBSSH2_LIBRARY Libssh2::libssh2_shared)
|
|
|
|
+ else()
|
|
|
|
+ set(LIBSSH2_LIBRARY Libssh2::libssh2_static)
|
|
|
|
+ endif()
|
|
|
|
+ get_target_property(LIBSSH2_INCLUDE_DIR "${LIBSSH2_LIBRARY}" INTERFACE_INCLUDE_DIRECTORIES)
|
|
|
|
if(LIBSSH2_FOUND)
|
|
|
|
list(APPEND CURL_LIBS ${LIBSSH2_LIBRARY})
|
|
|
|
list(APPEND CMAKE_REQUIRED_INCLUDES "${LIBSSH2_INCLUDE_DIR}")
|