From c0cf030528e5ecbb74750eb76bb7a360da62f209 Mon Sep 17 00:00:00 2001 From: Vinnie Falco Date: Sun, 1 Oct 2017 10:33:49 -0700 Subject: [PATCH] OpenSSL targets are optional (CMake) --- CHANGELOG.md | 1 + example/advanced/server-flex/CMakeLists.txt | 31 ++++++++++--------- example/http/client/async-ssl/CMakeLists.txt | 27 +++++++++------- example/http/client/coro-ssl/CMakeLists.txt | 27 +++++++++------- example/http/client/sync-ssl/CMakeLists.txt | 27 +++++++++------- example/http/server/async-ssl/CMakeLists.txt | 27 +++++++++------- example/http/server/coro-ssl/CMakeLists.txt | 27 +++++++++------- example/http/server/flex/CMakeLists.txt | 29 +++++++++-------- .../http/server/stackless-ssl/CMakeLists.txt | 27 +++++++++------- example/http/server/sync-ssl/CMakeLists.txt | 25 ++++++++------- .../websocket/client/async-ssl/CMakeLists.txt | 27 +++++++++------- .../websocket/client/coro-ssl/CMakeLists.txt | 27 +++++++++------- .../websocket/client/sync-ssl/CMakeLists.txt | 27 +++++++++------- .../websocket/server/async-ssl/CMakeLists.txt | 27 +++++++++------- .../websocket/server/coro-ssl/CMakeLists.txt | 27 +++++++++------- .../server/stackless-ssl/CMakeLists.txt | 27 +++++++++------- .../websocket/server/sync-ssl/CMakeLists.txt | 27 +++++++++------- 17 files changed, 243 insertions(+), 194 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5df70e23..8798fcfc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ Version 120: * Fix spurious strand_ in advanced_server_flex +* OpenSSL targets are optional (CMake) -------------------------------------------------------------------------------- diff --git a/example/advanced/server-flex/CMakeLists.txt b/example/advanced/server-flex/CMakeLists.txt index 3129be74..00697288 100644 --- a/example/advanced/server-flex/CMakeLists.txt +++ b/example/advanced/server-flex/CMakeLists.txt @@ -7,19 +7,22 @@ # Official repository: https://github.com/boostorg/beast # -GroupSources(include/boost/beast beast) -GroupSources(example/common common) -GroupSources(example/advanced/server-flex "/") +if (OPENSSL_FOUND) + GroupSources(include/boost/beast beast) + GroupSources(example/common common) + GroupSources(example/advanced/server-flex "/") -add_executable (advanced-server-flex - ${BOOST_BEAST_INCLUDES} - ${PROJECT_SOURCE_DIR}/example/common/detect_ssl.hpp - ${PROJECT_SOURCE_DIR}/example/common/server_certificate.hpp - ${PROJECT_SOURCE_DIR}/example/common/ssl_stream.hpp - Jamfile - advanced_server_flex.cpp -) - -target_link_libraries (advanced-server-flex - ${OPENSSL_LIBRARIES} + add_executable (advanced-server-flex + ${BOOST_BEAST_INCLUDES} + ${PROJECT_SOURCE_DIR}/example/common/detect_ssl.hpp + ${PROJECT_SOURCE_DIR}/example/common/server_certificate.hpp + ${PROJECT_SOURCE_DIR}/example/common/ssl_stream.hpp + Jamfile + advanced_server_flex.cpp ) + + target_link_libraries (advanced-server-flex + ${OPENSSL_LIBRARIES} + ) + +endif() diff --git a/example/http/client/async-ssl/CMakeLists.txt b/example/http/client/async-ssl/CMakeLists.txt index c4bfec12..92675aed 100644 --- a/example/http/client/async-ssl/CMakeLists.txt +++ b/example/http/client/async-ssl/CMakeLists.txt @@ -7,17 +7,20 @@ # Official repository: https://github.com/boostorg/beast # -GroupSources(include/boost/beast beast) -GroupSources(example/common common) -GroupSources(example/http/client/async-ssl "/") +if (OPENSSL_FOUND) + GroupSources(include/boost/beast beast) + GroupSources(example/common common) + GroupSources(example/http/client/async-ssl "/") -add_executable (http-client-async-ssl - ${BOOST_BEAST_INCLUDES} - ${PROJECT_SOURCE_DIR}/example/common/root_certificates.hpp - Jamfile - http_client_async_ssl.cpp -) - -target_link_libraries (http-client-async-ssl - ${OPENSSL_LIBRARIES} + add_executable (http-client-async-ssl + ${BOOST_BEAST_INCLUDES} + ${PROJECT_SOURCE_DIR}/example/common/root_certificates.hpp + Jamfile + http_client_async_ssl.cpp ) + + target_link_libraries (http-client-async-ssl + ${OPENSSL_LIBRARIES} + ) + +endif() diff --git a/example/http/client/coro-ssl/CMakeLists.txt b/example/http/client/coro-ssl/CMakeLists.txt index 2a6b5564..a8ac90af 100644 --- a/example/http/client/coro-ssl/CMakeLists.txt +++ b/example/http/client/coro-ssl/CMakeLists.txt @@ -7,17 +7,20 @@ # Official repository: https://github.com/boostorg/beast # -GroupSources(include/boost/beast beast) -GroupSources(example/common common) -GroupSources(example/http/client/coro-ssl "/") +if (OPENSSL_FOUND) + GroupSources(include/boost/beast beast) + GroupSources(example/common common) + GroupSources(example/http/client/coro-ssl "/") -add_executable (http-client-coro-ssl - ${BOOST_BEAST_INCLUDES} - ${PROJECT_SOURCE_DIR}/example/common/root_certificates.hpp - Jamfile - http_client_coro_ssl.cpp -) - -target_link_libraries (http-client-coro-ssl - ${OPENSSL_LIBRARIES} + add_executable (http-client-coro-ssl + ${BOOST_BEAST_INCLUDES} + ${PROJECT_SOURCE_DIR}/example/common/root_certificates.hpp + Jamfile + http_client_coro_ssl.cpp ) + + target_link_libraries (http-client-coro-ssl + ${OPENSSL_LIBRARIES} + ) + +endif() diff --git a/example/http/client/sync-ssl/CMakeLists.txt b/example/http/client/sync-ssl/CMakeLists.txt index 7c229366..df1d9827 100644 --- a/example/http/client/sync-ssl/CMakeLists.txt +++ b/example/http/client/sync-ssl/CMakeLists.txt @@ -7,17 +7,20 @@ # Official repository: https://github.com/boostorg/beast # -GroupSources(include/boost/beast beast) -GroupSources(example/common common) -GroupSources(example/http/client/sync-ssl "/") +if (OPENSSL_FOUND) + GroupSources(include/boost/beast beast) + GroupSources(example/common common) + GroupSources(example/http/client/sync-ssl "/") -add_executable (http-client-sync-ssl - ${BOOST_BEAST_INCLUDES} - ${PROJECT_SOURCE_DIR}/example/common/root_certificates.hpp - Jamfile - http_client_sync_ssl.cpp -) - -target_link_libraries (http-client-sync-ssl - ${OPENSSL_LIBRARIES} + add_executable (http-client-sync-ssl + ${BOOST_BEAST_INCLUDES} + ${PROJECT_SOURCE_DIR}/example/common/root_certificates.hpp + Jamfile + http_client_sync_ssl.cpp ) + + target_link_libraries (http-client-sync-ssl + ${OPENSSL_LIBRARIES} + ) + +endif() diff --git a/example/http/server/async-ssl/CMakeLists.txt b/example/http/server/async-ssl/CMakeLists.txt index b5c740cf..bc6f9c0b 100644 --- a/example/http/server/async-ssl/CMakeLists.txt +++ b/example/http/server/async-ssl/CMakeLists.txt @@ -7,17 +7,20 @@ # Official repository: https://github.com/boostorg/beast # -GroupSources(include/boost/beast beast) -GroupSources(example/common common) -GroupSources(example/http/server/async-ssl "/") +if (OPENSSL_FOUND) + GroupSources(include/boost/beast beast) + GroupSources(example/common common) + GroupSources(example/http/server/async-ssl "/") -add_executable (http-server-async-ssl - ${BOOST_BEAST_INCLUDES} - ${PROJECT_SOURCE_DIR}/example/common/server_certificate.hpp - Jamfile - http_server_async_ssl.cpp -) - -target_link_libraries (http-server-async-ssl - ${OPENSSL_LIBRARIES} + add_executable (http-server-async-ssl + ${BOOST_BEAST_INCLUDES} + ${PROJECT_SOURCE_DIR}/example/common/server_certificate.hpp + Jamfile + http_server_async_ssl.cpp ) + + target_link_libraries (http-server-async-ssl + ${OPENSSL_LIBRARIES} + ) + +endif() diff --git a/example/http/server/coro-ssl/CMakeLists.txt b/example/http/server/coro-ssl/CMakeLists.txt index 5a37eeed..dc80a112 100644 --- a/example/http/server/coro-ssl/CMakeLists.txt +++ b/example/http/server/coro-ssl/CMakeLists.txt @@ -7,17 +7,20 @@ # Official repository: https://github.com/boostorg/beast # -GroupSources(include/boost/beast beast) -GroupSources(example/common common) -GroupSources(example/http/server/coro-ssl "/") +if (OPENSSL_FOUND) + GroupSources(include/boost/beast beast) + GroupSources(example/common common) + GroupSources(example/http/server/coro-ssl "/") -add_executable (http-server-coro-ssl - ${BOOST_BEAST_INCLUDES} - ${PROJECT_SOURCE_DIR}/example/common/server_certificate.hpp - Jamfile - http_server_coro_ssl.cpp -) - -target_link_libraries (http-server-coro-ssl - ${OPENSSL_LIBRARIES} + add_executable (http-server-coro-ssl + ${BOOST_BEAST_INCLUDES} + ${PROJECT_SOURCE_DIR}/example/common/server_certificate.hpp + Jamfile + http_server_coro_ssl.cpp ) + + target_link_libraries (http-server-coro-ssl + ${OPENSSL_LIBRARIES} + ) + +endif() diff --git a/example/http/server/flex/CMakeLists.txt b/example/http/server/flex/CMakeLists.txt index a02726d8..cc6e0cb6 100644 --- a/example/http/server/flex/CMakeLists.txt +++ b/example/http/server/flex/CMakeLists.txt @@ -7,18 +7,21 @@ # Official repository: https://github.com/boostorg/beast # -GroupSources(include/boost/beast beast) -GroupSources(example/common common) -GroupSources(example/http/server/flex "/") +if (OPENSSL_FOUND) + GroupSources(include/boost/beast beast) + GroupSources(example/common common) + GroupSources(example/http/server/flex "/") -add_executable (http-server-flex - ${BOOST_BEAST_INCLUDES} - ${PROJECT_SOURCE_DIR}/example/common/detect_ssl.hpp - ${PROJECT_SOURCE_DIR}/example/common/server_certificate.hpp - Jamfile - http_server_flex.cpp -) - -target_link_libraries (http-server-flex - ${OPENSSL_LIBRARIES} + add_executable (http-server-flex + ${BOOST_BEAST_INCLUDES} + ${PROJECT_SOURCE_DIR}/example/common/detect_ssl.hpp + ${PROJECT_SOURCE_DIR}/example/common/server_certificate.hpp + Jamfile + http_server_flex.cpp ) + + target_link_libraries (http-server-flex + ${OPENSSL_LIBRARIES} + ) + +endif() diff --git a/example/http/server/stackless-ssl/CMakeLists.txt b/example/http/server/stackless-ssl/CMakeLists.txt index ae9f69b2..e374e85e 100644 --- a/example/http/server/stackless-ssl/CMakeLists.txt +++ b/example/http/server/stackless-ssl/CMakeLists.txt @@ -7,17 +7,20 @@ # Official repository: https://github.com/boostorg/beast # -GroupSources(include/boost/beast beast) -GroupSources(example/common common) -GroupSources(example/http/server/stackless-ssl "/") +if (OPENSSL_FOUND) + GroupSources(include/boost/beast beast) + GroupSources(example/common common) + GroupSources(example/http/server/stackless-ssl "/") -add_executable (http-server-stackless-ssl - ${BOOST_BEAST_INCLUDES} - ${PROJECT_SOURCE_DIR}/example/common/server_certificate.hpp - Jamfile - http_server_stackless_ssl.cpp -) - -target_link_libraries (http-server-stackless-ssl - ${OPENSSL_LIBRARIES} + add_executable (http-server-stackless-ssl + ${BOOST_BEAST_INCLUDES} + ${PROJECT_SOURCE_DIR}/example/common/server_certificate.hpp + Jamfile + http_server_stackless_ssl.cpp ) + + target_link_libraries (http-server-stackless-ssl + ${OPENSSL_LIBRARIES} + ) + +endif() diff --git a/example/http/server/sync-ssl/CMakeLists.txt b/example/http/server/sync-ssl/CMakeLists.txt index 03824e51..5747923e 100644 --- a/example/http/server/sync-ssl/CMakeLists.txt +++ b/example/http/server/sync-ssl/CMakeLists.txt @@ -7,16 +7,19 @@ # Official repository: https://github.com/boostorg/beast # -GroupSources(include/boost/beast beast) -GroupSources(example/common common) -GroupSources(example/http/server/sync-ssl "/") +if (OPENSSL_FOUND) + GroupSources(include/boost/beast beast) + GroupSources(example/common common) + GroupSources(example/http/server/sync-ssl "/") -add_executable (http-server-sync-ssl - ${BOOST_BEAST_INCLUDES} - ${PROJECT_SOURCE_DIR}/example/common/server_certificate.hpp - Jamfile - http_server_sync_ssl.cpp -) -target_link_libraries (http-server-sync-ssl - ${OPENSSL_LIBRARIES} + add_executable (http-server-sync-ssl + ${BOOST_BEAST_INCLUDES} + ${PROJECT_SOURCE_DIR}/example/common/server_certificate.hpp + Jamfile + http_server_sync_ssl.cpp ) + target_link_libraries (http-server-sync-ssl + ${OPENSSL_LIBRARIES} + ) + +endif() diff --git a/example/websocket/client/async-ssl/CMakeLists.txt b/example/websocket/client/async-ssl/CMakeLists.txt index e7ceb413..4b522855 100644 --- a/example/websocket/client/async-ssl/CMakeLists.txt +++ b/example/websocket/client/async-ssl/CMakeLists.txt @@ -7,17 +7,20 @@ # Official repository: https://github.com/boostorg/beast # -GroupSources(include/boost/beast beast) -GroupSources(example/common common) -GroupSources(example/websocket/client/async-ssl "/") +if (OPENSSL_FOUND) + GroupSources(include/boost/beast beast) + GroupSources(example/common common) + GroupSources(example/websocket/client/async-ssl "/") -add_executable (websocket-client-async-ssl - ${BOOST_BEAST_INCLUDES} - ${PROJECT_SOURCE_DIR}/example/common/root_certificates.hpp - Jamfile - websocket_client_async_ssl.cpp -) - -target_link_libraries (websocket-client-async-ssl - ${OPENSSL_LIBRARIES} + add_executable (websocket-client-async-ssl + ${BOOST_BEAST_INCLUDES} + ${PROJECT_SOURCE_DIR}/example/common/root_certificates.hpp + Jamfile + websocket_client_async_ssl.cpp ) + + target_link_libraries (websocket-client-async-ssl + ${OPENSSL_LIBRARIES} + ) + +endif() diff --git a/example/websocket/client/coro-ssl/CMakeLists.txt b/example/websocket/client/coro-ssl/CMakeLists.txt index c9f9bbcf..13b093cb 100644 --- a/example/websocket/client/coro-ssl/CMakeLists.txt +++ b/example/websocket/client/coro-ssl/CMakeLists.txt @@ -7,17 +7,20 @@ # Official repository: https://github.com/boostorg/beast # -GroupSources(include/boost/beast beast) -GroupSources(example/common common) -GroupSources(example/websocket/client/coro-ssl "/") +if (OPENSSL_FOUND) + GroupSources(include/boost/beast beast) + GroupSources(example/common common) + GroupSources(example/websocket/client/coro-ssl "/") -add_executable (websocket-client-coro-ssl - ${BOOST_BEAST_INCLUDES} - ${PROJECT_SOURCE_DIR}/example/common/root_certificates.hpp - Jamfile - websocket_client_coro_ssl.cpp -) - -target_link_libraries (websocket-client-coro-ssl - ${OPENSSL_LIBRARIES} + add_executable (websocket-client-coro-ssl + ${BOOST_BEAST_INCLUDES} + ${PROJECT_SOURCE_DIR}/example/common/root_certificates.hpp + Jamfile + websocket_client_coro_ssl.cpp ) + + target_link_libraries (websocket-client-coro-ssl + ${OPENSSL_LIBRARIES} + ) + +endif() diff --git a/example/websocket/client/sync-ssl/CMakeLists.txt b/example/websocket/client/sync-ssl/CMakeLists.txt index a7658b7e..5a5f368e 100644 --- a/example/websocket/client/sync-ssl/CMakeLists.txt +++ b/example/websocket/client/sync-ssl/CMakeLists.txt @@ -7,17 +7,20 @@ # Official repository: https://github.com/boostorg/beast # -GroupSources(include/boost/beast beast) -GroupSources(example/common common) -GroupSources(example/websocket/client/sync-ssl "/") +if (OPENSSL_FOUND) + GroupSources(include/boost/beast beast) + GroupSources(example/common common) + GroupSources(example/websocket/client/sync-ssl "/") -add_executable (websocket-client-sync-ssl - ${BOOST_BEAST_INCLUDES} - ${PROJECT_SOURCE_DIR}/example/common/root_certificates.hpp - Jamfile - websocket_client_sync_ssl.cpp -) - -target_link_libraries (websocket-client-sync-ssl - ${OPENSSL_LIBRARIES} + add_executable (websocket-client-sync-ssl + ${BOOST_BEAST_INCLUDES} + ${PROJECT_SOURCE_DIR}/example/common/root_certificates.hpp + Jamfile + websocket_client_sync_ssl.cpp ) + + target_link_libraries (websocket-client-sync-ssl + ${OPENSSL_LIBRARIES} + ) + +endif() diff --git a/example/websocket/server/async-ssl/CMakeLists.txt b/example/websocket/server/async-ssl/CMakeLists.txt index 408f39bf..f8fed86e 100644 --- a/example/websocket/server/async-ssl/CMakeLists.txt +++ b/example/websocket/server/async-ssl/CMakeLists.txt @@ -7,17 +7,20 @@ # Official repository: https://github.com/boostorg/beast # -GroupSources(include/boost/beast beast) -GroupSources(example/common common) -GroupSources(example/websocket/server/async-ssl "/") +if (OPENSSL_FOUND) + GroupSources(include/boost/beast beast) + GroupSources(example/common common) + GroupSources(example/websocket/server/async-ssl "/") -add_executable (websocket-server-async-ssl - ${BOOST_BEAST_INCLUDES} - ${PROJECT_SOURCE_DIR}/example/common/server_certificate.hpp - Jamfile - websocket_server_async_ssl.cpp -) - -target_link_libraries (websocket-server-async-ssl - ${OPENSSL_LIBRARIES} + add_executable (websocket-server-async-ssl + ${BOOST_BEAST_INCLUDES} + ${PROJECT_SOURCE_DIR}/example/common/server_certificate.hpp + Jamfile + websocket_server_async_ssl.cpp ) + + target_link_libraries (websocket-server-async-ssl + ${OPENSSL_LIBRARIES} + ) + +endif() diff --git a/example/websocket/server/coro-ssl/CMakeLists.txt b/example/websocket/server/coro-ssl/CMakeLists.txt index 9a5e6a53..b6eb14b9 100644 --- a/example/websocket/server/coro-ssl/CMakeLists.txt +++ b/example/websocket/server/coro-ssl/CMakeLists.txt @@ -7,17 +7,20 @@ # Official repository: https://github.com/boostorg/beast # -GroupSources(include/boost/beast beast) -GroupSources(example/common common) -GroupSources(example/websocket/server/coro-ssl "/") +if (OPENSSL_FOUND) + GroupSources(include/boost/beast beast) + GroupSources(example/common common) + GroupSources(example/websocket/server/coro-ssl "/") -add_executable (websocket-server-coro-ssl - ${BOOST_BEAST_INCLUDES} - ${PROJECT_SOURCE_DIR}/example/common/server_certificate.hpp - Jamfile - websocket_server_coro_ssl.cpp -) - -target_link_libraries (websocket-server-coro-ssl - ${OPENSSL_LIBRARIES} + add_executable (websocket-server-coro-ssl + ${BOOST_BEAST_INCLUDES} + ${PROJECT_SOURCE_DIR}/example/common/server_certificate.hpp + Jamfile + websocket_server_coro_ssl.cpp ) + + target_link_libraries (websocket-server-coro-ssl + ${OPENSSL_LIBRARIES} + ) + +endif() diff --git a/example/websocket/server/stackless-ssl/CMakeLists.txt b/example/websocket/server/stackless-ssl/CMakeLists.txt index 6dfedbd9..9c717d62 100644 --- a/example/websocket/server/stackless-ssl/CMakeLists.txt +++ b/example/websocket/server/stackless-ssl/CMakeLists.txt @@ -7,17 +7,20 @@ # Official repository: https://github.com/boostorg/beast # -GroupSources(include/boost/beast beast) -GroupSources(example/common common) -GroupSources(example/websocket/server/stackless-ssl "/") +if (OPENSSL_FOUND) + GroupSources(include/boost/beast beast) + GroupSources(example/common common) + GroupSources(example/websocket/server/stackless-ssl "/") -add_executable (websocket-server-stackless-ssl - ${BOOST_BEAST_INCLUDES} - ${PROJECT_SOURCE_DIR}/example/common/server_certificate.hpp - Jamfile - websocket_server_stackless_ssl.cpp -) - -target_link_libraries (websocket-server-stackless-ssl - ${OPENSSL_LIBRARIES} + add_executable (websocket-server-stackless-ssl + ${BOOST_BEAST_INCLUDES} + ${PROJECT_SOURCE_DIR}/example/common/server_certificate.hpp + Jamfile + websocket_server_stackless_ssl.cpp ) + + target_link_libraries (websocket-server-stackless-ssl + ${OPENSSL_LIBRARIES} + ) + +endif() diff --git a/example/websocket/server/sync-ssl/CMakeLists.txt b/example/websocket/server/sync-ssl/CMakeLists.txt index 3ee83df2..35157acb 100644 --- a/example/websocket/server/sync-ssl/CMakeLists.txt +++ b/example/websocket/server/sync-ssl/CMakeLists.txt @@ -7,17 +7,20 @@ # Official repository: https://github.com/boostorg/beast # -GroupSources(include/boost/beast beast) -GroupSources(example/common common) -GroupSources(example/websocket/server/sync-ssl "/") +if (OPENSSL_FOUND) + GroupSources(include/boost/beast beast) + GroupSources(example/common common) + GroupSources(example/websocket/server/sync-ssl "/") -add_executable (websocket-server-sync-ssl - ${BOOST_BEAST_INCLUDES} - ${PROJECT_SOURCE_DIR}/example/common/server_certificate.hpp - Jamfile - websocket_server_sync_ssl.cpp -) - -target_link_libraries (websocket-server-sync-ssl - ${OPENSSL_LIBRARIES} + add_executable (websocket-server-sync-ssl + ${BOOST_BEAST_INCLUDES} + ${PROJECT_SOURCE_DIR}/example/common/server_certificate.hpp + Jamfile + websocket_server_sync_ssl.cpp ) + + target_link_libraries (websocket-server-sync-ssl + ${OPENSSL_LIBRARIES} + ) + +endif()