cmake_minimum_required (VERSION 2.8.8) project (Simple-Web-Server) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -Wextra") include_directories(.) find_package(Threads REQUIRED) find_package(Boost 1.53.0 COMPONENTS system thread filesystem date_time REQUIRED) include_directories(SYSTEM ${Boost_INCLUDE_DIR}) if(APPLE) set(OPENSSL_ROOT_DIR "/usr/local/opt/openssl") endif() #TODO: add requirement for version 1.0.1g (can it be done in one line?) find_package(OpenSSL) if(OPENSSL_FOUND) include_directories(SYSTEM ${OPENSSL_INCLUDE_DIR}) add_executable(https_examples https_examples.cpp) target_link_libraries(https_examples ${Boost_LIBRARIES}) target_link_libraries(https_examples ${OPENSSL_LIBRARIES}) target_link_libraries(https_examples ${CMAKE_THREAD_LIBS_INIT}) endif() add_executable(http_examples http_examples.cpp) target_link_libraries(http_examples ${Boost_LIBRARIES}) target_link_libraries(http_examples ${CMAKE_THREAD_LIBS_INIT}) if(MSYS) #TODO: Is MSYS true when MSVC is true? target_link_libraries(http_examples ws2_32 wsock32) target_link_libraries(https_examples ws2_32 wsock32) endif() enable_testing() add_subdirectory(tests) install(FILES server_http.hpp client_http.hpp server_https.hpp client_https.hpp DESTINATION include/simple-web-server)