superdog/server/CMakeLists.txt

25 lines
1.2 KiB
CMake
Raw Normal View History

cmake_minimum_required(VERSION 3.10)
2021-06-24 07:09:25 +00:00
project(superdog_server)
MESSAGE(STATUS "operation system is ${CMAKE_SYSTEM}")
MESSAGE(STATUS "compiler is ${CMAKE_CXX_COMPILER_ID}")
2021-06-24 07:09:25 +00:00
2021-06-29 16:10:17 +00:00
include_directories(superdog_server "third/include/libevent/include")
2021-07-04 17:05:27 +00:00
add_executable(superdog_server main.cpp tcp_client.cpp tcp_server_libevent.cpp tcp_swarm_libevent.cpp)
2021-06-29 16:10:17 +00:00
target_link_directories(superdog_server PUBLIC "./third/lib")
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
2021-07-04 17:05:27 +00:00
target_link_libraries(superdog_server event.lib event_extra.lib event_core.lib ws2_32)
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
target_link_libraries(superdog_server event.a event_extra.a libevent_pthreads.a event_core.a pthread)
endif()
2021-08-28 17:11:46 +00:00
2021-07-04 17:05:27 +00:00
project(swarm_client)
add_executable(swarm_client swarm.cpp tcp_client.cpp tcp_server_libevent.cpp tcp_swarm_libevent.cpp)
target_link_directories(swarm_client PUBLIC "./third/lib")
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
target_link_libraries(swarm_client event.lib event_extra.lib event_core.lib ws2_32)
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
target_link_libraries(swarm_client event.a event_extra.a event_core.a libevent_pthreads.a pthread)
endif()