diff --git a/CMakeLists.txt b/CMakeLists.txt index f4db2cf2a..e2d3bc7dc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,6 +3,10 @@ project (crow_all) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/") find_package(Tcmalloc) find_package(Threads) +find_package(OpenSSL) +if(OPENSSL_FOUND) + include_directories(${OPENSSL_INCLUDE_DIR}) +endif() if (NOT CMAKE_BUILD_TYPE) message(STATUS "No build type selected, default to Release") diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 1e96dea22..ef65f026c 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -11,9 +11,11 @@ add_executable(helloworld helloworld.cpp) target_link_libraries(helloworld ${Boost_LIBRARIES}) target_link_libraries(helloworld ${CMAKE_THREAD_LIBS_INIT}) +if (OPENSSL_FOUND) add_executable(example_ssl ssl/example_ssl.cpp) 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) target_link_libraries(example_websocket ${Boost_LIBRARIES})