forked from camgunz/d2k
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
1175 lines (1028 loc) · 33.4 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
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
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#==============================================================================
############################################################# License #########
#==============================================================================
#
# Copyright (c) 2010 Jamie Jones <[email protected]>
# Copyright (C) 2013 David Hill
# Copyright (C) 2014 Charles Gunyon <[email protected]>
#
# This software 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 software 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., 51
# Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
#==============================================================================
#==============================================================================
################################################# CMake Configuration #########
#==============================================================================
PROJECT("D2K" C)
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.0 FATAL_ERROR)
IF(${CMAKE_BINARY_DIR} STREQUAL ${CMAKE_SOURCE_DIR})
MESSAGE(${CMAKE_SOURCE_DIR})
MESSAGE(${CMAKE_BINARY_DIR})
MESSAGE(FATAL_ERROR "In-tree Builds are NOT supported.")
ENDIF()
IF(WIN32)
SET(CMAKE_MFC_FLAG 2)
SET(CMAKE_INSTALL_MFC_LIBRARIES 1)
INCLUDE(InstallRequiredSystemLibraries)
ENDIF()
###
# Supported Build Types are:
# * Debug (CMAKE_C_FLAGS_DEBUG)
# * Release (CMAKE_C_FLAGS_RELEASE)
# If no build type requested, default to Release
###
IF(NOT DEFINED CMAKE_BUILD_TYPE)
SET(CMAKE_BUILD_TYPE Release)
ENDIF()
# Default to not building shared libraries.
IF(NOT DEFINED BUILD_SHARED_LIBS)
SET(BUILD_SHARED_LIBS OFF)
ENDIF()
# Default to not installing any sub-projects.
IF(NOT DEFINED SKIP_INSTALL_ALL)
SET(SKIP_INSTALL_ALL ON)
ENDIF()
INCLUDE(CheckIncludeFiles)
INCLUDE(CheckFunctionExists)
INCLUDE(CheckSymbolExists)
INCLUDE(CheckLibraryExists)
INCLUDE(CheckTypeSize)
INCLUDE(CheckCSourceCompiles)
INCLUDE(CheckCCompilerFlag)
INCLUDE(CMakeDependentOption)
SET(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules)
SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
#==============================================================================
########################################################### Functions #########
#==============================================================================
FUNCTION(TRY_C_COMPILER_FLAG flag name)
CHECK_C_COMPILER_FLAG("${flag}" ${name})
IF(${name})
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${flag}" PARENT_SCOPE)
ENDIF()
ENDFUNCTION(TRY_C_COMPILER_FLAG flag name)
#==============================================================================
##################################################### Package Details #########
#==============================================================================
SET(VERSION "0")
SET(PACKAGE "D2K")
SET(PACKAGE_NAME "D2K")
SET(PACKAGE_VERSION "${VERSION}")
# SET(PACKAGE_BUGREPORT "huh")
SET(PACKAGE_STRING "${PACKAGE_NAME} v${PACKAGE_VERSION}")
SET(PACKAGE_TARNAME "d2k")
SET(PACKAGE_URL "http://github.com/camgunz/d2k")
SET(CPACK_GENERATOR "DEB;RPM;STGZ;ZIP")
SET(CPACK_PACKAGE_VENDOR "Team TotalTrash")
SET(CPACK_PACKAGE_CONTACT "Team TotalTrash <[email protected]>")
SET(CPACK_PACKAGE_VERSION "${VERSION}")
SET(CPACK_PACKAGE_NAME "D2K")
SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/COPYING")
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY
"D2K is a Doom Source Port for the 21st Century"
)
SET(CPACK_DEBIAN_PACKAGE_SECTION "games")
SET(CPACK_DEBIAN_PACKAGE_DEPENDS
"libc6 (>= 2.11.0),
libgcc1 (>= 1:4.4.3),
libglib2.0-0 (>= 2.32),
libsdl1.2debian (>=1.2.14),
libsdl-mixer1.2 (>=1.2.8),
libsdl-net1.2 (>=1.2.7),
libsdl-image1.2 (>=1.2.12),
libpangocairo (>= 1.36),
libportmidi0 (>= 1:184-2.1),
libfluidsynth1 (>= 1.1.5-2),
libdumb1 (>= 1:0.9.3-5.4),
libgl1,
libxdiff (>= 0.23),
libenet1a (>= 1.3.3-2),
libcurl (>= 7.38.0-4),
bash"
)
SET(CPACK_DEBIAN_PACKAGE_RECOMMENDS
"boom-wad or doom-wad,
timidity,
game-data-packager"
)
SET(BUILD_ARCH "${CMAKE_SYSTEM_PROCESSOR}")
IF(${CMAKE_SYSTEM_PROCESSOR} MATCHES "i686")
SET(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "i386")
SET(CPACK_RPM_PACKAGE_ARCHITECTURE "i686" )
SET(BUILD_ARCH "${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}")
ENDIF()
IF(${CMAKE_SYSTEM_PROCESSOR} MATCHES "x86_64")
SET(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "amd64")
SET(CPACK_RPM_PACKAGE_ARCHITECTURE "x86_64" )
SET(BUILD_ARCH "${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}")
ENDIF()
IF(WIN32)
SET(BUILD_ARCH "windows-x86")
IF("$ENV{PROCESSOR_ARCHITECTURE}" STREQUAL "AMD64")
SET(BUILD_ARCH "windows-$ENV{PROCESSOR_ARCHITECTURE}")
ENDIF()
ENDIF()
SET(
CPACK_PACKAGE_FILE_NAME
"${CPACK_PACKAGE_NAME}-v${CPACK_PACKAGE_VERSION}_${BUILD_ARCH}"
)
SET(CPACK_DEBIAN_PACKAGE_NAME "${CPACK_PACKAGE_FILE_NAME}")
SET(CPACK_RPM_PACKAGE_NAME "${CPACK_PACKAGE_FILE_NAME}")
INCLUDE(CPack)
IF(CMAKE_C_COMPILER_ID STREQUAL "Clang")
SET(CLANG TRUE)
ELSE()
SET(CLANG FALSE)
ENDIF()
IF(CMAKE_C_COMPILER_ID STREQUAL "GNU")
SET(GCC TRUE)
ELSE()
SET(GCC FALSE)
ENDIF()
IF(CLANG OR GCC)
SET(GCC_OR_CLANG TRUE)
ELSE()
SET(GCC_OR_CLANG FALSE)
ENDIF()
#==============================================================================
##################################################### Platform Checks #########
#==============================================================================
IF(MINGW)
SET(CMAKE_REQUIRED_DEFINITIONS
${CMAKE_REQUIRED_DEFINITIONS} "-D__USE_MINGW_ANSI_STDIO=1"
)
ENDIF()
CHECK_INCLUDE_FILES("asm/byteorder.h" HAVE_ASM_BYTEORDER_H)
CHECK_INCLUDE_FILES("inttypes.h" HAVE_INTTYPES_H)
CHECK_INCLUDE_FILES("stdbool.h" HAVE_STDBOOL_H)
CHECK_INCLUDE_FILES("stdint.h" HAVE_STDINT_H)
CHECK_INCLUDE_FILES("sys/types.h" HAVE_SYS_TYPES_H)
CHECK_INCLUDE_FILES("sys/wait.h" HAVE_SYS_WAIT_H)
CHECK_INCLUDE_FILES("unistd.h" HAVE_UNISTD_H)
CHECK_SYMBOL_EXISTS(sys_siglist signal.h HAVE_DECL_SYS_SIGLIST)
CHECK_C_SOURCE_COMPILES(
"struct __attribute__((packed)) foo { int a; } b; int main() { return 0; }"
HAVE_ATTRIBUTE_PACKED
)
IF(HAVE_ATTRIBUTE_PACKED)
SET(PACKEDATTR "__attribute__((packed))")
ELSE()
MESSAGE(FATAL_ERROR "Can't figure out how to pack structs with your compiler")
ENDIF()
CHECK_FUNCTION_EXISTS("max" MAX)
CHECK_FUNCTION_EXISTS("min" MIN)
IF(MINGW OR WIN32)
CHECK_SYMBOL_EXISTS(MapViewOfFile windows.h HAVE_MMAP)
ELSE()
CHECK_FUNCTION_EXISTS("mmap" HAVE_MMAP)
ENDIF()
CHECK_FUNCTION_EXISTS("sched_setaffinity" HAVE_SCHED_SETAFFINITY)
CHECK_FUNCTION_EXISTS("usleep" HAVE_USLEEP)
CHECK_SYMBOL_EXISTS(_stricmp string.h HAVE__STRICMP)
CHECK_SYMBOL_EXISTS(stricmp string.h HAVE_STRICMP)
CHECK_SYMBOL_EXISTS(strcasecmp string.h HAVE_STRCASECMP)
CHECK_SYMBOL_EXISTS(_strnicmp string.h HAVE__STRNICMP)
CHECK_SYMBOL_EXISTS(strnicmp string.h HAVE_STRNICMP)
CHECK_SYMBOL_EXISTS(strncasecmp string.h HAVE_STRNCASECMP)
CHECK_LIBRARY_EXISTS("GL" "glFinish" "" HAVE_LIBGL)
CHECK_LIBRARY_EXISTS("GLU" "gluBuild2DMipmaps" "" HAVE_LIBGLU)
CHECK_LIBRARY_EXISTS("GLESv2" "glFinish" "" HAVE_LIBGLESv2)
CHECK_LIBRARY_EXISTS("SDL" "SDL_JoystickGetAxis" "" HAVE_SDL_JOYSTICKGETAXIS)
IF(HAVE_STRICMP)
SET(stricmp stricmp)
ELSE()
IF(HAVE__STRICMP)
SET(stricmp _stricmp)
ELSE()
IF(HAVE_STRCASECMP)
SET(stricmp strcasecmp)
ELSE()
MESSAGE(FATAL_ERROR "Neither _stricmp, stricmp, or strcasecmp found")
ENDIF()
ENDIF()
ENDIF()
IF(HAVE_STRNICMP)
SET(strnicmp strnicmp)
ELSE()
IF(HAVE__STRNICMP)
SET(strnicmp _strnicmp)
ELSE()
IF(HAVE_STRNCASECMP)
SET(strnicmp strncasecmp)
ELSE()
MESSAGE(FATAL_ERROR "Neither _strnicmp, strnicmp, or strncasecmp found")
ENDIF()
ENDIF()
ENDIF()
CHECK_SYMBOL_EXISTS(_snprintf string.h FOUND_string__SNPRINTF)
IF(FOUND_string_SNPRINTF)
SET(snprintf _snprintf)
ELSE()
CHECK_SYMBOL_EXISTS(snprintf string.h FOUND_string_SNPRINTF)
IF(FOUND_string_SNPRINTF)
SET(snprintf snprintf)
ELSE()
CHECK_SYMBOL_EXISTS(_snprintf stdio.h FOUND_stdio__SNPRINTF)
IF(FOUND_stdio_SNPRINTF)
SET(snprintf _snprintf)
ELSE()
CHECK_SYMBOL_EXISTS(snprintf stdio.h FOUND_stdio_SNPRINTF)
IF(FOUND_stdio_SNPRINTF)
SET(snprintf snprintf)
ELSE()
MESSAGE(FATAL_ERROR "Neither snprintf nor _snprintf found")
ENDIF()
ENDIF()
ENDIF()
ENDIF()
CHECK_SYMBOL_EXISTS(_vsnprintf string.h FOUND_string__VSNPRINTF)
IF(FOUND_string_VSNPRINTF)
SET(vsnprintf _vsnprintf)
ELSE()
CHECK_SYMBOL_EXISTS(vsnprintf string.h FOUND_string_VSNPRINTF)
IF(FOUND_string_VSNPRINTF)
SET(vsnprintf vsnprintf)
ELSE()
CHECK_SYMBOL_EXISTS(_vsnprintf stdio.h FOUND_stdio__VSNPRINTF)
IF(FOUND_stdio_VSNPRINTF)
SET(vsnprintf _vsnprintf)
ELSE()
CHECK_SYMBOL_EXISTS(vsnprintf stdio.h FOUND_stdio_VSNPRINTF)
IF(FOUND_stdio_VSNPRINTF)
SET(vsnprintf vsnprintf)
ELSE()
MESSAGE(FATAL_ERROR "Neither vsnprintf nor _vsnprintf found")
ENDIF()
ENDIF()
ENDIF()
ENDIF()
#==============================================================================
############################################################# Options #########
#==============================================================================
OPTION(DOOMWADDIR, "The path where Doom WADs are stored" "")
OPTION(
CHECK_HEAP "Exhaustively run memory checks while the game is running" OFF
)
OPTION(HEAPDUMP "Dump the heap on a crash" OFF)
OPTION(RANGECHECK "Enable internal range checking" OFF)
OPTION(
INSTRUMENTED
"Enable real-time memory allocation statistics and enable extra debugging features"
OFF
)
OPTION(
TIMEDIAG
"Create timestamps whenever a lump is locked; report when lumps are locked for long periods of time"
OFF
)
OPTION(
SIMPLECHECKS
"Enable quick checks which only impose significant overhead if a possible error is detected"
OFF
)
OPTION(
ZONEIDCHECK
"Perform ID checks on zone blocks to detect corrupted and illegally freed blocks"
OFF
)
OPTION(GL_DOOM "Build with OpenGL support" ON)
CMAKE_DEPENDENT_OPTION(USE_GLU_IMAGESCALE "Use gluImageScale" OFF USE_GLU OFF)
CMAKE_DEPENDENT_OPTION(USE_GLU_MIPMAP "Use gluBuild2DMipmaps" OFF USE_GLU OFF)
CMAKE_DEPENDENT_OPTION(USE_GLU_TESS "Use gluTesselator" OFF USE_GLU OFF)
OPTION(DOGS "Enable MBF helper dogs" ON)
OPTION(HIGHRES "Enable high resolution support" ON)
OPTION(
ONLY_FREE_GRAPHICS "Build prboom.wad without non-free menu text lumps" ON
)
OPTION(PROFILE "Enable profiling; requires a debug build" OFF)
OPTION(LEVELINFO_DEBUG "Debug using level info" OFF)
OPTION(DEBUG_WEAPON_CODEPOINTERS "Debug weapon codepointers" OFF)
OPTION(SANITIZE_ADDRESSES "Use Clang's address sanitizer, requires clang" OFF)
OPTION(ENABLE_OVERLAY "Enable new HUD widget overlay" OFF)
IF(NOT DOOMWADDIR)
SET(DOOMWADDIR "${CMAKE_INSTALL_PREFIX}/share/games/doom")
ENDIF()
#==============================================================================
################################################## Compiler: Features #########
#==============================================================================
IF(CMAKE_C_COMPILER_ID STREQUAL "GNU")
TRY_C_COMPILER_FLAG(--std=c99 FLAG_C_stdc99)
IF(PROFILE)
TRY_C_COMPILER_FLAG(-pg FLAG_C_profile)
ENDIF()
ENDIF()
#==============================================================================
################################################## Compiler: Warnings #########
#==============================================================================
IF(GCC_OR_CLANG)
TRY_C_COMPILER_FLAG(-Wall FLAG_C_Wall)
ENDIF()
IF(CMAKE_C_COMPILER_ID STREQUAL "Intel")
TRY_C_COMPILER_FLAG(-Wall FLAG_C_Wall)
TRY_C_COMPILER_FLAG(-Wcheck FLAG_C_Wcheck)
TRY_C_COMPILER_FLAG(-Wp64 FLAG_C_Wp64)
TRY_C_COMPILER_FLAG(-Wshorten-64-to-32 FLAG_C_Wshorten_64_to_32)
ENDIF()
IF(MSVC)
ADD_DEFINITIONS(-D_CRT_SECURE_NO_WARNINGS)
ADD_DEFINITIONS(-D_CRT_NONSTDC_NO_WARNINGS)
ENDIF()
#==============================================================================
################################################# Compiler: Hardening #########
#==============================================================================
IF(CMAKE_BUILD_TYPE STREQUAL "Debug")
ADD_DEFINITIONS(-DDEBUG)
IF(GCC_OR_CLANG)
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g")
ENDIF()
IF(GCC)
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O0")
ELSEIF(CLANG)
IF(SANITIZE_ADDRESSES)
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=address")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=address")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-omit-frame-pointer")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-optimize-sibling-calls")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O1")
ELSEIF(SANITIZE_MEMORY)
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=memory")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=memory")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-omit-frame-pointer")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-optimize-sibling-calls")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O1")
ELSEIF(SANITIZE_UNDEFINED)
SET(UB_FLAG "-fsanitize=undefined,unsigned-integer-overflow")
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${UB_FLAG}")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${UB_FLAG}")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-omit-frame-pointer")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O0")
ELSE()
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O0")
ENDIF()
ENDIF()
ELSE()
IF(GCC_OR_CLANG)
TRY_C_COMPILER_FLAG(-fstack-protector FLAG_C_fstack_protector)
IF(CMAKE_SYSTEM_NAME STREQUAL "Linux")
# TRY_C_COMPILER_FLAG(-fPIC FLAG_C_fPIC)
# TRY_C_COMPILER_FLAG(-pie FLAG_C_pie)
# TRY_C_COMPILER_FLAG(-Wl,-z,relro FLAG_C_Wl_z_relro)
# TRY_C_COMPILER_FLAG(-Wl,-z,now FLAG_C_Wl_z_now)
# TRY_C_COMPILER_FLAG(-Wl,--as-needed FLAG_C_Wl_as_needed)
# TRY_C_COMPILER_FLAG(-Wl,-z,noexecstack FLAG_C_Wl_z_noexecstack)
ENDIF()
ENDIF()
IF(CMAKE_C_COMPILER_ID STREQUAL "Intel")
TRY_C_COMPILER_FLAG(-fstack-protector FLAG_C_fstackprotector)
TRY_C_COMPILER_FLAG(-fPIC FLAG_C_fPIC)
TRY_C_COMPILER_FLAG(-pie FLAG_C_pie)
TRY_C_COMPILER_FLAG(-Wl,-z,relro FLAG_C_Wl_z_relro)
TRY_C_COMPILER_FLAG(-Wl,-z,now FLAG_C_Wl_z_now)
TRY_C_COMPILER_FLAG(-Wl,--as-needed FLAG_C_Wl_as_needed)
TRY_C_COMPILER_FLAG(-Wl,-z,noexecstack FLAG_C_Wl_z_noexecstack)
ENDIF()
IF(MSVC)
TRY_C_COMPILER_FLAG(/GS FLAG_C_GS)
ENDIF()
ENDIF()
#==============================================================================
############################################## Compiler: Optimization #########
#==============================================================================
IF(CMAKE_BUILD_TYPE STREQUAL "MinSizeRel" OR
CMAKE_BUILD_TYPE STREQUAL "Release")
IF(GCC_OR_CLANG)
TRY_C_COMPILER_FLAG(-fomit-frame-pointer FLAG_C_fomit_frame_pointer)
TRY_C_COMPILER_FLAG(-O3 FLAG_C_optimizations)
ENDIF()
IF(CMAKE_C_COMPILER_ID STREQUAL "Intel")
TRY_C_COMPILER_FLAG(-fomit-frame-pointer FLAG_C_fomit_frame_pointer)
TRY_C_COMPILER_FLAG(-ipo FLAG_C_ipo)
ENDIF()
ENDIF()
#==============================================================================
################################################### Find Dependencies #########
#==============================================================================
IF(ICONV_LIBRARIES)
SET(SAVED_ICONV_LIBRARIES ${ICONV_LIBRARIES})
ENDIF()
FIND_PACKAGE(Iconv REQUIRED)
INCLUDE_DIRECTORIES(${ICONV_INCLUDE_DIR})
IF(SAVED_ICONV_LIBRARIES)
SET(ICONV_LIBRARIES ${SAVED_ICONV_LIBRARIES})
ENDIF()
FIND_PACKAGE(ZLIB REQUIRED)
INCLUDE_DIRECTORIES(${ZLIB_INCLUDE_DIR})
IF(PNG_LIBRARIES)
SET(SAVED_PNG_LIBRARIES ${PNG_LIBRARIES})
ENDIF()
FIND_PACKAGE(PNG REQUIRED)
INCLUDE_DIRECTORIES(${PNG_INCLUDE_DIR})
IF(SAVED_PNG_LIBRARIES)
SET(PNG_LIBRARIES ${SAVED_PNG_LIBRARIES})
ENDIF()
SET(HAVE_LIBPNG TRUE)
FIND_PACKAGE(FFI REQUIRED)
INCLUDE_DIRECTORIES(${FFI_INCLUDE_DIR})
# IF(WIN32)
# FIND_PACKAGE(INTL REQUIRED)
# INCLUDE_DIRECTORIES(${INTL_INCLUDE_DIR})
# ENDIF()
FIND_PACKAGE(PCREPOSIX REQUIRED)
INCLUDE_DIRECTORIES(${PCRE_INCLUDE_DIR})
SET(HAVE_LIBPCREPOSIX TRUE)
IF(WIN32)
FIND_PACKAGE(GLib REQUIRED COMPONENTS
gio
gmodule
gobject
gthread
)
INCLUDE_DIRECTORIES(${GLIB_INCLUDE_DIRS})
ELSE()
FIND_PACKAGE(GLib REQUIRED COMPONENTS
gio
gmodule
gobject
gthread
gio-unix
)
INCLUDE_DIRECTORIES(${GLIB_INCLUDE_DIRS})
INCLUDE_DIRECTORIES(${GIO_UNIX_INCLUDE_DIRS})
ENDIF()
FIND_PACKAGE(Fontconfig REQUIRED)
INCLUDE_DIRECTORIES(${FONTCONFIG_INCLUDE_DIR})
IF(FREETYPE_LIBRARIES)
SET(SAVED_FREETYPE_LIBRARIES ${FREETYPE_LIBRARIES})
ENDIF()
FIND_PACKAGE(FreeType REQUIRED)
INCLUDE_DIRECTORIES(${FREETYPE_INCLUDE_DIRS})
IF(SAVED_FREETYPE_LIBRARIES)
SET(FREETYPE_LIBRARIES ${SAVED_FREETYPE_LIBRARIES})
ENDIF()
FIND_PACKAGE(HarfBuzz REQUIRED)
INCLUDE_DIRECTORIES(${HARFBUZZ_INCLUDE_DIR})
IF(EXPAT_LIBRARIES)
SET(SAVED_EXPAT_LIBRARIES ${EXPAT_LIBRARIES})
ENDIF()
FIND_PACKAGE(EXPAT REQUIRED)
INCLUDE_DIRECTORIES(${EXPAT_INCLUDE_DIR})
IF(SAVED_EXPAT_LIBRARIES)
SET(EXPAT_LIBRARIES ${SAVED_EXPAT_LIBRARIES})
ENDIF()
FIND_PACKAGE(Pixman REQUIRED)
INCLUDE_DIRECTORIES(${PIXMAN_INCLUDE_DIR})
FIND_PACKAGE(Cairo REQUIRED)
INCLUDE_DIRECTORIES(${CAIRO_INCLUDE_DIR})
IF(MINGW OR WIN32)
FIND_PACKAGE(Pango REQUIRED COMPONENTS
pangoft2
pangowin32
pangocairo
)
ELSEIF(APPLE)
FIND_PACKAGE(Pango REQUIRED COMPONENTS
pangoft2
pangocairo
)
ELSE()
FIND_PACKAGE(Pango REQUIRED COMPONENTS
pangoft2
pangoxft
pangocairo
)
ENDIF()
INCLUDE_DIRECTORIES(${PANGO_INCLUDE_DIR})
FIND_PACKAGE(GObjectIntrospection REQUIRED)
INCLUDE_DIRECTORIES(${GOBJECT_INTROSPECTION_INCLUDE_DIR})
FIND_PACKAGE(Jansson REQUIRED)
INCLUDE_DIRECTORIES(${JANSSON_INCLUDE_DIR})
FIND_PACKAGE(Lua52 REQUIRED)
INCLUDE_DIRECTORIES(${LUA_INCLUDE_DIR})
FIND_PACKAGE(LGI REQUIRED)
FIND_PACKAGE(XDiff REQUIRED)
INCLUDE_DIRECTORIES(${XDIFF_INCLUDE_DIR})
FIND_PACKAGE(ENet REQUIRED)
INCLUDE_DIRECTORIES(${ENET_INCLUDE_DIR})
FIND_PACKAGE(CURL REQUIRED)
INCLUDE_DIRECTORIES(${CURL_INCLUDE_DIR})
FIND_PACKAGE(SDL REQUIRED)
SET(HAVE_LIBSDL TRUE)
INCLUDE_DIRECTORIES(${SDL_INCLUDE_DIR})
FIND_PACKAGE(SDL_mixer REQUIRED)
SET(HAVE_LIBSDL_MIXER TRUE)
SET(HAVE_MIXER TRUE)
INCLUDE_DIRECTORIES(${SDLMIXER_INCLUDE_DIR})
FIND_PACKAGE(OpenGL)
IF(OPENGL_FOUND)
INCLUDE_DIRECTORIES(${OPENGL_INCLUDE_DIR})
ELSE()
IF(GL_DOOM)
MESSAGE(FATAL_ERROR "OpenGL not found")
ELSE()
MESSAGE(WARNING "OpenGL not found")
ENDIF()
ENDIF()
FIND_PACKAGE(LZMA)
IF(LZMA_FOUND)
INCLUDE_DIRECTORIES(${LZMA_INCLUDE_DIRS})
ELSE()
MESSAGE(FATAL_ERROR "LZMA (XZ) not found")
ENDIF()
IF(JPEG_LIBRARIES)
SET(SAVED_JPEG_LIBRARIES ${JPEG_LIBRARIES})
ENDIF()
FIND_PACKAGE(JPEG)
IF(JPEG_FOUND)
INCLUDE_DIRECTORIES(${JPEG_INCLUDE_DIR})
IF(SAVED_JPEG_LIBRARIES)
SET(JPEG_LIBRARIES ${SAVED_JPEG_LIBRARIES})
ENDIF()
SET(HAVE_LIBJPG TRUE)
ELSE()
MESSAGE(WARNING "JPEG library not found")
ENDIF()
IF(TIFF_LIBRARIES)
SET(SAVED_TIFF_LIBRARIES ${TIFF_LIBRARIES})
ENDIF()
FIND_PACKAGE(TIFF)
IF(TIFF_FOUND)
INCLUDE_DIRECTORIES(${TIFF_INCLUDE_DIR})
IF(SAVED_TIFF_LIBRARIES)
SET(TIFF_LIBRARIES ${SAVED_TIFF_LIBRARIES})
ENDIF()
SET(HAVE_LIBTIFF TRUE)
ELSE()
MESSAGE(WARNING "LibTIFF not found")
ENDIF()
FIND_PACKAGE(WebP)
IF(WEBP_FOUND)
INCLUDE_DIRECTORIES(${WEBP_INCLUDE_DIR})
SET(HAVE_WEBP TRUE)
ELSE()
MESSAGE(WARNING "WebP not found")
ENDIF()
FIND_PACKAGE(SDL_image)
IF(SDLIMAGE_FOUND)
INCLUDE_DIRECTORIES(${SDLIMAGE_INCLUDE_DIR})
SET(HAVE_LIBSDL_IMAGE TRUE)
ELSE()
MESSAGE(WARNING "SDL_image not found")
SET(HAVE_LIBSDL_IMAGE FALSE)
ENDIF()
FIND_PACKAGE(Dumb)
IF(DUMB_FOUND)
INCLUDE_DIRECTORIES(${DUMB_INCLUDE_DIR})
SET(HAVE_LIBDUMB TRUE)
ELSE()
MESSAGE(WARNING "Dumb not found")
ENDIF()
FIND_PACKAGE(PortMidi)
IF(PORTMIDI_FOUND)
INCLUDE_DIRECTORIES(${PORTMIDI_INCLUDE_DIR})
SET(HAVE_LIBPORTMIDI TRUE)
ELSE()
MESSAGE(WARNING "PortMidi not found")
ENDIF()
FIND_PACKAGE(FluidSynth)
IF(FLUIDSYNTH_FOUND)
INCLUDE_DIRECTORIES(${FLUIDSYNTH_INCLUDE_DIR})
SET(HAVE_LIBFLUIDSYNTH TRUE)
ELSE()
MESSAGE(WARNING "FluidSynth not found")
ENDIF()
FIND_PACKAGE(MikMod)
IF(MIKMOD_FOUND)
INCLUDE_DIRECTORIES(${MIKMOD_INCLUDE_DIR})
ELSE()
MESSAGE(WARNING "MikMod not found")
ENDIF()
FIND_PACKAGE(Mad)
IF(MAD_FOUND)
INCLUDE_DIRECTORIES(${MAD_INCLUDE_DIR})
SET(HAVE_LIBMAD TRUE)
ELSE()
MESSAGE(WARNING "Mad not found")
ENDIF()
FIND_PACKAGE(Vorbis)
IF(VORBIS_FOUND)
INCLUDE_DIRECTORIES(${VORBIS_INCLUDE_DIR})
SET(HAVE_LIBVORBISFILE TRUE)
ELSE()
MESSAGE(WARNING "Vorbis not found")
ENDIF()
FIND_PACKAGE(Ogg)
IF(OGG_FOUND)
INCLUDE_DIRECTORIES(${OGG_INCLUDE_DIR})
ELSE()
MESSAGE(WARNING "Ogg not found")
ENDIF()
FIND_PACKAGE(FLAC)
IF(FLAC_FOUND)
INCLUDE_DIRECTORIES(${FLAC_INCLUDE_DIR})
ELSE()
MESSAGE(WARNING "FLAC not found")
ENDIF()
IF(CMAKE_BUILD_TYPE STREQUAL "Debug")
FIND_PACKAGE(GPerf)
# MESSAGE(STATUS "Looking for Google Performance Tools")
# FIND_LIBRARY(GPERF_LIBRARIES profiler HINTS $ENV{GPERF_DIR})
IF(${GPERF_LIBRARIES} STREQUAL "GPERF_LIBRARIES-NOTFOUND")
IF(PROFILE)
MESSAGE(
WARNING
"Google Performance Tools not found, profiling will not work"
)
ENDIF()
ENDIF()
ENDIF()
CONFIGURE_FILE(
${CMAKE_CURRENT_SOURCE_DIR}/config.h.in
${CMAKE_CURRENT_BINARY_DIR}/config.h
)
#==============================================================================
################################################## Set Project Source #########
#==============================================================================
ADD_DEFINITIONS(-DHAVE_CONFIG_H)
INCLUDE_DIRECTORIES(${CMAKE_BINARY_DIR})
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/ICONS)
IF(GCC_OR_CLANG)
ADD_DEFINITIONS(-D_GNU_SOURCE)
ENDIF()
IF(MINGW)
ADD_DEFINITIONS(-D_GNU_SOURCE)
ADD_DEFINITIONS(-D__USE_MINGW_ANSI_STDIO=1)
# ADD_DEFINITIONS(-DPCRE_STATIC)
# ADD_DEFINITIONS(-DMIKMOD_STATIC)
# ADD_DEFINITIONS(-DFLUIDSYNTH_NOT_A_DLL)
TRY_C_COMPILER_FLAG(-mno-ms-bitfields FLAG_C_nomsbitfields)
ENDIF()
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/src/SDL)
SET(SDL_SOURCES
${CMAKE_SOURCE_DIR}/src/SDL/i_font.c
${CMAKE_SOURCE_DIR}/src/SDL/i_input.c
${CMAKE_SOURCE_DIR}/src/SDL/i_joy.c
${CMAKE_SOURCE_DIR}/src/SDL/i_emusic.c
${CMAKE_SOURCE_DIR}/src/SDL/i_mouse.c
${CMAKE_SOURCE_DIR}/src/SDL/i_music.c
${CMAKE_SOURCE_DIR}/src/SDL/i_network.c
${CMAKE_SOURCE_DIR}/src/SDL/i_sound.c
${CMAKE_SOURCE_DIR}/src/SDL/i_sshot.c
${CMAKE_SOURCE_DIR}/src/SDL/i_vid8ingl.c
${CMAKE_SOURCE_DIR}/src/SDL/i_video.c
)
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/src/PCSOUND)
SET(PCSOUND_SOURCES
${CMAKE_SOURCE_DIR}/src/PCSOUND/pcsound.c
${CMAKE_SOURCE_DIR}/src/PCSOUND/pcsound_sdl.c
)
IF(APPLE)
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/src/MAC)
FILE(GLOB ARCH_SPECIFIC_SOURCES ${CMAKE_SOURCE_DIR}/src/MAC/*.m)
ELSE()
IF(UNIX)
SET(ARCH_SPECIFIC_SOURCES ${ARCH_SPECIFIC_SOURCES}
${CMAKE_SOURCE_DIR}/src/PCSOUND/pcsound_linux.c
${CMAKE_SOURCE_DIR}/src/n_uds.c
)
ELSE()
# SET(ARCH_SPECIFIC_SOURCES ${CMAKE_SOURCE_DIR}/src/SDL/SDL_win32_main.c)
SET(ARCH_SPECIFIC_SOURCES ${ARCH_SPECIFIC_SOURCES}
${CMAKE_SOURCE_DIR}/src/PCSOUND/pcsound_win32.c
)
ENDIF()
ENDIF()
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/src/textscreen)
FILE(GLOB TEXTSCREEN_SOURCES ${CMAKE_SOURCE_DIR}/src/TEXTSCREEN/*.c)
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/src/MUSIC)
FILE(GLOB MUSIC_SOURCES ${CMAKE_SOURCE_DIR}/src/MUSIC/*.c)
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/src)
SET(D2K_SOURCES
${CMAKE_SOURCE_DIR}/src/am_map.c
${CMAKE_SOURCE_DIR}/src/c_cvar.c
${CMAKE_SOURCE_DIR}/src/c_eci.c
${CMAKE_SOURCE_DIR}/src/c_main.c
${CMAKE_SOURCE_DIR}/src/cl_cmd.c
${CMAKE_SOURCE_DIR}/src/cl_main.c
${CMAKE_SOURCE_DIR}/src/cl_net.c
${CMAKE_SOURCE_DIR}/src/cmp.c
${CMAKE_SOURCE_DIR}/src/d_cfg.c
${CMAKE_SOURCE_DIR}/src/d_deh.c
${CMAKE_SOURCE_DIR}/src/d_items.c
${CMAKE_SOURCE_DIR}/src/d_dump.c
${CMAKE_SOURCE_DIR}/src/d_main.c
${CMAKE_SOURCE_DIR}/src/d_msg.c
${CMAKE_SOURCE_DIR}/src/doomdef.c
${CMAKE_SOURCE_DIR}/src/doomstat.c
${CMAKE_SOURCE_DIR}/src/dstrings.c
${CMAKE_SOURCE_DIR}/src/e6y.c
${CMAKE_SOURCE_DIR}/src/e6y_launcher.c
${CMAKE_SOURCE_DIR}/src/f_finale.c
${CMAKE_SOURCE_DIR}/src/f_wipe.c
${CMAKE_SOURCE_DIR}/src/g_game.c
${CMAKE_SOURCE_DIR}/src/g_keys.c
${CMAKE_SOURCE_DIR}/src/g_overflow.c
${CMAKE_SOURCE_DIR}/src/g_save.c
${CMAKE_SOURCE_DIR}/src/g_state.c
${CMAKE_SOURCE_DIR}/src/hu_lib.c
${CMAKE_SOURCE_DIR}/src/hu_stuff.c
${CMAKE_SOURCE_DIR}/src/hu_tracers.c
${CMAKE_SOURCE_DIR}/src/i_capture.c
${CMAKE_SOURCE_DIR}/src/i_pcsound.c
${CMAKE_SOURCE_DIR}/src/i_smp.c
${CMAKE_SOURCE_DIR}/src/info.c
${CMAKE_SOURCE_DIR}/src/m_avg.c
${CMAKE_SOURCE_DIR}/src/m_bbox.c
${CMAKE_SOURCE_DIR}/src/m_buf.c
${CMAKE_SOURCE_DIR}/src/m_cheat.c
${CMAKE_SOURCE_DIR}/src/m_delta.c
${CMAKE_SOURCE_DIR}/src/m_file.c
${CMAKE_SOURCE_DIR}/src/m_menu.c
${CMAKE_SOURCE_DIR}/src/m_misc.c
${CMAKE_SOURCE_DIR}/src/m_pbuf.c
${CMAKE_SOURCE_DIR}/src/m_random.c
${CMAKE_SOURCE_DIR}/src/md5.c
${CMAKE_SOURCE_DIR}/src/n_addr.c
${CMAKE_SOURCE_DIR}/src/n_chan.c
${CMAKE_SOURCE_DIR}/src/n_com.c
${CMAKE_SOURCE_DIR}/src/n_dirsrv.c
${CMAKE_SOURCE_DIR}/src/n_http.c
${CMAKE_SOURCE_DIR}/src/n_main.c
${CMAKE_SOURCE_DIR}/src/n_misc.c
${CMAKE_SOURCE_DIR}/src/n_msg.c
${CMAKE_SOURCE_DIR}/src/n_net.c
${CMAKE_SOURCE_DIR}/src/n_pack.c
${CMAKE_SOURCE_DIR}/src/n_peer.c
${CMAKE_SOURCE_DIR}/src/n_proto.c
${CMAKE_SOURCE_DIR}/src/n_sync.c
${CMAKE_SOURCE_DIR}/src/p_ceilng.c
${CMAKE_SOURCE_DIR}/src/p_checksum.c
${CMAKE_SOURCE_DIR}/src/p_cmd.c
${CMAKE_SOURCE_DIR}/src/p_doors.c
${CMAKE_SOURCE_DIR}/src/p_enemy.c
${CMAKE_SOURCE_DIR}/src/p_floor.c
${CMAKE_SOURCE_DIR}/src/p_genlin.c
${CMAKE_SOURCE_DIR}/src/p_ident.c
${CMAKE_SOURCE_DIR}/src/p_inter.c
${CMAKE_SOURCE_DIR}/src/p_lights.c
${CMAKE_SOURCE_DIR}/src/p_map.c
${CMAKE_SOURCE_DIR}/src/p_maputl.c
${CMAKE_SOURCE_DIR}/src/p_mobj.c
${CMAKE_SOURCE_DIR}/src/p_plats.c
${CMAKE_SOURCE_DIR}/src/p_pspr.c
${CMAKE_SOURCE_DIR}/src/p_saveg.c
${CMAKE_SOURCE_DIR}/src/p_setup.c
${CMAKE_SOURCE_DIR}/src/p_sight.c
${CMAKE_SOURCE_DIR}/src/p_spec.c
${CMAKE_SOURCE_DIR}/src/p_switch.c
${CMAKE_SOURCE_DIR}/src/p_telept.c
${CMAKE_SOURCE_DIR}/src/p_tick.c
${CMAKE_SOURCE_DIR}/src/p_user.c
${CMAKE_SOURCE_DIR}/src/r_bsp.c
${CMAKE_SOURCE_DIR}/src/r_data.c
${CMAKE_SOURCE_DIR}/src/r_demo.c
${CMAKE_SOURCE_DIR}/src/r_draw.c
${CMAKE_SOURCE_DIR}/src/r_filter.c
${CMAKE_SOURCE_DIR}/src/r_fps.c
${CMAKE_SOURCE_DIR}/src/r_main.c
${CMAKE_SOURCE_DIR}/src/r_patch.c
${CMAKE_SOURCE_DIR}/src/r_plane.c
${CMAKE_SOURCE_DIR}/src/r_screenmultiply.c
${CMAKE_SOURCE_DIR}/src/r_segs.c
${CMAKE_SOURCE_DIR}/src/r_sky.c
${CMAKE_SOURCE_DIR}/src/r_things.c
${CMAKE_SOURCE_DIR}/src/s_advsound.c
${CMAKE_SOURCE_DIR}/src/s_sndnew.c
${CMAKE_SOURCE_DIR}/src/s_sndold.c
${CMAKE_SOURCE_DIR}/src/s_sound.c
${CMAKE_SOURCE_DIR}/src/sc_man.c
${CMAKE_SOURCE_DIR}/src/sounds.c
${CMAKE_SOURCE_DIR}/src/st_lib.c
${CMAKE_SOURCE_DIR}/src/st_stuff.c
${CMAKE_SOURCE_DIR}/src/sv_main.c
${CMAKE_SOURCE_DIR}/src/tables.c
${CMAKE_SOURCE_DIR}/src/v_overlay.c
${CMAKE_SOURCE_DIR}/src/v_video.c
${CMAKE_SOURCE_DIR}/src/version.c
${CMAKE_SOURCE_DIR}/src/w_wad.c
${CMAKE_SOURCE_DIR}/src/wi_stuff.c
${CMAKE_SOURCE_DIR}/src/x_main.c
${CMAKE_SOURCE_DIR}/src/z_bmalloc.c
${CMAKE_SOURCE_DIR}/src/z_zone.c
${CMAKE_SOURCE_DIR}/src/xam_main.c
${CMAKE_SOURCE_DIR}/src/xc_main.c
${CMAKE_SOURCE_DIR}/src/xcl_main.c
${CMAKE_SOURCE_DIR}/src/xd_cfg.c
${CMAKE_SOURCE_DIR}/src/xd_comp.c
${CMAKE_SOURCE_DIR}/src/xd_main.c
${CMAKE_SOURCE_DIR}/src/xd_msg.c
${CMAKE_SOURCE_DIR}/src/xg_game.c
${CMAKE_SOURCE_DIR}/src/xg_keys.c
${CMAKE_SOURCE_DIR}/src/xi_input.c
${CMAKE_SOURCE_DIR}/src/xi_main.c
${CMAKE_SOURCE_DIR}/src/xm_menu.c
${CMAKE_SOURCE_DIR}/src/xm_misc.c
${CMAKE_SOURCE_DIR}/src/xn_main.c
${CMAKE_SOURCE_DIR}/src/xp_user.c
${CMAKE_SOURCE_DIR}/src/xr_main.c
${CMAKE_SOURCE_DIR}/src/xr_demo.c
${CMAKE_SOURCE_DIR}/src/xs_main.c
${CMAKE_SOURCE_DIR}/src/xst_main.c
${CMAKE_SOURCE_DIR}/src/xv_main.c
)
SET(CLIENT_SOURCES
${CMAKE_SOURCE_DIR}/src/SDL/i_main.c
${CMAKE_SOURCE_DIR}/src/SDL/i_system.c
${CMAKE_SOURCE_DIR}/src/m_argv.c
)
SET(GL_SOURCES
${CMAKE_SOURCE_DIR}/src/gl_clipper.c
${CMAKE_SOURCE_DIR}/src/gl_detail.c
${CMAKE_SOURCE_DIR}/src/gl_drawinfo.c
${CMAKE_SOURCE_DIR}/src/gl_fbo.c
${CMAKE_SOURCE_DIR}/src/gl_gamma.c
${CMAKE_SOURCE_DIR}/src/gl_hires.c
${CMAKE_SOURCE_DIR}/src/gl_hqresize.c
${CMAKE_SOURCE_DIR}/src/gl_light.c
${CMAKE_SOURCE_DIR}/src/gl_main.c
${CMAKE_SOURCE_DIR}/src/gl_map.c
${CMAKE_SOURCE_DIR}/src/gl_missingtexture.c
${CMAKE_SOURCE_DIR}/src/gl_opengl.c
${CMAKE_SOURCE_DIR}/src/gl_preprocess.c
${CMAKE_SOURCE_DIR}/src/gl_shader.c
${CMAKE_SOURCE_DIR}/src/gl_shadow.c
${CMAKE_SOURCE_DIR}/src/gl_sky.c
${CMAKE_SOURCE_DIR}/src/gl_soft2gl.c
${CMAKE_SOURCE_DIR}/src/gl_texture.c
${CMAKE_SOURCE_DIR}/src/gl_vertex.c
${CMAKE_SOURCE_DIR}/src/gl_wipe.c
)
IF(HAVE_MMAP)
SET(WAD_SOURCES ${CMAKE_SOURCE_DIR}/src/w_mmap.c)
ELSE()
SET(WAD_SOURCES ${CMAKE_SOURCE_DIR}/src/w_memcache.c)
ENDIF()
SET(MUS2MID_SOURCES
${CMAKE_SOURCE_DIR}/src/memio.c
${CMAKE_SOURCE_DIR}/src/mus2mid.c
)
SET(D2K_CLIENT_SOURCES
${ARCH_SPECIFIC_SOURCES}
${SDL_SOURCES}
${PCSOUND_SOURCES}
${TEXTSCREEN_SOURCES}
${MUSIC_SOURCES}
${D2K_SOURCES}
${CLIENT_SOURCES}
${MUS2MID_SOURCES}
${WAD_SOURCES}
)
IF(GL_DOOM)