mirror of
https://github.com/CrowCpp/Crow.git
synced 2024-06-07 21:10:44 +00:00
Skip building SSL example if OpenSSL is not found
This commit is contained in:
parent
e9d41a6373
commit
2cf77c7053
@ -3,6 +3,10 @@ project (crow_all)
|
|||||||
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/")
|
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/")
|
||||||
find_package(Tcmalloc)
|
find_package(Tcmalloc)
|
||||||
find_package(Threads)
|
find_package(Threads)
|
||||||
|
find_package(OpenSSL)
|
||||||
|
if(OPENSSL_FOUND)
|
||||||
|
include_directories(${OPENSSL_INCLUDE_DIR})
|
||||||
|
endif()
|
||||||
|
|
||||||
if (NOT CMAKE_BUILD_TYPE)
|
if (NOT CMAKE_BUILD_TYPE)
|
||||||
message(STATUS "No build type selected, default to Release")
|
message(STATUS "No build type selected, default to Release")
|
||||||
|
@ -11,9 +11,11 @@ add_executable(helloworld helloworld.cpp)
|
|||||||
target_link_libraries(helloworld ${Boost_LIBRARIES})
|
target_link_libraries(helloworld ${Boost_LIBRARIES})
|
||||||
target_link_libraries(helloworld ${CMAKE_THREAD_LIBS_INIT})
|
target_link_libraries(helloworld ${CMAKE_THREAD_LIBS_INIT})
|
||||||
|
|
||||||
|
if (OPENSSL_FOUND)
|
||||||
add_executable(example_ssl ssl/example_ssl.cpp)
|
add_executable(example_ssl ssl/example_ssl.cpp)
|
||||||
target_link_libraries(example_ssl ${Boost_LIBRARIES})
|
target_link_libraries(example_ssl ${Boost_LIBRARIES})
|
||||||
target_link_libraries(example_ssl ${CMAKE_THREAD_LIBS_INIT} ssl crypto)
|
target_link_libraries(example_ssl ${CMAKE_THREAD_LIBS_INIT} ${OPENSSL_LIBRARIES})
|
||||||
|
endif()
|
||||||
|
|
||||||
add_executable(example_websocket websocket/example_ws.cpp)
|
add_executable(example_websocket websocket/example_ws.cpp)
|
||||||
target_link_libraries(example_websocket ${Boost_LIBRARIES})
|
target_link_libraries(example_websocket ${Boost_LIBRARIES})
|
||||||
|
Loading…
Reference in New Issue
Block a user