summaryrefslogtreecommitdiff
path: root/src/CMakeLists.txt
blob: 4f54be8c4c616a0b9ab2f3f66096eec9f27dcc70 (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
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
FIND_PACKAGE(SDL REQUIRED)
FIND_PACKAGE(SDL_image REQUIRED)
FIND_PACKAGE(SDL_mixer REQUIRED)
FIND_PACKAGE(SDL_net REQUIRED)
FIND_PACKAGE(SDL_ttf REQUIRED)
FIND_PACKAGE(SDL_gfx REQUIRED)
FIND_PACKAGE(CURL REQUIRED)
FIND_PACKAGE(LibXml2 REQUIRED)
FIND_PACKAGE(PhysFS REQUIRED)
FIND_PACKAGE(PNG REQUIRED)
FIND_PACKAGE(Gettext REQUIRED)

IF (CMAKE_COMPILER_IS_GNUCXX)
    # Help getting compilation warnings
    SET(CMAKE_CXX_FLAGS "-Wall")
    IF (WIN32)
        # This includes enough debug information to get something useful
        # from Dr. Mingw while keeping binary size down. Almost useless
        # with gdb, though.
        SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -ggdb0 -gstabs2")
    ENDIF()
ENDIF()

IF (POLICY CMP0015)
  CMAKE_POLICY(SET CMP0015 OLD)
ENDIF()

SET(FLAGS "-DPACKAGE_VERSION=\\\"${VERSION}\\\"")
SET(FLAGS "${FLAGS} -DPKG_DATADIR=\\\"${PKG_DATADIR}/\\\"")
SET(FLAGS "${FLAGS} -DLOCALEDIR=\\\"${LOCALEDIR}/\\\"")

IF (ENABLE_NLS)
    SET(FLAGS "${FLAGS} -DENABLE_NLS=1")
ENDIF()

IF (CMAKE_BUILD_TYPE)
    STRING(TOLOWER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE_TOLOWER)
    IF(CMAKE_BUILD_TYPE_TOLOWER MATCHES debug OR
       CMAKE_BUILD_TYPE_TOLOWER MATCHES relwithdebinfo)
        SET(FLAGS "${FLAGS} -DDEBUG")
    ENDIF()
ENDIF()

IF (WIN32)
    SET(EXTRA_LIBRARIES ws2_32 winmm)
    FIND_PACKAGE(LibIntl REQUIRED)
ELSEIF (CMAKE_SYSTEM_NAME STREQUAL "Darwin" OR BEOS)
    FIND_PACKAGE(LibIntl REQUIRED)
ELSEIF (CMAKE_SYSTEM_NAME STREQUAL SunOS)
    # explicit linking to libintl is required on Solaris
    SET(EXTRA_LIBRARIES intl)
ENDIF()

SET(GUICHAN_COMPONENTS "SDL")
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)

IF (USE_X11)
    FIND_PACKAGE(X11 REQUIRED)
    INCLUDE_DIRECTORIES(${X11_INCLUDE_DIR})
    SET(FLAGS "${FLAGS} -DUSE_X11")
ENDIF (USE_X11)

INCLUDE_DIRECTORIES(
    ${CMAKE_CURRENT_SOURCE_DIR}
    ${SDL_INCLUDE_DIR}
    ${SDLIMAGE_INCLUDE_DIR}
    ${SDLMIXER_INCLUDE_DIR}
    ${SDLNET_INCLUDE_DIR}
    ${SDLTTF_INCLUDE_DIR}
    ${SDLGFX_INCLUDE_DIR}
    ${PNG_INCLUDE_DIR}
    ${PHYSFS_INCLUDE_DIR}
    ${CURL_INCLUDE_DIR}
    ${LIBXML2_INCLUDE_DIR}
    ${GUICHAN_INCLUDE_DIR}
    )

# enable rc-handling with mingw
# most likely this part can be kicked out with some later cmake version
IF (MINGW)
    FIND_PATH(MINGW_INCLUDE_DIR windows.h $ENV{INCLUDE})
    IF (MINGW_INCLUDE_DIR)
        MESSAGE(STATUS "Found mingw headers: ${MINGW_INCLUDE_DIR}")
        INCLUDE_DIRECTORIES(${MINGW_INCLUDE_DIR})
    ELSE()
        MESSAGE(FATAL_ERROR "Unable to find mingw headers. Required for windres")
    ENDIF()
    SET(CMAKE_RC_COMPILER_INIT windres)
    ENABLE_LANGUAGE(RC)
    SET(CMAKE_RC_COMPILE_OBJECT
      "<CMAKE_RC_COMPILER> <FLAGS> <DEFINES> -O coff -o <OBJECT> <SOURCE>")
ENDIF()

# 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/avatarlistbox.cpp
    gui/widgets/avatarlistbox.h
    gui/widgets/battletab.cpp
    gui/widgets/battletab.h
    gui/widgets/browserbox.cpp
    gui/widgets/browserbox.h
    gui/widgets/button.cpp
    gui/widgets/button.h
    gui/widgets/channeltab.cpp
    gui/widgets/channeltab.h
    gui/widgets/chattab.cpp
    gui/widgets/chattab.h
    gui/widgets/checkbox.cpp
    gui/widgets/checkbox.h
    gui/widgets/container.cpp
    gui/widgets/container.h
    gui/widgets/desktop.cpp
    gui/widgets/desktop.h
    gui/widgets/dropdown.cpp
    gui/widgets/dropdown.h
    gui/widgets/emoteshortcutcontainer.cpp
    gui/widgets/emoteshortcutcontainer.h
    gui/widgets/flowcontainer.cpp
    gui/widgets/flowcontainer.h
    gui/widgets/guildchattab.cpp
    gui/widgets/guildchattab.h
    gui/widgets/horizontcontainer.cpp
    gui/widgets/horizontcontainer.h
    gui/widgets/icon.cpp
    gui/widgets/icon.h
    gui/widgets/inttextfield.cpp
    gui/widgets/inttextfield.h
    gui/widgets/inventoryfilter.cpp
    gui/widgets/inventoryfilter.h
    gui/widgets/itemcontainer.cpp
    gui/widgets/itemcontainer.h
    gui/widgets/itemlinkhandler.cpp
    gui/widgets/itemlinkhandler.h
    gui/widgets/dropshortcutcontainer.cpp
    gui/widgets/dropshortcutcontainer.h
    gui/widgets/itemshortcutcontainer.cpp
    gui/widgets/itemshortcutcontainer.h
    gui/widgets/spellshortcutcontainer.cpp
    gui/widgets/spellshortcutcontainer.h
    gui/widgets/label.cpp
    gui/widgets/label.h
    gui/widgets/layout.cpp
    gui/widgets/layout.h
    gui/widgets/layouthelper.cpp
    gui/widgets/layouthelper.h
    gui/widgets/linkhandler.h
    gui/widgets/listbox.cpp
    gui/widgets/listbox.h
    gui/widgets/mouseevent.h
    gui/widgets/passwordfield.cpp
    gui/widgets/passwordfield.h
    gui/widgets/playerbox.cpp
    gui/widgets/playerbox.h
    gui/widgets/popup.cpp
    gui/widgets/popup.h
    gui/widgets/progressbar.cpp
    gui/widgets/progressbar.h
    gui/widgets/progressindicator.cpp
    gui/widgets/progressindicator.h
    gui/widgets/radiobutton.cpp
    gui/widgets/radiobutton.h
    gui/widgets/resizegrip.cpp
    gui/widgets/resizegrip.h
    gui/widgets/scrollarea.cpp
    gui/widgets/scrollarea.h
    gui/widgets/setupitem.cpp
    gui/widgets/setupitem.h
    gui/widgets/setuptab.cpp
    gui/widgets/setuptab.h
    gui/widgets/setuptabscroll.cpp
    gui/widgets/setuptabscroll.h
    gui/widgets/shopitems.cpp
    gui/widgets/shopitems.h
    gui/widgets/shoplistbox.cpp
    gui/widgets/shoplistbox.h
    gui/widgets/shortcutcontainer.cpp
    gui/widgets/shortcutcontainer.h
    gui/widgets/slider.cpp
    gui/widgets/slider.h
    gui/widgets/tab.cpp
    gui/widgets/tab.h
    gui/widgets/tabbedarea.cpp
    gui/widgets/tabbedarea.h
    gui/widgets/guitable.cpp
    gui/widgets/guitable.h
    gui/widgets/tablemodel.cpp
    gui/widgets/tablemodel.h
    gui/widgets/textbox.cpp
    gui/widgets/textbox.h
    gui/widgets/textfield.cpp
    gui/widgets/textfield.h
    gui/widgets/textpreview.cpp
    gui/widgets/textpreview.h
    gui/widgets/tradetab.cpp
    gui/widgets/tradetab.h
    gui/widgets/vertcontainer.cpp
    gui/widgets/vertcontainer.h
    gui/widgets/whispertab.cpp
    gui/widgets/whispertab.h
    gui/widgets/window.cpp
    gui/widgets/window.h
    gui/widgets/windowcontainer.cpp
    gui/widgets/windowcontainer.h
    gui/beingpopup.cpp
    gui/beingpopup.h
    gui/buydialog.cpp
    gui/buydialog.h
    gui/buyselldialog.cpp
    gui/buyselldialog.h
    gui/changeemaildialog.cpp
    gui/changeemaildialog.h
    gui/changepassworddialog.cpp
    gui/changepassworddialog.h
    gui/charselectdialog.cpp
    gui/charselectdialog.h
    gui/charcreatedialog.cpp
    gui/charcreatedialog.h
    gui/chatwindow.cpp
    gui/chatwindow.h
    gui/confirmdialog.cpp
    gui/confirmdialog.h
    gui/connectiondialog.cpp
    gui/connectiondialog.h
    gui/debugwindow.cpp
    gui/debugwindow.h
    gui/didyouknowwindow.cpp
    gui/didyouknowwindow.h
    gui/editserverdialog.cpp
    gui/editserverdialog.h
    gui/emotepopup.cpp
    gui/emotepopup.h
    gui/equipmentwindow.cpp
    gui/equipmentwindow.h
    gui/focushandler.cpp
    gui/focushandler.h
    gui/gui.cpp
    gui/gui.h
    gui/helpwindow.cpp
    gui/helpwindow.h
    gui/inventorywindow.cpp
    gui/inventorywindow.h
    gui/itempopup.cpp
    gui/itempopup.h
    gui/spellpopup.cpp
    gui/spellpopup.h
    gui/statuspopup.cpp
    gui/statuspopup.h
    gui/killstats.cpp
    gui/killstats.h
    gui/itemamountwindow.cpp
    gui/itemamountwindow.h
    gui/logindialog.cpp
    gui/logindialog.h
    gui/minimap.cpp
    gui/minimap.h
    gui/ministatuswindow.cpp
    gui/ministatuswindow.h
    gui/npcdialog.cpp
    gui/npcdialog.h
    gui/npcpostdialog.cpp
    gui/npcpostdialog.h
    gui/okdialog.cpp
    gui/okdialog.h
    gui/editdialog.cpp
    gui/editdialog.h
    gui/outfitwindow.cpp
    gui/outfitwindow.h
    gui/botcheckerwindow.cpp
    gui/botcheckerwindow.h
    gui/textcommandeditor.cpp
    gui/textcommandeditor.h
    gui/palette.cpp
    gui/palette.h
    gui/popupmenu.cpp
    gui/popupmenu.h
    gui/quitdialog.cpp
    gui/quitdialog.h
    gui/register.cpp
    gui/register.h
    gui/sdlinput.cpp
    gui/sdlinput.h
    gui/selldialog.cpp
    gui/selldialog.h
    gui/serverdialog.cpp
    gui/serverdialog.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_other.cpp
    gui/setup_other.h
    gui/setup_theme.cpp
    gui/setup_theme.h
    gui/setup_chat.cpp
    gui/setup_chat.h
    gui/setup_keyboard.cpp
    gui/setup_keyboard.h
    gui/setup_perfomance.cpp
    gui/setup_perfomance.h
    gui/setup_relations.cpp
    gui/setup_relations.h
    gui/setup_players.cpp
    gui/setup_players.h
    gui/setup_video.cpp
    gui/setup_video.h
    gui/sdlfont.cpp
    gui/sdlfont.h
    gui/shopwindow.cpp
    gui/shopwindow.h
    gui/shortcutwindow.cpp
    gui/shortcutwindow.h
    gui/skilldialog.cpp
    gui/skilldialog.h
    gui/socialwindow.cpp
    gui/socialwindow.h
    gui/speechbubble.cpp
    gui/speechbubble.h
    gui/specialswindow.cpp
    gui/specialswindow.h
    gui/statuswindow.cpp
    gui/statuswindow.h
    gui/textdialog.cpp
    gui/textdialog.h
    gui/textpopup.cpp
    gui/textpopup.h
    gui/theme.cpp
    gui/theme.h
    gui/tradewindow.cpp
    gui/tradewindow.h
    gui/unregisterdialog.cpp
    gui/unregisterdialog.h
    gui/updaterwindow.cpp
    gui/updaterwindow.h
    gui/userpalette.cpp
    gui/userpalette.h
    gui/viewport.cpp
    gui/viewport.h
    gui/whoisonline.cpp
    gui/whoisonline.h
    gui/windowmenu.cpp
    gui/windowmenu.h
    gui/worldselectdialog.cpp
    gui/worldselectdialog.h
    net/adminhandler.h
    net/charhandler.cpp
    net/charhandler.h
    net/chathandler.h
    net/download.cpp
    net/download.h
    net/gamehandler.h
    net/generalhandler.h
    net/guildhandler.h
    net/inventoryhandler.h
    net/logindata.h
    net/loginhandler.h
    net/messagehandler.h
    net/messagein.cpp
    net/messagein.h
    net/messageout.cpp
    net/messageout.h
    net/npchandler.h
    net/net.cpp
    net/net.h
    net/partyhandler.h
    net/playerhandler.h
    net/serverinfo.h
    net/specialhandler.h
    net/tradehandler.h
    net/worldinfo.h
    net/packetcounters.cpp
    net/packetcounters.h
    resources/action.cpp
    resources/action.h
    resources/ambientlayer.cpp
    resources/ambientlayer.h
    resources/animation.cpp
    resources/animation.h
    resources/beinginfo.cpp
    resources/beinginfo.h
    resources/chardb.cpp
    resources/chardb.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.h
    resources/iteminfo.cpp
    resources/mapdb.cpp
    resources/mapdb.h
    resources/mapreader.cpp
    resources/mapreader.h
    resources/monsterdb.cpp
    resources/monsterdb.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.h
    resources/soundeffect.cpp
    resources/specialdb.cpp
    resources/specialdb.h
    resources/spritedef.h
    resources/spritedef.cpp
    resources/wallpaper.cpp
    resources/wallpaper.h
    utils/translation/podict.cpp
    utils/translation/podict.h
    utils/translation/poparser.cpp
    utils/translation/poparser.h
    utils/translation/translationmanager.cpp
    utils/translation/translationmanager.h
    utils/base64.cpp
    utils/base64.h
    utils/checkutils.cpp
    utils/checkutils.h
    utils/copynpaste.cpp
    utils/copynpaste.h
    utils/dtor.h
    utils/gettext.h
    utils/langs.cpp
    utils/langs.h
    utils/mathutils.h
    utils/paths.cpp
    utils/paths.h
    utils/physfsrwops.cpp
    utils/physfsrwops.h
    utils/process.cpp
    utils/process.h
    utils/stringutils.cpp
    utils/stringutils.h
    utils/mutex.h
    utils/mkdir.cpp
    utils/mkdir.h
    utils/xml.cpp
    utils/xml.h
    test/testlauncher.cpp
    test/testlauncher.h
    test/testmain.cpp
    test/testmain.h
    actor.cpp
    actor.h
    actorsprite.cpp
    actorsprite.h
    actorspritelistener.h
    actorspritemanager.cpp
    actorspritemanager.h
    animatedsprite.cpp
    animatedsprite.h
    animationparticle.cpp
    animationparticle.h
    auctionmanager.cpp
    auctionmanager.h
    avatar.cpp
    avatar.h
    being.cpp
    being.h
    spellmanager.cpp
    spellmanager.h
    chatlogger.cpp
    chatlogger.h
    client.cpp
    client.h
    channel.cpp
    channel.h
    channelmanager.cpp
    channelmanager.h
    commandhandler.cpp
    commandhandler.h
    compoundsprite.cpp
    compoundsprite.h
    configlistener.h
    configuration.cpp
    configuration.h
    debug.h
    defaults.cpp
    defaults.h
    effectmanager.cpp
    effectmanager.h
    emoteshortcut.cpp
    emoteshortcut.h
    equipment.h
    event.cpp
    event.h
    flooritem.cpp
    flooritem.h
    game.cpp
    game.h
    graphics.cpp
    graphics.h
    graphicsvertexes.cpp
    graphicsvertexes.h
    guichanfwd.h
    guild.cpp
    guild.h
    guildmanager.cpp
    guildmanager.h
    imageparticle.cpp
    imageparticle.h
    imagesprite.cpp
    imagesprite.h
    inventory.cpp
    inventory.h
    item.cpp
    item.h
    itemshortcut.cpp
    itemshortcut.h
    dropshortcut.cpp
    dropshortcut.h
    spellshortcut.cpp
    spellshortcut.h
    textcommand.cpp
    textcommand.h
    joystick.cpp
    joystick.h
    keyboardconfig.cpp
    keyboardconfig.h
    listener.cpp
    listener.h
    localconsts.h
    localplayer.cpp
    localplayer.h
    logger.cpp
    logger.h
    main.cpp
    main.h
    map.cpp
    map.h
    maplayer.cpp
    maplayer.h
    opengl1graphics.cpp
    opengl1graphics.h
    openglgraphics.cpp
    openglgraphics.h
    particle.cpp
    particle.h
    particlecontainer.cpp
    particlecontainer.h
    particleemitter.cpp
    particleemitter.h
    particleemitterprop.h
    party.cpp
    party.h
    playerinfo.cpp
    playerinfo.h
    playerrelations.cpp
    playerrelations.h
    position.cpp
    position.h
    properties.h
    rotationalparticle.cpp
    rotationalparticle.h
    shopitem.cpp
    shopitem.h
    simpleanimation.cpp
    simpleanimation.h
    sound.cpp
    sound.h
    sprite.h
    statuseffect.cpp
    statuseffect.h
    text.cpp
    text.h
    textmanager.cpp
    textmanager.h
    textparticle.cpp
    textparticle.h
    textrenderer.h
    tileset.h
    units.cpp
    units.h
    variabledata.h
    vector.cpp
    vector.h
    mumblemanager.cpp
    mumblemanager.h
    )

SET(SRCS_EVOL
    net/ea/gui/guildtab.cpp
    net/ea/gui/guildtab.h
    net/ea/gui/partytab.cpp
    net/ea/gui/partytab.h
    net/ea/adminhandler.cpp
    net/ea/adminhandler.h
    net/ea/beinghandler.cpp
    net/ea/beinghandler.h
    net/ea/buysellhandler.cpp
    net/ea/buysellhandler.h
    net/ea/charserverhandler.cpp
    net/ea/charserverhandler.h
    net/ea/chathandler.cpp
    net/ea/chathandler.h
    net/ea/eaprotocol.h
    net/ea/gamehandler.cpp
    net/ea/gamehandler.h
    net/ea/guildhandler.cpp
    net/ea/guildhandler.h
    net/ea/inventoryhandler.cpp
    net/ea/inventoryhandler.h
    net/ea/itemhandler.cpp
    net/ea/itemhandler.h
    net/ea/loginhandler.cpp
    net/ea/loginhandler.h
    net/ea/npchandler.cpp
    net/ea/npchandler.h
    net/ea/partyhandler.cpp
    net/ea/partyhandler.h
    net/ea/playerhandler.cpp
    net/ea/playerhandler.h
    net/ea/specialhandler.cpp
    net/ea/specialhandler.h
    net/ea/token.h
    net/ea/tradehandler.cpp
    net/ea/tradehandler.h
    )

SET(SRCS_TMWA
    net/tmwa/gui/guildtab.cpp
    net/tmwa/gui/guildtab.h
    net/tmwa/gui/partytab.cpp
    net/tmwa/gui/partytab.h
    net/tmwa/adminhandler.cpp
    net/tmwa/adminhandler.h
    net/tmwa/beinghandler.cpp
    net/tmwa/beinghandler.h
    net/tmwa/buysellhandler.cpp
    net/tmwa/buysellhandler.h
    net/tmwa/charserverhandler.cpp
    net/tmwa/charserverhandler.h
    net/tmwa/chathandler.cpp
    net/tmwa/chathandler.h
    net/tmwa/gamehandler.cpp
    net/tmwa/gamehandler.h
    net/tmwa/generalhandler.cpp
    net/tmwa/generalhandler.h
    net/tmwa/guildhandler.cpp
    net/tmwa/guildhandler.h
    net/tmwa/inventoryhandler.cpp
    net/tmwa/inventoryhandler.h
    net/tmwa/itemhandler.cpp
    net/tmwa/itemhandler.h
    net/tmwa/loginhandler.cpp
    net/tmwa/loginhandler.h
    net/tmwa/messagehandler.cpp
    net/tmwa/messagehandler.h
    net/tmwa/messagein.cpp
    net/tmwa/messagein.h
    net/tmwa/messageout.cpp
    net/tmwa/messageout.h
    net/tmwa/network.cpp
    net/tmwa/network.h
    net/tmwa/npchandler.cpp
    net/tmwa/npchandler.h
    net/tmwa/partyhandler.cpp
    net/tmwa/partyhandler.h
    net/tmwa/playerhandler.cpp
    net/tmwa/playerhandler.h
    net/tmwa/protocol.h
    net/tmwa/specialhandler.cpp
    net/tmwa/specialhandler.h
    net/tmwa/tradehandler.cpp
    net/tmwa/tradehandler.h
    )

IF (WIN32)
    SET(SRCS
        ${SRCS}
        utils/specialfolder.cpp
        utils/specialfolder.h
        manaplus.rc
    )
ENDIF ()

SET (PROGRAMS manaplus)

ADD_EXECUTABLE(manaplus WIN32 ${SRCS} ${SRCS_TMWA} ${SRCS_EVOL})

TARGET_LINK_LIBRARIES(manaplus
    ${SDLGFX_LIBRARIES}
    ${SDL_LIBRARY}
    ${SDLIMAGE_LIBRARY}
    ${SDLMIXER_LIBRARY}
    ${SDLNET_LIBRARY}
    ${SDLTTF_LIBRARY}
    ${PNG_LIBRARIES}
    ${PHYSFS_LIBRARY}
    ${CURL_LIBRARIES}
    ${LIBXML2_LIBRARIES}
    ${GUICHAN_LIBRARIES}
    ${OPENGL_LIBRARIES}
    ${LIBINTL_LIBRARIES}
    ${EXTRA_LIBRARIES})
INSTALL(TARGETS manaplus RUNTIME DESTINATION ${PKG_BINDIR})

IF (CMAKE_SYSTEM_NAME STREQUAL SunOS)
    # we expect the SMCgtxt package to be present on Solaris;
    # the Solaris gettext is not API-compatible to GNU gettext
    SET_TARGET_PROPERTIES(manaplus PROPERTIES LINK_FLAGS "-L/usr/local/lib")
ENDIF()

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