2021-07-05 15:29:35 +00:00
|
|
|
cmake_minimum_required(VERSION 3.10)
|
2021-06-24 07:09:25 +00:00
|
|
|
project(superdog_server)
|
2021-07-05 15:29:35 +00:00
|
|
|
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")
|
2021-07-05 15:29:35 +00:00
|
|
|
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)
|
2021-07-05 15:29:35 +00:00
|
|
|
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")
|
2021-07-05 15:29:35 +00:00
|
|
|
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()
|
|
|
|
|