forked from conan513/mangosbot-bots
-
Notifications
You must be signed in to change notification settings - Fork 41
/
CMakeLists.txt
275 lines (242 loc) · 11.5 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
#
# Copyright (C) 2005-2018 MaNGOS project <http://getmangos.com/>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
set(LIBRARY_NAME Bots)
#Add PCH Files
set(bots_PCH "${CMAKE_CURRENT_SOURCE_DIR}/botpch.h")
if(PCH)
LIST(APPEND bots_PCH "${CMAKE_CURRENT_SOURCE_DIR}/botpch.cpp")
endif()
#Base files
file(GLOB Playerbot_Source ${CMAKE_CURRENT_SOURCE_DIR}/playerbot/*.cpp ${CMAKE_CURRENT_SOURCE_DIR}/playerbot/*.h)
source_group("Player Bot" FILES ${Playerbot_Source})
file(GLOB AHbot_Source ${CMAKE_CURRENT_SOURCE_DIR}/ahbot/*.cpp ${CMAKE_CURRENT_SOURCE_DIR}/ahbot/*.h)
source_group("AH Bot" FILES ${AHbot_Source})
#Define base source library
set(LIBRARY_SRCS
${Playerbot_Source}
${AHbot_Source}
${bots_PCH}
)
#Strategy files
file(GLOB Playerbot_Strategy ${CMAKE_CURRENT_SOURCE_DIR}/playerbot/strategy/*.cpp ${CMAKE_CURRENT_SOURCE_DIR}/playerbot/strategy/*.h)
source_group("Player Bot\\Strategies" FILES ${Playerbot_Strategy})
LIST(APPEND LIBRARY_SRCS ${Playerbot_Strategy})
#Action files
file(GLOB Playerbot_Actions ${CMAKE_CURRENT_SOURCE_DIR}/playerbot/strategy/actions/*.cpp ${CMAKE_CURRENT_SOURCE_DIR}/playerbot/strategy/actions/*.h)
source_group("Player Bot\\Strategies\\Actions" FILES ${Playerbot_Actions})
LIST(APPEND LIBRARY_SRCS ${Playerbot_Actions})
#Generic files
file(GLOB Playerbot_Generic ${CMAKE_CURRENT_SOURCE_DIR}/playerbot/strategy/generic/*.cpp ${CMAKE_CURRENT_SOURCE_DIR}/playerbot/strategy/generic/*.h)
source_group("Player Bot\\Strategies\\Generic" FILES ${Playerbot_Generic})
LIST(APPEND LIBRARY_SRCS ${Playerbot_Generic})
#Trigger files
file(GLOB Playerbot_Triggers ${CMAKE_CURRENT_SOURCE_DIR}/playerbot/strategy/triggers/*.cpp ${CMAKE_CURRENT_SOURCE_DIR}/playerbot/strategy/triggers/*.h)
source_group("Player Bot\\Strategies\\Triggers" FILES ${Playerbot_Triggers})
LIST(APPEND LIBRARY_SRCS ${Playerbot_Triggers})
#Value files
file(GLOB Playerbot_Values ${CMAKE_CURRENT_SOURCE_DIR}/playerbot/strategy/values/*.cpp ${CMAKE_CURRENT_SOURCE_DIR}/playerbot/strategy/values/*.h)
source_group("Player Bot\\Strategies\\Values" FILES ${Playerbot_Values})
LIST(APPEND LIBRARY_SRCS ${Playerbot_Values})
## Class files
#Druid AI
file(GLOB Playerbot_Druid ${CMAKE_CURRENT_SOURCE_DIR}/playerbot/strategy/druid/*.cpp ${CMAKE_CURRENT_SOURCE_DIR}/playerbot/strategy/druid/*.h)
source_group("Player Bot\\Strategies\\Druid" FILES ${Playerbot_Druid})
LIST(APPEND LIBRARY_SRCS ${Playerbot_Druid})
#Hunter AI
file(GLOB Playerbot_Hunter ${CMAKE_CURRENT_SOURCE_DIR}/playerbot/strategy/hunter/*.cpp ${CMAKE_CURRENT_SOURCE_DIR}/playerbot/strategy/hunter/*.h)
source_group("Player Bot\\Strategies\\Hunter" FILES ${Playerbot_Hunter})
LIST(APPEND LIBRARY_SRCS ${Playerbot_Hunter})
#Mage AI
file(GLOB Playerbot_Mage ${CMAKE_CURRENT_SOURCE_DIR}/playerbot/strategy/mage/*.cpp ${CMAKE_CURRENT_SOURCE_DIR}/playerbot/strategy/mage/*.h)
source_group("Player Bot\\Strategies\\Mage" FILES ${Playerbot_Mage})
LIST(APPEND LIBRARY_SRCS ${Playerbot_Mage})
#Paladin AI
file(GLOB Playerbot_Paladin ${CMAKE_CURRENT_SOURCE_DIR}/playerbot/strategy/paladin/*.cpp ${CMAKE_CURRENT_SOURCE_DIR}/playerbot/strategy/paladin/*.h)
source_group("Player Bot\\Strategies\\Paladin" FILES ${Playerbot_Paladin})
LIST(APPEND LIBRARY_SRCS ${Playerbot_Paladin})
#Priest AI
file(GLOB Playerbot_Priest ${CMAKE_CURRENT_SOURCE_DIR}/playerbot/strategy/priest/*.cpp ${CMAKE_CURRENT_SOURCE_DIR}/playerbot/strategy/priest/*.h)
source_group("Player Bot\\Strategies\\Priest" FILES ${Playerbot_Priest})
LIST(APPEND LIBRARY_SRCS ${Playerbot_Priest})
#Rogue AI
file(GLOB Playerbot_Rogue ${CMAKE_CURRENT_SOURCE_DIR}/playerbot/strategy/rogue/*.cpp ${CMAKE_CURRENT_SOURCE_DIR}/playerbot/strategy/rogue/*.h)
source_group("Player Bot\\Strategies\\Rogue" FILES ${Playerbot_Rogue})
LIST(APPEND LIBRARY_SRCS ${Playerbot_Rogue})
#Shaman AI
file(GLOB Playerbot_Shaman ${CMAKE_CURRENT_SOURCE_DIR}/playerbot/strategy/shaman/*.cpp ${CMAKE_CURRENT_SOURCE_DIR}/playerbot/strategy/shaman/*.h)
source_group("Player Bot\\Strategies\\Shaman" FILES ${Playerbot_Shaman})
LIST(APPEND LIBRARY_SRCS ${Playerbot_Shaman})
#Warlock AI
file(GLOB Playerbot_Warlock ${CMAKE_CURRENT_SOURCE_DIR}/playerbot/strategy/warlock/*.cpp ${CMAKE_CURRENT_SOURCE_DIR}/playerbot/strategy/warlock/*.h)
source_group("Player Bot\\Strategies\\Warlock" FILES ${Playerbot_Warlock})
LIST(APPEND LIBRARY_SRCS ${Playerbot_Warlock})
#Warrior AI
file(GLOB Playerbot_Warrior ${CMAKE_CURRENT_SOURCE_DIR}/playerbot/strategy/warrior/*.cpp ${CMAKE_CURRENT_SOURCE_DIR}/playerbot/strategy/warrior/*.h)
source_group("Player Bot\\Strategies\\Warrior" FILES ${Playerbot_Warrior})
LIST(APPEND LIBRARY_SRCS ${Playerbot_Warrior})
#Deathknight AI
file(GLOB Playerbot_DeathKnight ${CMAKE_CURRENT_SOURCE_DIR}/playerbot/strategy/deathknight/*.cpp ${CMAKE_CURRENT_SOURCE_DIR}/playerbot/strategy/deathknight/*.h)
source_group("Player Bot\\Strategies\\DeathKnight" FILES ${Playerbot_DeathKnight})
LIST(APPEND LIBRARY_SRCS ${Playerbot_DeathKnight})
# Define ENABLE_PLAYERBOTS if need
if (BUILD_PLAYERBOT OR PLAYERBOTS OR BUILD_IKE3_BOTS OR BUILD_PLAYERBOTS)
add_definitions(-DENABLE_PLAYERBOTS)
# TO DO: Used by AhBot.cpp, remove it after cmangos merge is done
if (BUILD_PLAYERBOTS)
add_definitions(-DENABLE_MANGOSBOTS)
endif()
endif()
# Define BUILD_ELUNA if need
if (BUILD_ELUNA)
add_definitions(-DBUILD_ELUNA -DCLASSIC -DCMANGOS)
endif()
# Define Core
if ( ${CMAKE_PROJECT_NAME} MATCHES "CMaNGOS")
add_definitions(-DCMANGOS)
else()
if ( ${CMAKE_PROJECT_NAME} MATCHES "MaNGOS")
add_definitions(-DMANGOS)
endif()
endif()
# Define Expansion
if ( ${CMAKE_PROJECT_NAME} MATCHES "Classic")
add_definitions(-DMANGOSBOT_ZERO)
endif()
if ( ${CMAKE_PROJECT_NAME} MATCHES "TBC")
add_definitions(-DMANGOSBOT_ONE)
endif()
if ( ${CMAKE_PROJECT_NAME} MATCHES "WoTLK")
add_definitions(-DMANGOSBOT_TWO)
endif()
# Define ENABLE_MODULES if need
if (BUILD_MODULES)
add_definitions(-DENABLE_MODULES)
endif()
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/ahbot
${CMAKE_CURRENT_SOURCE_DIR}/playerbot
${CMAKE_SOURCE_DIR}/src/game
${CMAKE_SOURCE_DIR}/src/game/Achievements
${CMAKE_SOURCE_DIR}/src/game/AI
${CMAKE_SOURCE_DIR}/src/game/AI/BaseAI
${CMAKE_SOURCE_DIR}/src/game/AI/EventAI
${CMAKE_SOURCE_DIR}/src/game/Accounts
${CMAKE_SOURCE_DIR}/src/game/Addons
${CMAKE_SOURCE_DIR}/src/game/Arena
${CMAKE_SOURCE_DIR}/src/game/AuctionHouse
${CMAKE_SOURCE_DIR}/src/game/BattleGround
${CMAKE_SOURCE_DIR}/src/game/Chat
${CMAKE_SOURCE_DIR}/src/game/ChatCommands
${CMAKE_SOURCE_DIR}/src/game/Combat
${CMAKE_SOURCE_DIR}/src/game/DBScripts
${CMAKE_SOURCE_DIR}/src/game/Entities
${CMAKE_SOURCE_DIR}/src/game/GMTickets
${CMAKE_SOURCE_DIR}/src/game/GameEvents
${CMAKE_SOURCE_DIR}/src/game/Globals
${CMAKE_SOURCE_DIR}/src/game/Grids
${CMAKE_SOURCE_DIR}/src/game/Groups
${CMAKE_SOURCE_DIR}/src/game/Guilds
${CMAKE_SOURCE_DIR}/src/game/LFG
${CMAKE_SOURCE_DIR}/src/game/Loot
${CMAKE_SOURCE_DIR}/src/game/Mails
${CMAKE_SOURCE_DIR}/src/game/Maps
${CMAKE_SOURCE_DIR}/src/game/MotionGenerators
${CMAKE_SOURCE_DIR}/src/game/Movement
${CMAKE_SOURCE_DIR}/src/game/Object
${CMAKE_SOURCE_DIR}/src/game/OutdoorPvP
${CMAKE_SOURCE_DIR}/src/game/Pools
${CMAKE_SOURCE_DIR}/src/game/Quests
${CMAKE_SOURCE_DIR}/src/game/References
${CMAKE_SOURCE_DIR}/src/game/Reputation
${CMAKE_SOURCE_DIR}/src/game/Server
${CMAKE_SOURCE_DIR}/src/game/Server
${CMAKE_SOURCE_DIR}/src/game/Skills
${CMAKE_SOURCE_DIR}/src/game/Social
${CMAKE_SOURCE_DIR}/src/game/Spells
${CMAKE_SOURCE_DIR}/src/game/Tools
${CMAKE_SOURCE_DIR}/src/game/Trade
${CMAKE_SOURCE_DIR}/src/game/VoiceChat
${CMAKE_SOURCE_DIR}/src/game/Warden
${CMAKE_SOURCE_DIR}/src/game/Weather
${CMAKE_SOURCE_DIR}/src/game/World
${CMAKE_SOURCE_DIR}/src/game/WorldHandlers
${CMAKE_SOURCE_DIR}/src/game/Movement
${CMAKE_SOURCE_DIR}/src/game/Vmap
${CMAKE_SOURCE_DIR}/src/shared
${CMAKE_SOURCE_DIR}/src/shared/Auth
${CMAKE_SOURCE_DIR}/src/shared/Config
${CMAKE_SOURCE_DIR}/src/shared/Common
${CMAKE_SOURCE_DIR}/src/shared/Database
${CMAKE_SOURCE_DIR}/src/shared/DataStores
${CMAKE_SOURCE_DIR}/src/shared/Network
${CMAKE_SOURCE_DIR}/src/shared/Log
${CMAKE_SOURCE_DIR}/src/shared/Threading
${CMAKE_SOURCE_DIR}/src/shared/Utilities
${CMAKE_SOURCE_DIR}/src/framework
${CMAKE_SOURCE_DIR}/src/framework/Platform
${CMAKE_SOURCE_DIR}/dep/g3dlite
${CMAKE_SOURCE_DIR}/dep/include/g3dlite
${CMAKE_BINARY_DIR}
${CMAKE_BINARY_DIR}/src/shared
${CMAKE_SOURCE_DIR}/src/modules/Immersive
${MYSQL_INCLUDE_DIR}
${ACE_INCLUDE_DIR}
${Boost_INCLUDE_DIRS}
${CMAKE_SOURCE_DIR}/dep/lualib
)
if(PCH)
include_directories(${CMAKE_CURRENT_BINARY_DIR})
endif()
add_library(${LIBRARY_NAME} STATIC ${LIBRARY_SRCS})
target_link_libraries(${LIBRARY_NAME} shared Detour)
if(UNIX)
# Both systems don't have libdl and don't need them
if (NOT (CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" OR CMAKE_SYSTEM_NAME STREQUAL "NetBSD"))
target_link_libraries(${LIBRARY_NAME} dl)
endif()
endif()
# Install config files
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/playerbot/aiplayerbot.conf.dist.in ${CMAKE_CURRENT_BINARY_DIR}/aiplayerbot.conf.dist)
if (NOT CONF_INSTALL_DIR)
set(CONF_INSTALL_DIR ${CONF_DIR})
endif()
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/aiplayerbot.conf.dist DESTINATION ${CONF_INSTALL_DIR})
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/ahbot/ahbot.conf.dist.in ${CMAKE_CURRENT_BINARY_DIR}/ahbot.conf.dist)
if (NOT CONF_INSTALL_DIR)
set(CONF_INSTALL_DIR ${CONF_DIR})
endif()
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/ahbot.conf.dist DESTINATION ${CONF_INSTALL_DIR})
# Generate PCH
if(PCH)
if (ADD_CXX_PCH)
ADD_CXX_PCH(Bots ${bots_PCH})
elseif (MSVC)
set(PCHBaseName "pchdef")
set(PrecompiledBinary "${CMAKE_CURRENT_SOURCE_DIR}/botpch.pch")
set(PrecompiledHeader "${CMAKE_CURRENT_SOURCE_DIR}/botpch.h")
set(PrecompiledSource "${CMAKE_CURRENT_SOURCE_DIR}/botpch.cpp")
set_target_properties(${LIBRARY_NAME} PROPERTIES COMPILE_FLAGS " /Yu\"${PrecompiledHeader}\" /FI\"${PrecompiledHeader}\" /Fp\"${PrecompiledBinary}\" /bigobj")
set_source_files_properties(${PrecompiledSource} PROPERTIES COMPILE_FLAGS "/Yc\"${PrecompiledHeader}\" /Fp\"${PrecompiledBinary}\"")
set_target_properties(${LIBRARY_NAME} PROPERTIES PROJECT_LABEL "Bots")
elseif(NOT MINGW)
# TODO: Resolve issues with order of includes before enabling Cotire for MinGW builds
cotire(${LIBRARY_NAME})
endif()
include_directories(${CMAKE_CURRENT_BINARY_DIR})
endif()