-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
90 lines (75 loc) · 1.97 KB
/
Copy pathCMakeLists.txt
File metadata and controls
90 lines (75 loc) · 1.97 KB
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
cmake_minimum_required(VERSION 3.28)
project(BlueBird)
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Debug")
endif()
set(CXX_FLAGS
-g
-ggdb
)
if(CMAKE_BUILD_BITS EQUAL 32)
list(APPEND CXX_FLAGS "-m32")
endif()
string(REPLACE ";" " " CMAKE_CXX_FLAGS "${CXX_FLAGS}")
set(CMAKE_CXX_FLAGS_DEBUG "-O0")
set(CMAKE_CXX_FLAGS_RELEASE "-O2 -DNDEBUG")
# SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)
# SET(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib)
if(NOT TARGET spdlog)
find_package(spdlog REQUIRED)
endif()
if(spdlog_FOUND)
add_definitions(-DSPDLOG_ENABLE_SOURCE_LOCATION)
include_directories(${spdlog_INCLUDE_DIRS})
else()
message(FATAL_ERROR "spdlog not found")
endif()
if(NOT TARGET Boost)
find_package(Boost REQUIRED)
endif()
if(Boost_FOUND)
include_directories(${Boost_INCLUDE_DIRS})
else()
message(FATAL_ERROR "Boost not found")
endif()
# find_package(MySQL REQUIRED)
# if(MySQL_FOUND)
# include_directories(${MYSQL_INCLUDE_DIR})
# else()
# message(FATAL_ERROR "mysql not found")
# endif()
# find_package(jsoncpp REQUIRED)
# if(JSONCPP_FOUND)
# include_directories(${JSONCPP_INCLUDE_DIRS})
# else()
# message(FATAL_ERROR "jsoncpp not found")
# endif()
# find_package(hiredis REQUIRED)
# if(HIREDIS_FOUND)
# include_directories(${HIREDIS_INCLUDE_DIRS})
# else()
# message(FATAL_ERROR "hiredis not found")
# endif()
if(NOT TARGET Protobuf)
find_package(Protobuf REQUIRED)
endif()
if(Protobuf_FOUND)
include_directories(${Protobuf_INCLUDE_DIRS})
else()
message(FATAL_ERROR "Protobuf not found")
endif()
if(NOT TARGET gRPC)
find_package(gRPC REQUIRED)
endif()
find_package(gRPC REQUIRED)
if(gRPC_FOUND)
include_directories(${gRPC_INCLUDE_DIRS})
else()
message(FATAL_ERROR "gRPC not found")
endif()
include_directories(${PROJECT_SOURCE_DIR})
include_directories(Server/Common)
add_subdirectory(Server/Common)
add_subdirectory(Server/ChatServer)
add_subdirectory(Server/GateServer)
add_subdirectory(Server/StatusServer)