cmake_minimum_required(VERSION 3.5) project(OnlineDetectorSimulator) #define some speciel output paths for libraries and executables set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin) set(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake) #use c++11 set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(Boost_USE_MULTITHREADED ON) SET(BOOST_MIN_VERSION "1.58.0") add_definitions(-DBOOST_LOG_DYN_LINK=1) #find required packages find_package(LibConfig REQUIRED) find_package(Boost ${BOOST_MIN_VERSION} REQUIRED COMPONENTS log filesystem) find_package(OpenMP) #add openmp if(OPENMP_FOUND) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}") set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_EXE_LINKER_FLAGS}") endif() include_directories( ${LIBCONFIGPP_INCLUDE_DIR} ${BOOST_INCLUDE_DIRS} ) set(SOURCES_CLIENT "${CMAKE_SOURCE_DIR}/UDPClient/UDPClient.cpp" "${CMAKE_SOURCE_DIR}/main.cpp" ) set(SOURCES_SERVER "${CMAKE_SOURCE_DIR}/UDPServer/UDPServer.cpp" "${CMAKE_SOURCE_DIR}/main_server.cpp" ) add_executable(onlineDetectorSimulatorServer ${SOURCES_SERVER}) add_executable(onlineDetectorSimulatorClient ${SOURCES_CLIENT})