forked from angband/angband
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
238 lines (211 loc) · 6.01 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
CMAKE_MINIMUM_REQUIRED(VERSION 3.5 FATAL_ERROR)
PROJECT(Angband VERSION 4.2.1 LANGUAGES C)
IF (CMAKE_SYSTEM_NAME STREQUAL "Windows")
MESSAGE(FATAL_ERROR "Not support to CMake in Windows")
ENDIF()
OPTION(SUPPORT_NCURSES_FRONTEND "Support to NCurses Frontend." OFF)
OPTION(SUPPORT_SDL_FRONTEND "Support to SDL Frontend." OFF)
OPTION(SUPPORT_X11_FRONTEND "Support to X11 Frontend." ON)
OPTION(SUPPORT_SDL_SOUND "Support to Sound System with SDL." OFF)
OPTION(SUPPORT_SPOIL_FRONTEND "Support for Spoiler Generation." ON)
# For default, X11 is the frontend, if the user want specific
# a new frontend is needed set to false (OFF) the frontend X11
IF (SUPPORT_NCURSES_FRONTEND OR SUPPORT_SDL_FRONTEND)
SET(SUPPORT_X11_FRONTEND OFF)
ENDIF()
IF (NOT SUPPORT_SDL_FRONTEND)
SET(SUPPORT_SDL_SOUND OFF)
ENDIF()
ADD_EXECUTABLE(Angband
src/buildid.c
src/cave-map.c
src/cave-square.c
src/cave-view.c
src/cave.c
src/cmd-cave.c
src/cmd-core.c
src/cmd-misc.c
src/cmd-obj.c
src/cmd-pickup.c
src/cmd-spoil.c
src/cmd-wizard.c
src/datafile.c
src/debug.c
src/effects.c
src/effects-info.c
src/game-event.c
src/game-input.c
src/game-world.c
src/gen-cave.c
src/gen-chunk.c
src/gen-monster.c
src/gen-room.c
src/gen-util.c
src/generate.c
src/grafmode.c
src/guid.c
src/init.c
src/load.c
# src/main-cocoa.m
$<$<BOOL:${SUPPORT_NCURSES_FRONTEND}>:src/main-gcu.c>
# src/main-nds.c
$<$<BOOL:${SUPPORT_SDL_FRONTEND}>:src/main-sdl.c>
# src/main-sdl2.c
$<$<BOOL:${SUPPORT_SPOIL_FRONTEND}>:src/main-spoil.c>
# src/main-stats.c
# src/main-test.c
# src/main-win.c
$<$<BOOL:${SUPPORT_X11_FRONTEND}>:src/main-x11.c>
# src/main-xxx.c
src/main.c
src/message.c
src/mon-attack.c
src/mon-blows.c
src/mon-desc.c
src/mon-group.c
src/mon-init.c
src/mon-list.c
src/mon-lore.c
src/mon-make.c
src/mon-move.c
src/mon-msg.c
src/mon-predicate.c
src/mon-spell.c
src/mon-summon.c
src/mon-timed.c
src/mon-util.c
src/obj-chest.c
src/obj-curse.c
src/obj-desc.c
src/obj-gear.c
src/obj-ignore.c
src/obj-info.c
src/obj-init.c
src/obj-knowledge.c
src/obj-list.c
src/obj-make.c
src/obj-pile.c
src/obj-power.c
src/obj-properties.c
src/obj-randart.c
src/obj-slays.c
src/obj-tval.c
src/obj-util.c
src/option.c
src/parser.c
src/player-attack.c
src/player-birth.c
src/player-calcs.c
src/player-class.c
src/player-history.c
src/player-path.c
src/player-properties.c
src/player-quest.c
src/player-race.c
src/player-spell.c
src/player-timed.c
src/player-util.c
src/player.c
src/project-feat.c
src/project-mon.c
src/project-obj.c
src/project-player.c
src/project.c
src/randname.c
src/save.c
src/save-charoutput.c
src/savefile.c
src/score.c
$<$<BOOL:${SUPPORT_SDL_SOUND}>:src/snd-sdl.c>
src/sound-core.c
src/source.c
src/store.c
src/target.c
src/trap.c
src/ui-birth.c
src/ui-command.c
src/ui-context.c
src/ui-curse.c
src/ui-death.c
src/ui-display.c
src/ui-entry-combiner.c
src/ui-entry-renderers.c
src/ui-entry.c
src/ui-equip-cmp.c
src/ui-event.c
src/ui-game.c
src/ui-help.c
src/ui-history.c
src/ui-init.c
src/ui-input.c
src/ui-keymap.c
src/ui-knowledge.c
src/ui-map.c
src/ui-menu.c
src/ui-mon-list.c
src/ui-mon-lore.c
src/ui-obj-list.c
src/ui-object.c
src/ui-options.c
src/ui-output.c
src/ui-player.c
src/ui-prefs.c
src/ui-score.c
src/ui-signals.c
src/ui-spell.c
src/ui-spoil.c
src/ui-store.c
src/ui-target.c
src/ui-term.c
src/ui-visuals.c
src/ui-wizard.c
src/wiz-debug.c
src/wiz-spoil.c
src/wiz-stats.c
src/z-bitflag.c
src/z-color.c
src/z-dice.c
src/z-expression.c
src/z-file.c
src/z-form.c
src/z-quark.c
src/z-queue.c
src/z-rand.c
src/z-set.c
src/z-textblock.c
src/z-type.c
src/z-util.c
src/z-virt.c
)
SET_TARGET_PROPERTIES(Angband PROPERTIES C_STANDARD 99)
IF (SUPPORT_X11_FRONTEND)
INCLUDE(src/cmake/macros/X11_Frontend.cmake)
CONFIGURE_X11_FRONTEND(Angband)
ELSEIF(SUPPORT_NCURSES_FRONTEND)
INCLUDE(src/cmake/macros/CURSES_Frontend.cmake)
CONFIGURE_CURSES_FRONTEND(Angband)
ELSEIF(SUPPORT_SDL_FRONTEND)
INCLUDE(src/cmake/macros/SDL_Frontend.cmake)
CONFIGURE_SDL_FRONTEND(Angband)
IF (SUPPORT_SDL_SOUND)
INCLUDE(src/cmake/macros/SDL_Sound.cmake)
CONFIGURE_SDL_SOUND(Angband)
ENDIF()
ENDIF()
IF (SUPPORT_SPOIL_FRONTEND)
INCLUDE(src/cmake/macros/SPOIL_Frontend.cmake)
CONFIGURE_SPOIL_FRONTEND(Angband)
ENDIF()
#[[
For Linux Systems the compilation without the libm library
throw undefined references to mathematical functions, this requirement
is only present in Linux Systems.
Wikipedia say: Under Linux and BSD, the mathematical functions
(as declared in <math.h>) are bundled separately in the mathematical
library libm. Therefore, if any of those functions are used, the linker
must be given the directive -lm.
Ref: https://en.wikipedia.org/wiki/C_mathematical_functions#libm
]]
TARGET_LINK_LIBRARIES(Angband PRIVATE $<$<PLATFORM_ID:Linux>:m>)
MESSAGE(STATUS "Moving files needed")
FILE(COPY ${CMAKE_CURRENT_SOURCE_DIR}/lib DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/)