forked from opentibia/server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
368 lines (342 loc) · 14 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
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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
PROJECT(otserv CXX)
# CMake 2.6 compatibility
IF(${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 6)
GET_FILENAME_COMPONENT(CMAKE_CURRENT_LIST_DIR ${CMAKE_CURRENT_LIST_FILE} PATH)
ENDIF(${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 6)
SET(CMAKE_PREFIX_PATH "${CMAKE_CURRENT_SOURCE_DIR}/deps")
# Additional CMake modules
SET(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake;${CMAKE_MODULE_PATH}")
# Choose default build type if not specified
IF(NOT CMAKE_BUILD_TYPE)
SET(CMAKE_BUILD_TYPE RelWithDebInfo)
ENDIF(NOT CMAKE_BUILD_TYPE)
MESSAGE(STATUS "BUILD TYPE: " ${CMAKE_BUILD_TYPE})
SET(SERVER_SOURCES "")
SET(SERVER_HEADERS "")
SET(SERVER_LIBRARIES "")
SET(SERVER_DEFINITIONS "")
SET(SERVER_INCLUDE_DIRS "")
SET(SERVER_LIBRARY_DIRS "")
SET(VERSION "0.7.0")
SET(VERSION_MAJOR 0)
SET(VERSION_MINOR 7)
SET(VERSION_MICRO 0)
# Select the database drivers
OPTION(USE_SQLITE "build the server with SQLite database support" ON)
OPTION(USE_MYSQL "build the server with MySQL database support" OFF)
OPTION(USE_ODBC "build the server with ODBC database support" OFF)
OPTION(USE_POSTGRE "build the server with PostgreSQL database support" OFF)
OPTION(USE_LUAJIT "build the server with lua jit" OFF)
OPTION(USE_CPP11 "build with the new C++11 standard enabled" OFF)
OPTION(SKULLSYSTEM "enable skull system" OFF)
OPTION(OTALLOCATOR "enable otserv custom allocator" OFF)
OPTION(DEBUGGING "enable debugging of internal systems" OFF)
OPTION(USE_PCH "enable usage of precompiled headers" OFF)
OPTION(USE_STATIC_LIBS "use static libraries for linking" OFF)
# Compiler flags for gcc, mingw32 and clang
IF(CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
SET(CMAKE_CXX_FLAGS "-Wall")
SET(CMAKE_CXX_FLAGS_DEBUG "-O0 -g")
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O1 -g")
SET(CMAKE_CXX_FLAGS_RELEASE "-O2")
SET(CMAKE_CXX_FLAGS_MINSIZEREL "-Os")
IF(USE_STATIC_LIBS AND NOT APPLE)
SET(CMAKE_CXX_LINK_FLAGS "-static-libgcc -static-libstdc++")
ENDIF()
IF(USE_CPP11)
IF(WIN32)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++0x")
ELSE()
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
ENDIF()
ENDIF()
IF(WIN32)
SET(SERVER_LIBRARIES ${SERVER_LIBRARIES} ws2_32 mswsock)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mthreads")
ELSEIF(APPLE)
SET(SERVER_DEFINITIONS ${SERVER_DEFINITIONS} -D_REENTRANT)
ELSE(APPLE)
SET(SERVER_LIBRARIES ${SERVER_LIBRARIES} dl)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread")
ENDIF()
# Compiler flags for MSVC
ELSEIF(MSVC)
SET(SERVER_DEFINITIONS ${SERVER_DEFINITIONS}
-D_CRT_SECURE_NO_WARNINGS
-D_CRT_SECURE_NO_DEPRECATE
-D_CRT_NON_CONFORMING_SWPRINTFS
-D_SCL_SECURE_NO_DEPRECATE
-DWIN32_LEAN_AND_MEAN
-DNOMINMAX)
# Disable iterator checking on release builds
IF(NOT (CMAKE_BUILD_TYPE STREQUAL "Debug"))
SET(SERVER_DEFINITIONS ${SERVER_DEFINITIONS}
-D_SECURE_SCL=0
-D_SECURE_SCL_THROWS=0
-D_HAS_ITERATOR_DEBUGGING=0)
ENDIF()
SET(SERVER_LIBRARY_DIRS ${SERVER_LIBRARY_DIRS} ${Boost_LIBRARY_DIRS})
ENDIF()
# Boost
SET(Boost_USE_MULTITHREADED ON)
IF(USE_STATIC_LIBS)
SET(Boost_USE_STATIC_LIBS ON)
ENDIF()
IF(MINGW)
SET(Boost_THREADAPI win32)
SET(SERVER_DEFINITIONS ${SERVER_DEFINITIONS} -DBOOST_THREAD_USE_LIB)
ENDIF()
FIND_PACKAGE(Boost COMPONENTS thread regex system filesystem REQUIRED)
SET(SERVER_LIBRARIES ${SERVER_LIBRARIES} ${Boost_LIBRARIES})
SET(SERVER_INCLUDE_DIRS ${SERVER_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS})
# LibXML2
FIND_PACKAGE(LibXml2 REQUIRED)
SET(SERVER_LIBRARIES ${SERVER_LIBRARIES} ${LIBXML2_LIBRARIES})
SET(SERVER_INCLUDE_DIRS ${SERVER_INCLUDE_DIRS} ${LIBXML2_INCLUDE_DIR})
# GMP
FIND_PACKAGE(GMP REQUIRED)
SET(SERVER_LIBRARIES ${SERVER_LIBRARIES} ${GMP_LIBRARY})
SET(SERVER_INCLUDE_DIRS ${SERVER_INCLUDE_DIRS} ${GMP_INCLUDE_DIR})
# Lua
IF(USE_LUAJIT)
FIND_PACKAGE(LuaJIT REQUIRED)
SET(SERVER_INCLUDE_DIRS ${SERVER_INCLUDE_DIRS} ${LUAJIT_INCLUDE_DIR})
SET(SERVER_LIBRARIES ${SERVER_LIBRARIES} ${LUAJIT_LIBRARY})
MESSAGE(STATUS "LuaJIT: ON")
ELSE()
FIND_PACKAGE(Lua51 REQUIRED)
SET(SERVER_INCLUDE_DIRS ${SERVER_INCLUDE_DIRS} ${LUA_INCLUDE_DIR})
SET(SERVER_LIBRARIES ${SERVER_LIBRARIES} ${LUA_LIBRARY})
MESSAGE(STATUS "LuaJIT: OFF")
ENDIF()
# SQLite, enabled by default
IF(USE_SQLITE)
FIND_PACKAGE(SQLite REQUIRED)
SET(SERVER_SOURCES ${SERVER_SOURCES} ${CMAKE_CURRENT_SOURCE_DIR}/src/database_driver_sqlite.cpp)
SET(SERVER_HEADERS ${SERVER_HEADERS} ${CMAKE_CURRENT_SOURCE_DIR}/src/database_driver_sqlite.h)
SET(SERVER_DEFINITIONS ${SERVER_DEFINITIONS} -D__USE_SQLITE__)
SET(SERVER_LIBRARIES ${SERVER_LIBRARIES} ${SQLITE_LIBRARY})
SET(SERVER_INCLUDE_DIRS ${SERVER_INCLUDE_DIRS} ${SQLITE_INCLUDE_DIR})
MESSAGE(STATUS "SQLite: ON")
ENDIF()
# MySQL
IF(USE_MYSQL)
FIND_PACKAGE(MySQL REQUIRED)
SET(SERVER_SOURCES ${SERVER_SOURCES} ${CMAKE_CURRENT_SOURCE_DIR}/src/database_driver_mysql.cpp)
SET(SERVER_HEADERS ${SERVER_HEADERS} ${CMAKE_CURRENT_SOURCE_DIR}/src/database_driver_mysql.h)
SET(SERVER_DEFINITIONS ${SERVER_DEFINITIONS} -D__USE_MYSQL__)
SET(SERVER_LIBRARIES ${SERVER_LIBRARIES} ${MYSQL_LIBRARY})
SET(SERVER_INCLUDE_DIRS ${SERVER_INCLUDE_DIRS} ${MYSQL_INCLUDE_DIR})
MESSAGE(STATUS "MySQL: ON")
ENDIF()
# PostgreSQL
IF(USE_POSTGRE)
FIND_PACKAGE(PostgreSQL REQUIRED)
SET(SERVER_SOURCES ${SERVER_SOURCES} ${CMAKE_CURRENT_SOURCE_DIR}/src/database_driver_pgsql.cpp)
SET(SERVER_HEADERS ${SERVER_HEADERS} ${CMAKE_CURRENT_SOURCE_DIR}/src/database_driver_pgsql.h)
SET(SERVER_DEFINITIONS ${SERVER_DEFINITIONS} -D__USE_PGSQL__)
SET(SERVER_LIBRARIES ${SERVER_LIBRARIES} ${POSTGRESQL_LIBRARY})
SET(SERVER_INCLUDE_DIRS ${SERVER_INCLUDE_DIRS} ${POSTGRESQL_INCLUDE_DIR})
MESSAGE(STATUS "PostgreSQL: ON")
ENDIF()
# ODBC
IF(USE_ODBC)
SET(SERVER_SOURCES ${SERVER_SOURCES} ${CMAKE_CURRENT_SOURCE_DIR}/src/database_driver_odbc.cpp)
SET(SERVER_HEADERS ${SERVER_HEADERS} ${CMAKE_CURRENT_SOURCE_DIR}/src/database_driver_odbc.h)
SET(SERVER_DEFINITIONS ${SERVER_DEFINITIONS} -D__USE_ODBC__)
SET(SERVER_LIBRARIES ${SERVER_LIBRARIES} ${ODBC_LIBRARY})
SET(SERVER_INCLUDE_DIRS ${SERVER_INCLUDE_DIRS} ${ODBC_INCLUDE_DIR})
MESSAGE(STATUS "ODBC: ON")
ENDIF()
IF(WIN32)
SET(SERVER_DEFINITIONS ${SERVER_DEFINITIONS}
-D__WINDOWS__
-DBOOST_ASIO_ENABLE_CANCELIO)
ELSE()
SET(SERVER_DEFINITIONS ${SERVER_DEFINITIONS} -D_THREAD_SAFE)
ENDIF()
IF(DEBUGGING)
SET(SERVER_DEFINITIONS ${SERVER_DEFINITIONS} -D__DEBUG__MOVESYS__ -D__DEBUG_HOUSES__ -D__DEBUG_MAILBOX__ -D__DEBUG_LUASCRIPTS__ -D__DEBUG_NET__)
MESSAGE(STATUS "Debugging: ON")
ENDIF()
IF(SKULLSYSTEM)
SET(SERVER_DEFINITIONS ${SERVER_DEFINITIONS} -D__SKULLSYSTEM__)
MESSAGE(STATUS "Skull System: ON")
ELSE()
MESSAGE(STATUS "Skull System: OFF")
ENDIF()
IF(OTALLOCATOR)
SET(SERVER_DEFINITIONS ${SERVER_DEFINITIONS} -D__OTSERV_ALLOCATOR__)
MESSAGE(STATUS "Custom Allocator: ON")
ENDIF()
# Sources
SET(SERVER_SOURCES ${SERVER_SOURCES}
${CMAKE_CURRENT_SOURCE_DIR}/src/actor.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/admin.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/allocator.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/ban.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/beds.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/chat.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/combat.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/condition.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/condition_attributes.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/configmanager.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/connection.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/const.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/container.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/creature.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/creature_manager.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/creature_type.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/cylinder.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/database_driver.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/depot.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/enums.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/exception.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/fileloader.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/game.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/house.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/housetile.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/http_request.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/ioaccount.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/iomapotbm.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/iomapserialize.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/ioplayer.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/item.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/item_attributes.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/items.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/logger.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/lua_manager.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/map.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/md5.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/networkmessage.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/otserv.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/outputmessage.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/party.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/player.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/position.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/protocol.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/protocolgame.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/protocollogin.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/protocolold.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/rsa.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/scheduler.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/script_environment.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/script_event.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/script_functions.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/script_listener.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/script_manager.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/server.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/sha1.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/spawn.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/status.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/tasks.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/teleport.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/thing.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/tile.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/tools.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/town.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/trashholder.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/vocation.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/waitlist.cpp
)
# Headers
SET(SERVER_HEADERS ${SERVER_HEADERS}
${CMAKE_CURRENT_SOURCE_DIR}/src/account.h
${CMAKE_CURRENT_SOURCE_DIR}/src/actor.h
${CMAKE_CURRENT_SOURCE_DIR}/src/admin.h
${CMAKE_CURRENT_SOURCE_DIR}/src/allocator.h
${CMAKE_CURRENT_SOURCE_DIR}/src/ban.h
${CMAKE_CURRENT_SOURCE_DIR}/src/beds.h
${CMAKE_CURRENT_SOURCE_DIR}/src/boost_common.h
${CMAKE_CURRENT_SOURCE_DIR}/src/chat.h
${CMAKE_CURRENT_SOURCE_DIR}/src/classes.h
${CMAKE_CURRENT_SOURCE_DIR}/src/combat.h
${CMAKE_CURRENT_SOURCE_DIR}/src/condition.h
${CMAKE_CURRENT_SOURCE_DIR}/src/condition_attributes.h
${CMAKE_CURRENT_SOURCE_DIR}/src/configmanager.h
${CMAKE_CURRENT_SOURCE_DIR}/src/connection.h
${CMAKE_CURRENT_SOURCE_DIR}/src/const.h
${CMAKE_CURRENT_SOURCE_DIR}/src/container.h
${CMAKE_CURRENT_SOURCE_DIR}/src/creature.h
${CMAKE_CURRENT_SOURCE_DIR}/src/creature_manager.h
${CMAKE_CURRENT_SOURCE_DIR}/src/creature_type.h
${CMAKE_CURRENT_SOURCE_DIR}/src/cylinder.h
${CMAKE_CURRENT_SOURCE_DIR}/src/database_driver.h
${CMAKE_CURRENT_SOURCE_DIR}/src/definitions.h # We need to get rid of this
${CMAKE_CURRENT_SOURCE_DIR}/src/depot.h
${CMAKE_CURRENT_SOURCE_DIR}/src/enum.h
${CMAKE_CURRENT_SOURCE_DIR}/src/enums.h
${CMAKE_CURRENT_SOURCE_DIR}/src/exception.h
${CMAKE_CURRENT_SOURCE_DIR}/src/fileloader.h
${CMAKE_CURRENT_SOURCE_DIR}/src/game.h
${CMAKE_CURRENT_SOURCE_DIR}/src/house.h
${CMAKE_CURRENT_SOURCE_DIR}/src/housetile.h
${CMAKE_CURRENT_SOURCE_DIR}/src/http_request.h
${CMAKE_CURRENT_SOURCE_DIR}/src/ioaccount.h
${CMAKE_CURRENT_SOURCE_DIR}/src/iomap.h
${CMAKE_CURRENT_SOURCE_DIR}/src/iomapotbm.h
${CMAKE_CURRENT_SOURCE_DIR}/src/iomapserialize.h
${CMAKE_CURRENT_SOURCE_DIR}/src/ioplayer.h
${CMAKE_CURRENT_SOURCE_DIR}/src/item.h
${CMAKE_CURRENT_SOURCE_DIR}/src/item_attributes.h
${CMAKE_CURRENT_SOURCE_DIR}/src/itemloader.h
${CMAKE_CURRENT_SOURCE_DIR}/src/items.h
${CMAKE_CURRENT_SOURCE_DIR}/src/logger.h
${CMAKE_CURRENT_SOURCE_DIR}/src/lua_manager.h
${CMAKE_CURRENT_SOURCE_DIR}/src/map.h
${CMAKE_CURRENT_SOURCE_DIR}/src/md5.h
${CMAKE_CURRENT_SOURCE_DIR}/src/networkmessage.h
${CMAKE_CURRENT_SOURCE_DIR}/src/otsystem.h
${CMAKE_CURRENT_SOURCE_DIR}/src/outfit.h
${CMAKE_CURRENT_SOURCE_DIR}/src/outputmessage.h
${CMAKE_CURRENT_SOURCE_DIR}/src/party.h
${CMAKE_CURRENT_SOURCE_DIR}/src/player.h
${CMAKE_CURRENT_SOURCE_DIR}/src/position.h
${CMAKE_CURRENT_SOURCE_DIR}/src/protocol.h
${CMAKE_CURRENT_SOURCE_DIR}/src/protocolconst.h
${CMAKE_CURRENT_SOURCE_DIR}/src/protocolgame.h
${CMAKE_CURRENT_SOURCE_DIR}/src/protocollogin.h
${CMAKE_CURRENT_SOURCE_DIR}/src/protocolold.h
${CMAKE_CURRENT_SOURCE_DIR}/src/rsa.h
${CMAKE_CURRENT_SOURCE_DIR}/src/scheduler.h
${CMAKE_CURRENT_SOURCE_DIR}/src/script_environment.h
${CMAKE_CURRENT_SOURCE_DIR}/src/script_event.h
${CMAKE_CURRENT_SOURCE_DIR}/src/script_listener.h
${CMAKE_CURRENT_SOURCE_DIR}/src/script_manager.h
${CMAKE_CURRENT_SOURCE_DIR}/src/server.h
${CMAKE_CURRENT_SOURCE_DIR}/src/sha1.h
${CMAKE_CURRENT_SOURCE_DIR}/src/shared_ptr.h
${CMAKE_CURRENT_SOURCE_DIR}/src/singleton.h
${CMAKE_CURRENT_SOURCE_DIR}/src/spawn.h
${CMAKE_CURRENT_SOURCE_DIR}/src/status.h
${CMAKE_CURRENT_SOURCE_DIR}/src/tasks.h
${CMAKE_CURRENT_SOURCE_DIR}/src/teleport.h
${CMAKE_CURRENT_SOURCE_DIR}/src/templates.h
${CMAKE_CURRENT_SOURCE_DIR}/src/thing.h
${CMAKE_CURRENT_SOURCE_DIR}/src/tile.h
${CMAKE_CURRENT_SOURCE_DIR}/src/tools.h
${CMAKE_CURRENT_SOURCE_DIR}/src/town.h
${CMAKE_CURRENT_SOURCE_DIR}/src/trashholder.h
${CMAKE_CURRENT_SOURCE_DIR}/src/vocation.h
${CMAKE_CURRENT_SOURCE_DIR}/src/waitlist.h
${CMAKE_CURRENT_SOURCE_DIR}/src/waypoints.h
)
INCLUDE_DIRECTORIES(${SERVER_INCLUDE_DIRS})
LINK_DIRECTORIES(${SERVER_LIBRARY_DIRS})
ADD_DEFINITIONS(${SERVER_DEFINITIONS})
ADD_EXECUTABLE(${PROJECT_NAME} ${SERVER_SOURCES} ${SERVER_HEADERS})
TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${SERVER_LIBRARIES})
IF(USE_PCH)
INCLUDE(cotire)
cotire(${PROJECT_NAME})
MESSAGE(STATUS "Use precompiled header: ON")
ELSE()
MESSAGE(STATUS "Use precompiled header: OFF")
ENDIF()
ENABLE_TESTING()
ADD_TEST(help_test otserv --help )
ADD_TEST(version_test otserv --version )
SET_TESTS_PROPERTIES(version_test PROPERTIES PASS_REGULAR_EXPRESSION "^OTServ ${VERSION}")
ADD_TEST(badoption_test otserv --somenonexistentoption )
SET_TESTS_PROPERTIES(badoption_test PROPERTIES WILL_FAIL true)