forked from microsoft/vcpkg
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[curl] Update libssh2/brotli/c-ares dependencies (microsoft#32287)
* [curl] Fix libssh2 dependency * Revise dependencies patching * Fix pc file * Cleanup
- Loading branch information
Showing
8 changed files
with
77 additions
and
44 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
diff --git a/CMake/curl-config.cmake.in b/CMake/curl-config.cmake.in | ||
index dbe4ed2..267108e 100644 | ||
--- a/CMake/curl-config.cmake.in | ||
+++ b/CMake/curl-config.cmake.in | ||
@@ -30,6 +30,15 @@ endif() | ||
if(@USE_ZLIB@) | ||
find_dependency(ZLIB @ZLIB_VERSION_MAJOR@) | ||
endif() | ||
+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() | ||
|
||
include("${CMAKE_CURRENT_LIST_DIR}/@[email protected]") | ||
check_required_components("@PROJECT_NAME@") | ||
diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
index 42c9ae4..8c42d91 100644 | ||
--- a/CMakeLists.txt | ||
+++ b/CMakeLists.txt | ||
@@ -149,7 +149,8 @@ set(CURL_LIBS "") | ||
|
||
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() | ||
|
||
@@ -522,7 +523,9 @@ endif() | ||
option(CURL_BROTLI "Set to ON to enable building curl with brotli support." OFF) | ||
set(HAVE_BROTLI OFF) | ||
if(CURL_BROTLI) | ||
- find_package(Brotli QUIET) | ||
+ 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. | ||
@@ -796,7 +800,13 @@ mark_as_advanced(CURL_USE_LIBSSH2) | ||
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}") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters