find_package(Boost COMPONENTS system REQUIRED) find_package(Threads) find_package(OpenSSL REQUIRED) add_library(cmix-network acceptor.hpp acceptor.cpp accept.hpp accept.cpp connect.hpp connect.cpp server.hpp server.cpp client.hpp protobufclient.hpp uriparser.hpp uriparser.cpp ) target_include_directories(cmix-network PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ) target_link_libraries(cmix-network PRIVATE Boost::boost PUBLIC Boost::system PUBLIC ${CMAKE_THREAD_LIBS_INIT} PRIVATE cmix PUBLIC log ) option(enable_asio_handler_debug "Enable Asio handler logging to stderr" off) if(enable_asio_handler_debug) target_compile_definitions(cmix-network PUBLIC BOOST_ASIO_ENABLE_HANDLER_TRACKING ) endif(enable_asio_handler_debug) if(WIN32) target_include_directories(cmix-network PUBLIC ${OPENSSL_INCLUDE_DIRS} ) target_link_libraries(cmix-network PUBLIC wsock32 PUBLIC ws2_32 PUBLIC ${OPENSSL_LIBRARIES} ) target_compile_definitions(cmix-network PUBLIC BOOST_ASIO_ENABLE_CANCELIO ) else(WIN32) target_link_libraries(cmix-network PUBLIC OpenSSL::SSL ) endif(WIN32)