Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[restbed] Add openssl feature #7232

Merged
merged 1 commit into from
Jul 18, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions ports/restbed/CONTROL
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
Source: restbed
Version: 4.16-07-28-2018
Version: 4.16-07-28-2018-1
Description: Corvusoft's Restbed framework brings asynchronous RESTful functionality to C++11 applications.
Build-Depends: asio
Build-Depends: asio

Feature: openssl
Build-Depends: openssl
Description: Secure over the wire communication allowing you to transmit private data online.
37 changes: 37 additions & 0 deletions ports/restbed/add_openssl_support.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
diff --git a/cmake/Findopenssl.cmake b/cmake/Findopenssl.cmake
index 8db9799..626ff55 100644
--- a/cmake/Findopenssl.cmake
+++ b/cmake/Findopenssl.cmake
@@ -1,24 +1,7 @@
-find_library( ssl_LIBRARY_STATIC libssl.a ssleay32.lib HINTS "${PROJECT_SOURCE_DIR}/dependency/openssl/out32dll" "${PROJECT_SOURCE_DIR}/dependency/openssl" "/usr/local/opt/openssl/lib" "/usr/lib" "/usr/local/lib" "/opt/local/lib" )
-find_library( crypto_LIBRARY_STATIC libcrypto.a libeay32.lib HINTS "${PROJECT_SOURCE_DIR}/dependency/openssl/out32dll" "${PROJECT_SOURCE_DIR}/dependency/openssl" "/usr/local/opt/openssl/lib" "/usr/lib" "/usr/local/lib" "/opt/local/lib" )
-
-find_library( ssl_LIBRARY_SHARED libssl.so libssl.dylib ssleay32.dll HINTS "${PROJECT_SOURCE_DIR}/dependency/openssl/out32dll" "${PROJECT_SOURCE_DIR}/dependency/openssl" "/usr/local/opt/openssl/lib" "/usr/lib" "/usr/local/lib" "/opt/local/lib" )
-find_library( crypto_LIBRARY_SHARED libcrypto.so libcrypto.dylib libeay32.dll HINTS "${PROJECT_SOURCE_DIR}/dependency/openssl/out32dll" "${PROJECT_SOURCE_DIR}/dependency/openssl" "/usr/local/opt/openssl/lib" "/usr/lib" "/usr/local/lib" "/opt/local/lib" )
-
-find_path( ssl_INCLUDE openssl/ssl.h HINTS "${PROJECT_SOURCE_DIR}/dependency/openssl/inc32" "${PROJECT_SOURCE_DIR}/dependency/openssl/include" "/usr/local/opt/openssl/include" "/usr/include" "/usr/local/include" "/opt/local/include" )
-
-if ( ssl_LIBRARY_STATIC AND ssl_LIBRARY_SHARED AND crypto_LIBRARY_STATIC AND crypto_LIBRARY_SHARED )
- set( OPENSSL_FOUND TRUE )
- add_definitions( -DBUILD_SSL=TRUE )
-
- if ( APPLE AND BUILD_SSL )
- set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated-declarations" )
- endif( )
-
- message( STATUS "Found OpenSSL include at: ${ssl_INCLUDE}" )
- message( STATUS "Found OpenSSL library at: ${ssl_LIBRARY_STATIC}" )
- message( STATUS "Found OpenSSL library at: ${ssl_LIBRARY_SHARED}" )
- message( STATUS "Found Crypto library at: ${crypto_LIBRARY_STATIC}" )
- message( STATUS "Found Crypto library at: ${crypto_LIBRARY_SHARED}" )
-else ( )
- message( FATAL_ERROR "Failed to locate OpenSSL dependency. see restbed/dependency/openssl; ./config shared; make all" )
-endif ( )
+if (BUILD_SSL)
+ set( OPENSSL_FOUND TRUE )
+ add_definitions( -DBUILD_SSL=TRUE )
+ if ( APPLE AND BUILD_SSL )
+ set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated-declarations" )
+ endif( )
+endif()
\ No newline at end of file
11 changes: 10 additions & 1 deletion ports/restbed/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,20 @@ vcpkg_from_github(
PATCHES cmake.patch
)

set(USE_OPENSSL OFF)
if("openssl" IN_LIST FEATURES)
vcpkg_apply_patches(
SOURCE_PATH ${SOURCE_PATH}
PATCHES add_openssl_support.patch
)
set(USE_OPENSSL ON)
endif()

vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
OPTIONS
-DBUILD_SSL=OFF
-DBUILD_SSL=${USE_OPENSSL}
-DDISABLE_TESTS=ON
)

Expand Down