summaryrefslogtreecommitdiff
path: root/src/CMakeLists.txt
blob: c7e3d936bc0e0b6574b9a8ecde61c82a73550acc (plain) (blame)
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
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
FIND_PACKAGE(SDL REQUIRED)
FIND_PACKAGE(SDL_image REQUIRED)
FIND_PACKAGE(SDL_mixer REQUIRED)
FIND_PACKAGE(SDL_net REQUIRED)
FIND_PACKAGE(CURL REQUIRED)
FIND_PACKAGE(LibXml2 REQUIRED)
FIND_PACKAGE(PhysFS REQUIRED)
FIND_PACKAGE(PNG REQUIRED)

SET(FLAGS "-DPACKAGE_VERSION=\\\"${VERSION}\\\"")
SET(FLAGS "${FLAGS} -DTMW_DATADIR=\\\"${PKG_DATADIR}/\\\"")

SET(GUICHAN_COMPONENTS "SDL")
IF (WITH_OPENGL)
    SET(GUICHAN_COMPONENTS ${GUICHAN_COMPONENTS} "OpenGL")
ENDIF (WITH_OPENGL)
FIND_PACKAGE(Guichan REQUIRED ${GUICHAN_COMPONENTS})

IF (WITH_OPENGL)
    FIND_PACKAGE(OpenGL REQUIRED)
    INCLUDE_DIRECTORIES(${OPENGL_INCLUDE_DIR})
    SET(FLAGS "${FLAGS} -DUSE_OPENGL")
ENDIF (WITH_OPENGL)

INCLUDE_DIRECTORIES(
    ${CURRENT_SOURCE_DIR}
    ${SDL_INCLUDE_DIR}
    ${SDLIMAGE_INCLUDE_DIR}
    ${SDLMIXER_INCLUDE_DIR}
    ${SDLNET_INCLUDE_DIR}
    ${PNG_INCLUDE_DIR}
    ${PHYSFS_INCLUDE_DIR}
    ${CURL_INCLUDE_DIR}
    ${LIBXML2_INCLUDE_DIR}
    ${GUICHAN_INCLUDE_DIR}
    )

# Fix some stuff that gets not hidden by mainline modules
MARK_AS_ADVANCED(PHYSFS_INCLUDE_DIR)
MARK_AS_ADVANCED(PHYSFS_LIBRARY)
MARK_AS_ADVANCED(SDLIMAGE_INCLUDE_DIR)
MARK_AS_ADVANCED(SDLIMAGE_LIBRARY)
MARK_AS_ADVANCED(SDLMAIN_LIBRARY)
MARK_AS_ADVANCED(SDLMIXER_INCLUDE_DIR)
MARK_AS_ADVANCED(SDLMIXER_LIBRARY)
MARK_AS_ADVANCED(SDLNET_INCLUDE_DIR)
MARK_AS_ADVANCED(SDLNET_LIBRARY)
MARK_AS_ADVANCED(SDL_INCLUDE_DIR)
MARK_AS_ADVANCED(SDL_LIBRARY)

SET(SRCS
    gui/widgets/dropdown.cpp
    gui/widgets/dropdown.h
    gui/widgets/resizegrip.cpp
    gui/widgets/resizegrip.h
    gui/widgets/layout.cpp
    gui/widgets/layout.h
    gui/widgets/layouthelper.cpp
    gui/widgets/layouthelper.h
    gui/widgets/tab.cpp
    gui/widgets/tab.h
    gui/widgets/tabbedarea.cpp
    gui/widgets/tabbedarea.h
    gui/browserbox.cpp
    gui/browserbox.h
    gui/buddywindow.cpp
    gui/buddywindow.h
    gui/button.cpp
    gui/button.h
    gui/buy.cpp
    gui/buy.h
    gui/buysell.cpp
    gui/buysell.h
    gui/char_server.cpp
    gui/char_server.h
    gui/char_select.cpp
    gui/char_select.h
    gui/chat.cpp
    gui/chat.h
    gui/chatinput.cpp
    gui/chatinput.h
    gui/checkbox.cpp
    gui/checkbox.h
    gui/color.cpp
    gui/color.h
    gui/confirm_dialog.cpp
    gui/confirm_dialog.h
    gui/connection.cpp
    gui/connection.h
    gui/debugwindow.cpp
    gui/debugwindow.h
    gui/emotecontainer.cpp
    gui/emotecontainer.h
    gui/emoteshortcutcontainer.cpp
    gui/emoteshortcutcontainer.h
    gui/emotewindow.cpp
    gui/emotewindow.h
    gui/equipmentwindow.cpp
    gui/equipmentwindow.h
    gui/focushandler.cpp
    gui/focushandler.h
    gui/gccontainer.cpp
    gui/gccontainer.h
    gui/gui.cpp
    gui/gui.h
    gui/help.cpp
    gui/help.h
    gui/inttextfield.cpp
    gui/inttextfield.h
    gui/inventorywindow.cpp
    gui/inventorywindow.h
    gui/itemcontainer.cpp
    gui/itemcontainer.h
    gui/itemlinkhandler.cpp
    gui/itemlinkhandler.h
    gui/itempopup.cpp
    gui/itempopup.h
    gui/itemshortcutcontainer.cpp
    gui/itemshortcutcontainer.h\
    gui/item_amount.cpp
    gui/item_amount.h
    gui/linkhandler.h
    gui/listbox.cpp
    gui/listbox.h
    gui/login.cpp
    gui/login.h
    gui/menuwindow.cpp
    gui/menuwindow.h
    gui/minimap.cpp
    gui/minimap.h
    gui/ministatus.cpp
    gui/ministatus.h
    gui/npcintegerdialog.cpp
    gui/npcintegerdialog.h
    gui/npclistdialog.cpp
    gui/npclistdialog.h
    gui/npcstringdialog.cpp
    gui/npcstringdialog.h
    gui/npc_text.cpp
    gui/npc_text.h
    gui/ok_dialog.cpp
    gui/ok_dialog.h
    gui/passwordfield.cpp
    gui/passwordfield.h
    gui/playerbox.cpp
    gui/playerbox.h
    gui/popupmenu.cpp
    gui/popupmenu.h
    gui/progressbar.cpp
    gui/progressbar.h
    gui/radiobutton.cpp
    gui/radiobutton.h
    gui/recorder.cpp
    gui/recorder.h
    gui/register.cpp
    gui/register.h
    gui/scrollarea.cpp
    gui/scrollarea.h
    gui/sdlinput.cpp
    gui/sdlinput.h
    gui/sell.cpp
    gui/sell.h
    gui/setup.cpp
    gui/setup.h
    gui/setup_audio.cpp
    gui/setup_audio.h
    gui/setup_colors.cpp
    gui/setup_colors.h
    gui/setup_joystick.cpp
    gui/setup_joystick.h
    gui/setup_keyboard.cpp
    gui/setup_keyboard.h
    gui/setup_players.cpp
    gui/setup_players.h
    gui/setuptab.h
    gui/setup_video.cpp
    gui/setup_video.h
    gui/shop.cpp
    gui/shop.h
    gui/shoplistbox.cpp
    gui/shoplistbox.h
    gui/shortcutwindow.cpp
    gui/shortcutwindow.h
    gui/shortcutcontainer.cpp
    gui/shortcutcontainer.h
    gui/skill.cpp
    gui/skill.h
    gui/slider.cpp
    gui/slider.h
    gui/speechbubble.cpp
    gui/speechbubble.h
    gui/status.cpp
    gui/status.h
    gui/table.cpp
    gui/table.h
    gui/table_model.cpp
    gui/table_model.h
    gui/textbox.cpp
    gui/textbox.h
    gui/textfield.cpp
    gui/textfield.h
    gui/trade.cpp
    gui/trade.h
    gui/truetypefont.cpp
    gui/truetypefont.h
    gui/updatewindow.h
    gui/updatewindow.cpp
    gui/viewport.cpp
    gui/viewport.h
    gui/window.cpp
    gui/window.h
    gui/windowcontainer.cpp
    gui/windowcontainer.h
    net/beinghandler.h
    net/beinghandler.cpp
    net/buysellhandler.h
    net/buysellhandler.cpp
    net/charserverhandler.h
    net/charserverhandler.cpp
    net/chathandler.h
    net/chathandler.cpp
    net/equipmenthandler.h
    net/equipmenthandler.cpp
    net/inventoryhandler.h
    net/inventoryhandler.cpp
    net/itemhandler.h
    net/itemhandler.cpp
    net/loginhandler.h
    net/loginhandler.cpp
    net/maploginhandler.cpp
    net/maploginhandler.h
    net/messagehandler.cpp
    net/messagehandler.h
    net/messagein.cpp
    net/messagein.h
    net/messageout.cpp
    net/messageout.h
    net/network.cpp
    net/network.h
    net/npchandler.cpp
    net/npchandler.h
    net/partyhandler.cpp
    net/partyhandler.h
    net/playerhandler.cpp
    net/playerhandler.h
    net/protocol.cpp
    net/protocol.h
    net/skillhandler.cpp
    net/skillhandler.h
    net/tradehandler.cpp
    net/tradehandler.h
    resources/action.cpp
    resources/action.h
    resources/ambientoverlay.cpp
    resources/ambientoverlay.h
    resources/animation.cpp
    resources/animation.h
    resources/buddylist.cpp
    resources/buddylist.h
    resources/colordb.cpp
    resources/colordb.h
    resources/dye.cpp
    resources/dye.h
    resources/emotedb.cpp
    resources/emotedb.h
    resources/image.cpp
    resources/image.h
    resources/imageloader.cpp
    resources/imageloader.h
    resources/imageset.h
    resources/imageset.cpp
    resources/imagewriter.cpp
    resources/imagewriter.h
    resources/itemdb.cpp
    resources/itemdb.h
    resources/iteminfo.cpp
    resources/iteminfo.h
    resources/mapreader.cpp
    resources/mapreader.h
    resources/monsterdb.cpp
    resources/monsterdb.h
    resources/monsterinfo.cpp
    resources/monsterinfo.h
    resources/music.cpp
    resources/music.h
    resources/npcdb.cpp
    resources/npcdb.h
    resources/resource.cpp
    resources/resource.h
    resources/resourcemanager.cpp
    resources/resourcemanager.h
    resources/soundeffect.cpp
    resources/soundeffect.h
    resources/spritedef.h
    resources/spritedef.cpp
    utils/base64.cpp
    utils/base64.h
    utils/dtor.h
    utils/fastsqrt.h
    utils/gettext.h
    utils/strprintf.cpp
    utils/strprintf.h
    utils/tostring.h
    utils/trim.h
    utils/xml.cpp
    utils/xml.h
    animatedsprite.cpp
    animatedsprite.h
    animationparticle.cpp
    animationparticle.h
    being.cpp
    being.h
    beingmanager.cpp
    beingmanager.h
    configlistener.h
    configuration.cpp
    configuration.h
    effectmanager.cpp
    effectmanager.h
    emoteshortcut.cpp
    emoteshortcut.h
    engine.cpp
    engine.h
    equipment.cpp
    equipment.h
    floor_item.cpp
    floor_item.h
    flooritemmanager.cpp
    flooritemmanager.h
    game.cpp
    game.h
    graphics.cpp
    graphics.h
    guichanfwd.h
    imageparticle.cpp
    imageparticle.h
    inventory.cpp
    inventory.h
    item.cpp
    item.h
    itemshortcut.cpp
    itemshortcut.h
    joystick.cpp
    joystick.h
    keyboardconfig.cpp
    keyboardconfig.h
    localplayer.cpp
    localplayer.h
    lockedarray.h
    log.cpp
    log.h
    logindata.h
    main.cpp
    main.h
    map.cpp
    map.h
    monster.cpp
    monster.h
    npc.cpp
    npc.h
    openglgraphics.cpp
    openglgraphics.h
    particle.cpp
    particle.h
    particlecontainer.cpp
    particlecontainer.h
    particleemitter.cpp
    particleemitter.h
    particleemitterprop.h
    party.cpp
    party.h
    player.cpp
    player.h
    player_relations.cpp
    player_relations.h
    position.cpp
    position.h
    properties.h
    serverinfo.h
    shopitem.cpp
    shopitem.h
    simpleanimation.cpp
    simpleanimation.h
    sound.cpp
    sound.h
    sprite.h
    text.cpp
    text.h
    textmanager.cpp
    textmanager.h
    textparticle.cpp
    textparticle.h
    tileset.h
    vector.cpp
    vector.h
    )

ADD_EXECUTABLE(tmw ${SRCS})

TARGET_LINK_LIBRARIES(tmw
    ${SDL_LIBRARY}
    ${SDLIMAGE_LIBRARY}
    ${SDLMIXER_LIBRARY}
    ${SDLNET_LIBRARY}
    ${PNG_LIBRARIES}
    ${PHYSFS_LIBRARY}
    ${CURL_LIBRARIES}
    ${LIBXML2_LIBRARIES}
    ${GUICHAN_LIBRARIES}
    ${OPENGL_LIBRARIES}
    )

INSTALL(TARGETS tmw RUNTIME DESTINATION ${PKG_BINDIR})

SET_TARGET_PROPERTIES(tmw PROPERTIES COMPILE_FLAGS "${FLAGS}")