From b0bd7df4739658b834b22edab791a0b591a8fab1 Mon Sep 17 00:00:00 2001 From: eidheim Date: Mon, 24 Jun 2019 10:15:38 +0200 Subject: [PATCH] Cleanup of merge request 239 , and reverted changes where examples are not built when standalone asio is used --- CMakeLists.txt | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5222233..09ce5a9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -25,8 +25,8 @@ if(USE_STANDALONE_ASIO) find_path(HAVE_ASIO asio.hpp) if(NOT HAVE_ASIO) message(FATAL_ERROR "Standalone Asio not found") - else() - target_include_directories(simple-web-server INTERFACE ${HAVE_ASIO}) + else() + target_include_directories(simple-web-server INTERFACE ${HAVE_ASIO}) endif() else() find_package(Boost 1.53.0 COMPONENTS system thread REQUIRED) @@ -55,20 +55,18 @@ endif() # If Simple-Web-Server is not a sub-project: if("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}") - if(NOT USE_STANDALONE_ASIO) - add_executable(http_examples http_examples.cpp) - target_link_libraries(http_examples simple-web-server) - - find_package(Boost 1.53.0 COMPONENTS system thread filesystem REQUIRED) - target_link_libraries(http_examples ${Boost_LIBRARIES}) - target_include_directories(http_examples PRIVATE ${Boost_INCLUDE_DIR}) - if(OPENSSL_FOUND) - add_executable(https_examples https_examples.cpp) - target_link_libraries(https_examples simple-web-server) - target_link_libraries(https_examples ${Boost_LIBRARIES}) - target_include_directories(https_examples PRIVATE ${Boost_INCLUDE_DIR}) - endif() - endif() + add_executable(http_examples http_examples.cpp) + target_link_libraries(http_examples simple-web-server) + + find_package(Boost 1.53.0 COMPONENTS system thread filesystem REQUIRED) + target_link_libraries(http_examples ${Boost_LIBRARIES}) + target_include_directories(http_examples PRIVATE ${Boost_INCLUDE_DIR}) + if(OPENSSL_FOUND) + add_executable(https_examples https_examples.cpp) + target_link_libraries(https_examples simple-web-server) + target_link_libraries(https_examples ${Boost_LIBRARIES}) + target_include_directories(https_examples PRIVATE ${Boost_INCLUDE_DIR}) + endif() set(BUILD_TESTING ON)