create the examples only ( http_examples.cpp / https_examples.cpp ) if the boost library is found.
This commit is contained in:
parent
0f8b26ff19
commit
3c251dfadb
1 changed files with 13 additions and 13 deletions
|
|
@ -61,19 +61,19 @@ endif()
|
||||||
|
|
||||||
# If Simple-Web-Server is not a sub-project:
|
# If Simple-Web-Server is not a sub-project:
|
||||||
if("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}")
|
if("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}")
|
||||||
add_executable(http_examples http_examples.cpp)
|
find_package(Boost 1.53.0 COMPONENTS system thread filesystem)
|
||||||
target_link_libraries(http_examples simple-web-server)
|
if(Boost_FOUND)
|
||||||
|
add_executable(http_examples http_examples.cpp)
|
||||||
find_package(Boost 1.53.0 COMPONENTS system thread filesystem REQUIRED)
|
target_link_libraries(http_examples simple-web-server)
|
||||||
target_link_libraries(http_examples ${Boost_LIBRARIES})
|
target_link_libraries(http_examples ${Boost_LIBRARIES})
|
||||||
target_include_directories(http_examples PRIVATE ${Boost_INCLUDE_DIR})
|
target_include_directories(http_examples PRIVATE ${Boost_INCLUDE_DIR})
|
||||||
if(OPENSSL_FOUND)
|
if(OPENSSL_FOUND)
|
||||||
add_executable(https_examples https_examples.cpp)
|
add_executable(https_examples https_examples.cpp)
|
||||||
target_link_libraries(https_examples simple-web-server)
|
target_link_libraries(https_examples simple-web-server)
|
||||||
target_link_libraries(https_examples ${Boost_LIBRARIES})
|
target_link_libraries(https_examples ${Boost_LIBRARIES})
|
||||||
target_include_directories(https_examples PRIVATE ${Boost_INCLUDE_DIR})
|
target_include_directories(https_examples PRIVATE ${Boost_INCLUDE_DIR})
|
||||||
endif()
|
endif()
|
||||||
|
endif()
|
||||||
set(BUILD_TESTING ON)
|
set(BUILD_TESTING ON)
|
||||||
|
|
||||||
install(FILES asio_compatibility.hpp server_http.hpp client_http.hpp server_https.hpp client_https.hpp crypto.hpp utility.hpp status_code.hpp mutex.hpp DESTINATION include/simple-web-server)
|
install(FILES asio_compatibility.hpp server_http.hpp client_http.hpp server_https.hpp client_https.hpp crypto.hpp utility.hpp status_code.hpp mutex.hpp DESTINATION include/simple-web-server)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue