[cpprestsdk] Fix find dependency openssl (#11867)

* [cpprestsdk] Fix find dependency openssl

* Update portfile.cmake

Co-authored-by: Lily <47812810+LilyWangL@users.noreply.github.com>
This commit is contained in:
Jack·Boos·Yu 2020-06-11 08:52:35 +08:00 committed by GitHub
parent f9c7bf832b
commit d8383c37b3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 25 additions and 8 deletions

View File

@ -1,5 +1,5 @@
Source: cpprestsdk
Version: 2.10.16-1
Version: 2.10.16-2
Build-Depends: openssl (!uwp&!windows), boost-system (!uwp&!windows),
boost-date-time (!uwp&!windows), boost-regex (!uwp&!windows), boost-thread (!uwp&!windows),
boost-filesystem (!uwp&!windows), boost-random (!uwp&!windows), boost-chrono (!uwp&!windows),

View File

@ -0,0 +1,18 @@
diff --git a/Release/cmake/cpprest_find_openssl.cmake b/Release/cmake/cpprest_find_openssl.cmake
index 9333663..c1df089 100644
--- a/Release/cmake/cpprest_find_openssl.cmake
+++ b/Release/cmake/cpprest_find_openssl.cmake
@@ -36,8 +36,11 @@ function(cpprest_find_openssl)
# Prefer a homebrew version of OpenSSL over the one in /usr/lib
file(GLOB OPENSSL_ROOT_DIR /usr/local/Cellar/openssl*/*)
# Prefer the latest (make the latest one first)
- list(REVERSE OPENSSL_ROOT_DIR)
- list(GET OPENSSL_ROOT_DIR 0 OPENSSL_ROOT_DIR)
+ if(OPENSSL_ROOT_DIR)
+ # Prefer the latest (make the latest one first)
+ list(REVERSE OPENSSL_ROOT_DIR)
+ list(GET OPENSSL_ROOT_DIR 0 OPENSSL_ROOT_DIR)
+ endif()
endif()
# This should prevent linking against the system provided 0.9.8y
message(STATUS "OPENSSL_ROOT_DIR = ${OPENSSL_ROOT_DIR}")

View File

@ -4,10 +4,11 @@ vcpkg_from_github(
REF v2.10.16
SHA512 d850b26051439dd10edcecd006075c64c61c565193cd76870af175bd343a72ecc59485deb0f907807071a57dd256b67139ad5d016f19cb38f7142357f430be1c
HEAD_REF master
PATCHES fix-find-openssl.patch
)
set(OPTIONS)
if(NOT VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
if(NOT VCPKG_TARGET_IS_UWP)
SET(WEBSOCKETPP_PATH "${CURRENT_INSTALLED_DIR}/share/websocketpp")
list(APPEND OPTIONS
-DWEBSOCKETPP_CONFIG=${WEBSOCKETPP_PATH}
@ -39,11 +40,9 @@ vcpkg_configure_cmake(
vcpkg_install_cmake()
vcpkg_fixup_cmake_targets(CONFIG_PATH lib/share/cpprestsdk)
vcpkg_copy_pdbs()
vcpkg_fixup_cmake_targets(CONFIG_PATH lib/share/${PORT})
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/share ${CURRENT_PACKAGES_DIR}/lib/share)
file(INSTALL
${SOURCE_PATH}/license.txt
DESTINATION ${CURRENT_PACKAGES_DIR}/share/cpprestsdk RENAME copyright)
vcpkg_copy_pdbs()
file(INSTALL ${SOURCE_PATH}/license.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)