-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
45 lines (32 loc) · 1.37 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
cmake_minimum_required(VERSION 3.2)
include("cmake/HunterGate.cmake")
HunterGate(
URL "https://github.com/cpp-pm/hunter/archive/v0.23.299.tar.gz"
SHA1 "3d215b4bfac80824778fe9a93510e5f651d79e3a"
)
project(arkio)
set(CMAKE_CXX_STANDARD 20)
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fcoroutines-ts")
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fcoroutines")
endif()
hunter_add_package(Boost COMPONENTS system json)
hunter_add_package(fmt)
set(Boost_USE_STATIC_LIBS ON)
find_package (Threads REQUIRED)
find_package(fmt CONFIG REQUIRED)
find_package (Boost 1.75.0 CONFIG REQUIRED COMPONENTS system json)
set(ZRP_INCLUDE_DIRS ${PROJECT_SOURCE_DIR}/include)
set(ZRP_LIBRARIES Threads::Threads fmt::fmt-header-only Boost::boost Boost::system Boost::json)
if(CMAKE_SYSTEM_NAME MATCHES "Windows")
set(ZRP_LIBRARIES ${ZRP_LIBRARIES} bcrypt)
endif()
add_executable(zclient ${PROJECT_SOURCE_DIR}/src/zclient.cpp)
target_include_directories(zclient PUBLIC ${ZRP_INCLUDE_DIRS})
target_link_libraries(zclient PUBLIC ${ZRP_LIBRARIES})
add_executable(zserver ${PROJECT_SOURCE_DIR}/src/zserver.cpp)
target_include_directories(zserver PUBLIC ${ZRP_INCLUDE_DIRS})
target_link_libraries(zserver PUBLIC ${ZRP_LIBRARIES})
install(TARGETS zclient zserver RUNTIME DESTINATION bin)
include(InstallRequiredSystemLibraries)