-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
114 lines (97 loc) · 3.5 KB
/
Copy pathCMakeLists.txt
File metadata and controls
114 lines (97 loc) · 3.5 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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
cmake_minimum_required(VERSION 3.5)
project(Kepler C)
set(EXECUTABLE_NAME Kepler)
set(CMAKE_C_STANDARD 11)
set(PROJECT_DIR src)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_LIST_DIR}/cmake" CACHE STRING "Modules for CMake" FORCE)
INCLUDE_DIRECTORIES(src)
# Find libsodium on this system
#include(${PROJECT_DIR}/lib/libsodium/contrib/Findsodium.cmake)
# Incldude library directories
include_directories(${PROJECT_DIR}/lib/collections/)
include_directories(${PROJECT_DIR}/lib/cthreadpool/)
include_directories(${PROJECT_DIR}/lib/log/src/)
include_directories(${PROJECT_DIR}/lib/dispatch)
# Load source files for libraries
file(GLOB sqlite3 ${PROJECT_DIR}/lib/sqlite3/*.c)
file(GLOB collections ${PROJECT_DIR}/lib/collections/*.c)
file(GLOB cthreadpool ${PROJECT_DIR}/lib/cthreadpool/*.c)
file(GLOB log ${PROJECT_DIR}/lib/log/src/log.c)
file(GLOB hh_dispatch ${PROJECT_DIR}/lib/dispatch/*.c)
# Kepler classes
file(GLOB src ${PROJECT_DIR}/*.c)
file(GLOB util ${PROJECT_DIR}/util/*.c)
file(GLOB configuration ${PROJECT_DIR}/util/configuration/*.c)
file(GLOB communication ${PROJECT_DIR}/communication/*.c)
file(GLOB messages ${PROJECT_DIR}/communication/messages/*.c)
file(GLOB server ${PROJECT_DIR}/server/*.c)
file(GLOB rcon ${PROJECT_DIR}/server/rcon/*.c)
file(GLOB encoding ${PROJECT_DIR}/util/encoding/*.c)
file(GLOB database ${PROJECT_DIR}/database/*.c)
file(GLOB pathfinder ${PROJECT_DIR}/game/pathfinder/*.c)
# Query classes
file(GLOB queries ${PROJECT_DIR}/database/queries/*.c)
file(GLOB queries_items ${PROJECT_DIR}/database/queries/items/*.c)
file(GLOB queries_rooms ${PROJECT_DIR}/database/queries/rooms/*.c)
# Kepler managers
file(GLOB game ${PROJECT_DIR}/game/*.c)
file(GLOB club ${PROJECT_DIR}/game/club/*.c)
file(GLOB moderation ${PROJECT_DIR}/game/moderation/*.c)
file(GLOB players ${PROJECT_DIR}/game/player/*.c)
file(GLOB room ${PROJECT_DIR}/game/room/*.c)
file(GLOB room_public ${PROJECT_DIR}/game/room/public_rooms/*.c)
file(GLOB room_manager ${PROJECT_DIR}/game/room/manager/*.c)
file(GLOB room_mapping ${PROJECT_DIR}/game/room/mapping/*.c)
file(GLOB navigator ${PROJECT_DIR}/game/navigator/*.c)
file(GLOB items ${PROJECT_DIR}/game/items/*.c)
file(GLOB inventory ${PROJECT_DIR}/game/inventory/*.c)
file(GLOB items_definition ${PROJECT_DIR}/game/items/definition/*.c)
file(GLOB messenger ${PROJECT_DIR}/game/messenger/*.c)
file(GLOB catalogue ${PROJECT_DIR}/game/catalogue/*.c)
file(GLOB texts ${PROJECT_DIR}/game/texts/*.c)
# Tasks
file(GLOB tasks ${PROJECT_DIR}/game/room/tasks/*.c)
# Enable color in log.c library
add_definitions(-DLOG_USE_COLOR)
add_executable(${EXECUTABLE_NAME}
${hh_dispatch}
${collections}
${log}
${src}
${util}
${configuration}
${messages}
${communication}
${server}
${rcon}
${encoding}
${database}
${pathfinder}
${queries}
${queries_items}
${queries_rooms}
${game}
${moderation}
${club}
${players}
${navigator}
${items}
${inventory}
${items_definition}
${tasks}
${room}
${room_public}
${room_mapping}
${room_manager}
${messenger}
${catalogue}
${texts})
find_package(Libuv REQUIRED)
find_package(Libsodium REQUIRED)
target_include_directories(${EXECUTABLE_NAME} PRIVATE
${LIBUV_INCLUDE_DIRS}
${LIBSODIUM_INCLUDE_DIRS})
target_link_libraries(${EXECUTABLE_NAME}
${LIBUV_LIBRARIES}
${LIBSODIUM_LIBRARIES}
sqlite3)