74 lines
1.8 KiB
CMake
74 lines
1.8 KiB
CMake
cmake_minimum_required (VERSION 3.1 FATAL_ERROR)
|
|
project (UDPService VERSION 0.1.0 LANGUAGES CXX C)
|
|
set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/Modules)
|
|
include(defaultOptions)
|
|
|
|
# IF(NOT TARGET nlohmann_json::nlohmann_json)
|
|
# set(JSON_BuildTests OFF CACHE INTERNAL "")
|
|
# add_subdirectory(libs/json EXCLUDE_FROM_ALL)
|
|
# ENDIF()
|
|
|
|
IF(NOT TARGET loguru)
|
|
add_subdirectory(libs/loguru EXCLUDE_FROM_ALL)
|
|
set_property(TARGET loguru PROPERTY POSITION_INDEPENDENT_CODE 1)
|
|
ENDIF()
|
|
|
|
|
|
|
|
add_library(CommService STATIC
|
|
|
|
include/CommService/Convert.hpp
|
|
include/CommService/transmittable.hpp
|
|
|
|
|
|
include/CommService/CommService.hpp
|
|
src/CommService/CommService.cpp
|
|
|
|
include/CommService/Message.hpp
|
|
src/CommService/Message.cpp
|
|
|
|
include/CommService/ThreadsafeQueue.hpp
|
|
|
|
|
|
# include/UDPService/BasicMessageQueue.hpp
|
|
# src/UDPService/BasicMessageQueue.cpp
|
|
|
|
include/CommService/PayLoads/Join.hpp
|
|
src/CommService/PayLoads/Join.cpp
|
|
include/CommService/PayLoads/Leave.hpp
|
|
src/CommService/PayLoads/Leave.cpp
|
|
|
|
include/CommService/PayLoads/Ping.hpp
|
|
src/CommService/PayLoads/Ping.cpp
|
|
include/CommService/PayLoads/Pong.hpp
|
|
src/CommService/PayLoads/Pong.cpp
|
|
|
|
|
|
|
|
|
|
)
|
|
|
|
target_link_libraries(CommService
|
|
PUBLIC
|
|
# nlohmann_json::nlohmann_json
|
|
loguru
|
|
pthread
|
|
)
|
|
|
|
target_include_directories(CommService
|
|
PUBLIC
|
|
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
|
|
$<INSTALL_INTERFACE:include>
|
|
PRIVATE
|
|
src
|
|
)
|
|
|
|
|
|
add_executable(main
|
|
src/main.cpp
|
|
)
|
|
|
|
target_link_libraries(main
|
|
CommService
|
|
loguru
|
|
) |