This commit is contained in:
commit
b06e7cfcd2
1 changed files with 17 additions and 12 deletions
|
|
@ -22,9 +22,11 @@ target_link_libraries(simple-web-server INTERFACE ${CMAKE_THREAD_LIBS_INIT})
|
|||
# Remove Boost system, thread, regex components; use Boost::<component> aliases; remove Boost target_include_directories
|
||||
if(USE_STANDALONE_ASIO)
|
||||
target_compile_definitions(simple-web-server INTERFACE USE_STANDALONE_ASIO)
|
||||
find_file(HAVE_ASIO asio.hpp)
|
||||
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})
|
||||
endif()
|
||||
else()
|
||||
find_package(Boost 1.53.0 COMPONENTS system thread REQUIRED)
|
||||
|
|
@ -53,17 +55,20 @@ endif()
|
|||
|
||||
# If Simple-Web-Server is not a sub-project:
|
||||
if("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}")
|
||||
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()
|
||||
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()
|
||||
|
||||
set(BUILD_TESTING ON)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue