-
Notifications
You must be signed in to change notification settings - Fork 12
/
CMakeLists.txt
606 lines (533 loc) · 24.1 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
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
cmake_minimum_required(VERSION 2.8.7)
# Project information
project(xqf)
set (VERSION "1.0.6.2")
if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.git")
find_package(Git)
if (GIT_FOUND)
execute_process(
COMMAND ${GIT_EXECUTABLE} describe --tags --long --match xqf-* --dirty=+dirty
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
OUTPUT_VARIABLE GIT_VERSION
OUTPUT_STRIP_TRAILING_WHITESPACE
)
endif()
endif()
if (GIT_VERSION)
string(REGEX REPLACE "^xqf-" "" GIT_VERSION "${GIT_VERSION}")
set(VERSION "${GIT_VERSION}")
endif ()
file(WRITE "${CMAKE_BINARY_DIR}/VERSION" ${VERSION})
set (DOMAIN "${PROJECT_NAME}")
set (LINGUAS ca da de es fi fr pl ru)
set (DEFAULT_GUI GTK2)
# Paths
set (PACKAGE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/share/xqf")
set (LOCALEDIR "${CMAKE_INSTALL_PREFIX}/share/locale")
if (NOT MAN_ENTRY_PATH)
set (MAN_ENTRY_PATH "${CMAKE_INSTALL_PREFIX}/share/man")
endif (NOT MAN_ENTRY_PATH)
if (NOT PIXMAPS_ENTRY_PATH)
set (PIXMAPS_ENTRY_PATH "${CMAKE_INSTALL_PREFIX}/share/icons/hicolor")
endif (NOT PIXMAPS_ENTRY_PATH)
if (NOT CMAKE_INSTALL_PREFIX)
set (CMAKE_INSTALL_PREFIX "/usr")
endif (NOT CMAKE_INSTALL_PREFIX)
# Definitions
add_definitions (-DPACKAGE="${PROJECT_NAME}" -DPACKAGE_VERSION="${VERSION}" -DXQF_VERSION="${VERSION}" -DDOMAIN="${DOMAIN}" -DLOCALEDIR="${LOCALEDIR}" -DPACKAGE_DATA_DIR="${PACKAGE_DATA_DIR}")
# Options
option(DEPRECATED_DISABLE "Disable deprecated parts of GLib, GObject, GDK and GTK+" OFF)
option(USE_GEOIP "Depend on GeoIP library for geolocation" ON)
option(USE_GZIP "Enable gzip compressor support" ON)
option(RCON_STANDALONE "Build standalone RCON" OFF)
if (NOT WITH_QSTAT)
set (WITH_QSTAT "qstat")
endif (NOT WITH_QSTAT)
add_definitions (-DQSTAT_EXEC="${WITH_QSTAT}")
if (CMAKE_BUILD_TYPE MATCHES DEBUG)
add_definitions (-DDEBUG)
set (CMAKE_C_FLAGS "-g -ggdb -O0")
endif (CMAKE_BUILD_TYPE MATCHES DEBUG)
# Default GUI setting
if (NOT (GUI MATCHES GTK2 OR GUI MATCHES GTK3))
set (GUI ${DEFAULT_GUI})
endif (NOT (GUI MATCHES GTK2 OR GUI MATCHES GTK3))
# GUI definitions
if (GUI MATCHES GTK2)
add_definitions (-DGUI_GTK2)
endif (GUI MATCHES GTK2)
if (GUI MATCHES GTK3)
add_definitions (-DGUI_GTK3)
endif (GUI MATCHES GTK3)
# Other definitions
if (RCON_STANDALONE)
add_definitions (-DRCON_STANDALONE)
endif (RCON_STANDALONE)
if (USE_GEOIP)
add_definitions (-DUSE_GEOIP)
endif (USE_GEOIP)
if (USE_GZIP)
add_definitions (-DUSE_GZIP)
endif (USE_GZIP)
# Compiler flags
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall")
if (GUI MATCHES GTK2)
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-deprecated-declarations")
endif (GUI MATCHES GTK2)
# Source list
set (xqf_HEADERS_DIR ${CMAKE_SOURCE_DIR}/src)
set (xqf_SOURCES
${CMAKE_SOURCE_DIR}/src/addmaster.c
${CMAKE_SOURCE_DIR}/src/addserver.c
${CMAKE_SOURCE_DIR}/src/callbacks.c
${CMAKE_SOURCE_DIR}/src/config.c
${CMAKE_SOURCE_DIR}/src/country-filter.c
${CMAKE_SOURCE_DIR}/src/debug.c
${CMAKE_SOURCE_DIR}/src/dialogs.c
${CMAKE_SOURCE_DIR}/src/dns.c
${CMAKE_SOURCE_DIR}/src/filter.c
${CMAKE_SOURCE_DIR}/src/flt-player.c
${CMAKE_SOURCE_DIR}/src/game.c
${CMAKE_SOURCE_DIR}/src/history.c
${CMAKE_SOURCE_DIR}/src/host.c
${CMAKE_SOURCE_DIR}/src/launch.c
${CMAKE_SOURCE_DIR}/src/pixmaps.c
${CMAKE_SOURCE_DIR}/src/pref.c
${CMAKE_SOURCE_DIR}/src/psearch.c
${CMAKE_SOURCE_DIR}/src/rc.c
${CMAKE_SOURCE_DIR}/src/rcon.c
${CMAKE_SOURCE_DIR}/src/huffman.c
${CMAKE_SOURCE_DIR}/src/server.c
${CMAKE_SOURCE_DIR}/src/skin.c
${CMAKE_SOURCE_DIR}/src/skin_pcx.c
${CMAKE_SOURCE_DIR}/src/sort.c
${CMAKE_SOURCE_DIR}/src/source.c
${CMAKE_SOURCE_DIR}/src/srv-info.c
${CMAKE_SOURCE_DIR}/src/srv-list.c
${CMAKE_SOURCE_DIR}/src/srv-prop.c
${CMAKE_SOURCE_DIR}/src/stat.c
${CMAKE_SOURCE_DIR}/src/statistics.c
${CMAKE_SOURCE_DIR}/src/utils.c
${CMAKE_SOURCE_DIR}/src/xqf.c
${CMAKE_SOURCE_DIR}/src/xqf-ui.c
${CMAKE_SOURCE_DIR}/src/zipped.c
${CMAKE_SOURCE_DIR}/src/redial.c
${CMAKE_SOURCE_DIR}/src/q3maps.c
${CMAKE_SOURCE_DIR}/src/utmaps.c
${CMAKE_SOURCE_DIR}/src/loadpixmap.c
${CMAKE_SOURCE_DIR}/src/scripts.c
${CMAKE_SOURCE_DIR}/src/memtopixmap.c
${CMAKE_SOURCE_DIR}/src/addmaster.h
${CMAKE_SOURCE_DIR}/src/addserver.h
${CMAKE_SOURCE_DIR}/src/callbacks.h
${CMAKE_SOURCE_DIR}/src/config.h
${CMAKE_SOURCE_DIR}/src/country-filter.h
${CMAKE_SOURCE_DIR}/src/debug.h
${CMAKE_SOURCE_DIR}/src/defs.h
${CMAKE_SOURCE_DIR}/src/dialogs.h
${CMAKE_SOURCE_DIR}/src/dns.h
${CMAKE_SOURCE_DIR}/src/filter.h
${CMAKE_SOURCE_DIR}/src/flt-player.h
${CMAKE_SOURCE_DIR}/src/game.h
${CMAKE_SOURCE_DIR}/src/history.h
${CMAKE_SOURCE_DIR}/src/host.h
${CMAKE_SOURCE_DIR}/src/launch.h
${CMAKE_SOURCE_DIR}/src/pixmaps.h
${CMAKE_SOURCE_DIR}/src/pref.h
${CMAKE_SOURCE_DIR}/src/psearch.h
${CMAKE_SOURCE_DIR}/src/quake2_pal.h
${CMAKE_SOURCE_DIR}/src/quake_pal.h
${CMAKE_SOURCE_DIR}/src/rc.h
${CMAKE_SOURCE_DIR}/src/rcon.h
${CMAKE_SOURCE_DIR}/src/huffman.h
${CMAKE_SOURCE_DIR}/src/hufffreq.h
${CMAKE_SOURCE_DIR}/src/server.h
${CMAKE_SOURCE_DIR}/src/skin.h
${CMAKE_SOURCE_DIR}/src/skin_pcx.h
${CMAKE_SOURCE_DIR}/src/sort.h
${CMAKE_SOURCE_DIR}/src/source.h
${CMAKE_SOURCE_DIR}/src/srv-info.h
${CMAKE_SOURCE_DIR}/src/srv-list.h
${CMAKE_SOURCE_DIR}/src/srv-prop.h
${CMAKE_SOURCE_DIR}/src/stat.h
${CMAKE_SOURCE_DIR}/src/statistics.h
${CMAKE_SOURCE_DIR}/src/utils.h
${CMAKE_SOURCE_DIR}/src/xqf-ui.h
${CMAKE_SOURCE_DIR}/src/xqf.h
${CMAKE_SOURCE_DIR}/src/zipped.h
${CMAKE_SOURCE_DIR}/src/redial.h
${CMAKE_SOURCE_DIR}/src/q3maps.h
${CMAKE_SOURCE_DIR}/src/utmaps.h
${CMAKE_SOURCE_DIR}/src/loadpixmap.h
${CMAKE_SOURCE_DIR}/src/scripts.h
${CMAKE_SOURCE_DIR}/src/memtopixmap.h
)
set (flag_DATA
${CMAKE_SOURCE_DIR}/pixmaps/flags/lan.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/ad.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/ae.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/af.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/ag.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/ai.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/al.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/am.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/an.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/ao.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/ar.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/as.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/at.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/au.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/aw.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/ax.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/az.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/ba.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/bb.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/bd.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/be.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/bf.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/bg.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/bh.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/bi.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/bj.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/bm.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/bn.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/bo.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/br.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/bs.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/bt.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/bv.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/bw.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/by.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/bz.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/ca.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/cc.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/cd.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/cf.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/cg.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/ch.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/ci.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/ck.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/cl.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/cm.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/cn.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/co.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/cr.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/cs.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/cu.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/cv.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/cx.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/cy.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/cz.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/de.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/dj.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/dk.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/dm.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/do.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/dz.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/ec.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/ee.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/eg.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/eh.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/er.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/es.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/et.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/fi.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/fj.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/fk.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/fm.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/fo.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/fr.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/ga.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/gb.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/gd.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/ge.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/gf.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/gh.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/gi.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/gl.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/gm.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/gn.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/gp.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/gq.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/gr.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/gs.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/gt.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/gu.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/gw.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/gy.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/hk.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/hm.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/hn.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/hr.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/ht.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/hu.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/id.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/ie.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/il.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/in.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/io.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/iq.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/ir.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/is.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/it.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/jm.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/jo.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/jp.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/ke.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/kg.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/kh.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/ki.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/km.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/kn.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/kp.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/kr.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/kw.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/ky.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/kz.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/la.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/lb.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/lc.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/li.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/lk.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/lr.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/ls.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/lt.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/lu.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/lv.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/ly.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/ma.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/mc.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/md.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/me.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/mg.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/mh.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/mk.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/ml.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/mm.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/mn.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/mo.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/mp.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/mq.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/mr.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/ms.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/mt.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/mu.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/mv.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/mw.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/mx.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/my.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/mz.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/na.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/nc.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/ne.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/nf.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/ng.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/ni.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/nl.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/no.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/np.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/nr.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/nu.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/nz.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/om.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/pa.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/pe.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/pf.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/pg.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/ph.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/pk.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/pl.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/pm.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/pn.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/pr.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/ps.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/pt.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/pw.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/py.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/qa.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/re.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/ro.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/rs.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/ru.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/rw.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/sa.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/sb.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/sc.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/sd.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/se.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/sg.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/sh.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/si.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/sj.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/sk.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/sl.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/sm.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/sn.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/so.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/sr.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/st.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/sv.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/sy.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/sz.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/tc.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/td.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/tf.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/tg.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/th.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/tj.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/tk.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/tl.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/tm.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/tn.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/to.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/tr.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/tt.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/tv.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/tw.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/tz.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/ua.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/ug.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/um.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/us.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/uy.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/uz.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/va.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/vc.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/ve.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/vg.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/vi.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/vn.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/vu.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/wf.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/ws.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/ye.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/yt.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/za.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/zm.png
${CMAKE_SOURCE_DIR}/pixmaps/flags/country/zw.png
)
set (xpm_MAIN ${CMAKE_SOURCE_DIR}/pixmaps/xqf.xpm)
set (xpm_DATA
${CMAKE_SOURCE_DIR}/src/xpm/update.xpm
${CMAKE_SOURCE_DIR}/src/xpm/refresh.xpm
${CMAKE_SOURCE_DIR}/src/xpm/refrsel.xpm
${CMAKE_SOURCE_DIR}/src/xpm/stop.xpm
${CMAKE_SOURCE_DIR}/src/xpm/connect.xpm
${CMAKE_SOURCE_DIR}/src/xpm/observe.xpm
${CMAKE_SOURCE_DIR}/src/xpm/record.xpm
${CMAKE_SOURCE_DIR}/src/xpm/sfilter.xpm
${CMAKE_SOURCE_DIR}/src/xpm/pfilter.xpm
)
set (icon_SIZE 22 32 48 128)
include_directories (${xqf_HEADERS_DIR} ${CMAKE_BINARY_DIR})
if (DEPRECATED_DISABLE)
add_definitions (-DGSEAL_ENABLE
-DG_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -DGDK_PIXBUF_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED
-DG_DISABLE_SINGLE_INCLUDES -DGDK_DISABLE_SINGLE_INCLUDES -DGDK_PIXBUF_DISABLE_SINGLE_INCLUDES -DGTK_DISABLE_SINGLE_INCLUDES)
endif (DEPRECATED_DISABLE)
# Use the package PkgConfig to detect GTK+ headers/library files
find_package (PkgConfig REQUIRED)
find_package (Gettext REQUIRED)
pkg_check_modules (UNZIP REQUIRED minizip)
pkg_check_modules (XML REQUIRED libxml-2.0)
if (GUI MATCHES GTK2)
pkg_check_modules (GTK2 REQUIRED gtk+-2.0)
include_directories (${GTK2_INCLUDE_DIRS})
link_directories (${GTK2_LIBRARY_DIRS})
add_definitions (${GTK2_CFLAGS_OTHER})
set (GUI_SET ON)
endif (GUI MATCHES GTK2)
if (GUI MATCHES GTK3)
pkg_check_modules (GTK3 REQUIRED gtk+-3.0)
include_directories (${GTK3_INCLUDE_DIRS})
link_directories (${GTK3_LIBRARY_DIRS})
add_definitions (${GTK3_CFLAGS_OTHER})
set (GUI_SET ON)
endif (GUI MATCHES GTK3)
if (USE_GEOIP)
pkg_check_modules (GEOIP REQUIRED geoip)
include_directories (${GEOIP_INCLUDE_DIRS})
link_directories (${GEOIP_LIBRARY_DIRS})
endif (USE_GEOIP)
include_directories (${UNZIP_INCLUDE_DIRS})
link_directories (${UNZIP_LIBRARY_DIRS})
include_directories (${XML_INCLUDE_DIRS})
link_directories (${XML_LIBRARY_DIRS})
include_directories (${GETTEXT_INCLUDE_DIRS})
link_directories (${GETTEXT_LIBRARY_DIRS})
# Compile and link
add_executable (gamesxml2c ${CMAKE_SOURCE_DIR}/src/gamesxml2c.c)
target_link_libraries (gamesxml2c xml2)
# Custom build rule for converting games.xml to games.c
add_custom_command (
OUTPUT ${CMAKE_BINARY_DIR}/games.c
COMMAND gamesxml2c ${CMAKE_SOURCE_DIR}/src/games.xml ${CMAKE_BINARY_DIR}/games.c ${CMAKE_BINARY_DIR}/games.h ${CMAKE_BINARY_DIR}/icons.c
MAIN_DEPENDENCY ${CMAKE_SOURCE_DIR}/src/games.xml
DEPENDS gamesxml2c)
# Define games.c filename for including in src/game.c
add_definitions (-DGAMES_C_INCLUDE="${CMAKE_BINARY_DIR}/games.c")
add_definitions (-DGAMES_H_INCLUDE="${CMAKE_BINARY_DIR}/games.h")
add_definitions (-DICONS_C_INCLUDE="${CMAKE_BINARY_DIR}/icons.c")
# Make src/game.c depend on games.c so that src/game.c is rebuilt when games.c changes,
# this must be manually specified due to the include name being a define
set_property (SOURCE ${CMAKE_SOURCE_DIR}/src/game.c APPEND PROPERTY OBJECT_DEPENDS ${CMAKE_BINARY_DIR}/games.c)
# Compile and link
add_executable (xqf ${xqf_SOURCES})
target_link_libraries (xqf ${UNZIP_LIBRARIES} dl m)
if (GUI MATCHES GTK2)
target_link_libraries (xqf ${GTK2_LIBRARIES})
endif (GUI MATCHES GTK2)
if (GUI MATCHES GTK3)
target_link_libraries (xqf ${GTK3_LIBRARIES})
endif (GUI MATCHES GTK3)
if (USE_GEOIP)
target_link_libraries (xqf GeoIP)
endif (USE_GEOIP)
if (RCON_STANDALONE)
target_link_libraries (xqf -lreadline)
endif (RCON_STANDALONE)
# i18n
add_custom_target (translation ALL)
foreach (LANG ${LINGUAS})
set (_poFile ${CMAKE_SOURCE_DIR}/po/${LANG}.po)
if (EXISTS ${_poFile})
set (POT_FILE ${CMAKE_SOURCE_DIR}/po/${DOMAIN}.pot)
set (PO_FILE_NEW ${CMAKE_BINARY_DIR}/${LANG}.po)
set (GMO_FILE_NEW ${CMAKE_BINARY_DIR}/${LANG}.gmo)
add_custom_command (TARGET translation
COMMAND msgmerge ${_poFile} ${POT_FILE} -o ${PO_FILE_NEW}
COMMAND msgfmt -c -o ${GMO_FILE_NEW} ${PO_FILE_NEW})
endif (EXISTS ${_poFile})
endforeach (LANG ${LINGUAS})
add_custom_command (TARGET translation
COMMAND echo ${LINGUAS} > ${CMAKE_BINARY_DIR}/LINGUAS
COMMAND msgfmt --desktop -d ${CMAKE_BINARY_DIR} --template=${CMAKE_SOURCE_DIR}/${PROJECT_NAME}.desktop.in -c -o ${CMAKE_BINARY_DIR}/${PROJECT_NAME}.desktop
)
# Installation
# Executable
install (TARGETS xqf DESTINATION "${CMAKE_INSTALL_PREFIX}/bin")
# UI
if (GUI MATCHES GTK2)
install (FILES ${CMAKE_SOURCE_DIR}/src/xqf-gtk2.ui DESTINATION ${PACKAGE_DATA_DIR}/ui)
endif (GUI MATCHES GTK2)
if (GUI MATCHES GTK3)
install (FILES ${CMAKE_SOURCE_DIR}/src/xqf-gtk3.ui DESTINATION ${PACKAGE_DATA_DIR}/ui)
endif (GUI MATCHES GTK3)
# Icons
install (FILES ${xpm_DATA} DESTINATION ${PACKAGE_DATA_DIR}/xpm)
install (FILES ${xpm_MAIN} DESTINATION ${CMAKE_INSTALL_PREFIX}/share/pixmaps)
install (FILES ${flag_DATA} DESTINATION ${PACKAGE_DATA_DIR}/default/flags)
foreach (SIZE ${icon_SIZE})
install (FILES ${CMAKE_SOURCE_DIR}/pixmaps/${SIZE}x${SIZE}/xqf.png
DESTINATION ${PIXMAPS_ENTRY_PATH}/${SIZE}x${SIZE}/apps)
endforeach (SIZE ${icon_SIZE})
install (FILES ${CMAKE_SOURCE_DIR}/pixmaps/scalable/xqf.svg DESTINATION ${PIXMAPS_ENTRY_PATH}/scalable/apps)
# Config
install (FILES ${CMAKE_SOURCE_DIR}/src/qstat.cfg DESTINATION ${PACKAGE_DATA_DIR})
# Man pages
install (FILES ${CMAKE_SOURCE_DIR}/${PROJECT_NAME}.6 DESTINATION ${MAN_ENTRY_PATH}/man6)
# i18n
foreach (LANG ${LINGUAS})
install (FILES ${CMAKE_BINARY_DIR}/${LANG}.gmo DESTINATION ${LOCALEDIR}/${LANG}/LC_MESSAGES RENAME ${DOMAIN}.mo )
endforeach (LANG ${LINGUAS})
install (FILES ${CMAKE_BINARY_DIR}/${PROJECT_NAME}.desktop DESTINATION ${CMAKE_INSTALL_PREFIX}/share/applications)