forked from AZO234/NP2kai
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
1302 lines (1171 loc) · 68.3 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
cmake_minimum_required(VERSION 3.10)
project(
NP2kai
VERSION 0.86.0.22
DESCRIPTION "NEC PC-98x1 and EPSON PC-x86 emulator"
HOMEPAGE_URL "http://domisan.sakura.ne.jp/article/np2kai/np2kai.html"
LANGUAGES C CXX
)
cmake_policy(SET CMP0076 NEW)
list(APPEND CMAKE_MODULE_PATH "${NP2kai_SOURCE_DIR}/cmake")
# Windows
if(WIN32 OR MSVC_VERSION OR MINGW OR MSYS OR CYGWIN)
set(NP2kai_Windows true)
endif()
# Git
find_package(Git)
# NP2kai Git version
if(DEFINED ENV{NP2KAI_VERSION})
set(NP2kai_GIT_TAG $ENV{NP2KAI_VERSION})
else()
execute_process(COMMAND ${GIT_EXECUTABLE} describe --tags --abbrev=0 OUTPUT_VARIABLE NP2kai_GIT_TAG OUTPUT_STRIP_TRAILING_WHITESPACE RESULT_VARIABLE git_result)
message(${git_result})
if(NOT git_result EQUAL 0)
message(FATAL_ERROR "Need Git command to build NP2kai.")
endif()
endif()
if(DEFINED ENV{NP2KAI_HASH})
set(NP2kai_GIT_HASH $ENV{NP2KAI_HASH})
else()
execute_process(COMMAND ${GIT_EXECUTABLE} rev-parse --short HEAD OUTPUT_VARIABLE NP2kai_GIT_HASH OUTPUT_STRIP_TRAILING_WHITESPACE RESULT_VARIABLE git_result)
if(NOT git_result EQUAL 0)
message(FATAL_ERROR "Need Git command to build NP2kai.")
endif()
endif()
if(NOT NP2kai_GIT_TAG)
message(FATAL_ERROR "Need Git command to build NP2kai.")
endif()
if(NOT NP2kai_GIT_HASH)
message(FATAL_ERROR "Need Git command to build NP2kai.")
endif()
set(NP2kai_GIT_VERSION "${NP2kai_GIT_TAG} ${NP2kai_GIT_HASH}")
message("*** NP2kai version is ${NP2kai_GIT_TAG} ${NP2kai_GIT_HASH}")
if(MSVC_VERSION)
# vcpkg
if(DEFINED ENV{VCPKG_ROOT})
message("-- Found vcpkg")
set(CMAKE_TOOLCHAIN_FILE $ENV{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake CACHE STRING "")
else()
message(FATAL_ERROR "-- Not found vcpkg")
endif()
endif()
# NP2kai include dirs
list(APPEND NP2kai_common_include_dirs "${NP2kai_SOURCE_DIR}")
list(APPEND NP2kai_normal_include_dirs "i286c")
list(APPEND NP2kai_ia32_include_dirs "i386c" "i386c/ia32")
list(APPEND NP2kai_SDL_include_dirs "sdl")
list(APPEND NP2kai_SDL_Windows_include_dirs ${NP2kai_SDL_include_dirs} "sdl/windows")
list(APPEND NP2kai_SDL_UNIX_include_dirs ${NP2kai_SDL_include_dirs} "sdl/unix")
list(APPEND NP2kai_libretro_include_dirs ${NP2kai_SDL_include_dirs} "sdl/libretro")
list(APPEND NP2kai_Emscripten_include_dirs ${NP2kai_SDL_include_dirs} "sdl/em")
list(APPEND NP2kai_OpenDingux_include_dirs ${NP2kai_SDL_include_dirs} "sdl/opendingux")
list(APPEND NP2kai_X_include_dirs "x")
list(APPEND NP2kai_Windows_include_dirs "windows" "windows/misc")
# NP2kai sources
list(APPEND NP2kai_common_sources "calendar.c")
list(APPEND NP2kai_common_sources "debugsnapshot.c")
list(APPEND NP2kai_common_sources "keystat.c")
list(APPEND NP2kai_common_sources "nevent.c")
list(APPEND NP2kai_common_sources "pccore.c")
list(APPEND NP2kai_common_sources "statsave.c")
list(APPEND NP2kai_common_sources "timing.c")
file(GLOB_RECURSE NP2kai_temp "bios/*.c")
list(APPEND NP2kai_common_sources ${NP2kai_temp})
file(GLOB_RECURSE NP2kai_temp "cbus/*.c")
list(APPEND NP2kai_common_sources ${NP2kai_temp})
list(APPEND NP2kai_common_sources "codecnv/eucsjis.c")
list(APPEND NP2kai_common_sources "codecnv/eucucs2.c")
list(APPEND NP2kai_common_sources "codecnv/jisucs2.c")
list(APPEND NP2kai_common_sources "codecnv/sjiseuc.c")
list(APPEND NP2kai_common_sources "codecnv/sjisucs2.c")
list(APPEND NP2kai_common_sources "codecnv/tcswap16.c")
list(APPEND NP2kai_common_sources "codecnv/tcswap32.c")
list(APPEND NP2kai_common_sources "codecnv/ucs2sjis.c")
list(APPEND NP2kai_common_sources "codecnv/ucs2ucs4.c")
list(APPEND NP2kai_common_sources "codecnv/ucs2utf8.c")
list(APPEND NP2kai_common_sources "codecnv/ucs4ucs2.c")
list(APPEND NP2kai_common_sources "codecnv/ucs4utf8.c")
list(APPEND NP2kai_common_sources "codecnv/utf8ucs2.c")
list(APPEND NP2kai_common_sources "codecnv/utf8ucs4.c")
file(GLOB_RECURSE NP2kai_temp "common/*.c")
list(APPEND NP2kai_common_sources ${NP2kai_temp})
file(GLOB NP2kai_temp "diskimage/*.c")
list(APPEND NP2kai_common_sources ${NP2kai_temp})
list(APPEND NP2kai_common_sources "diskimage/cd/cdd_ccd.c")
list(APPEND NP2kai_common_sources "diskimage/cd/cdd_cue.c")
list(APPEND NP2kai_common_sources "diskimage/cd/cdd_iso.c")
list(APPEND NP2kai_common_sources "diskimage/cd/cdd_mds.c")
list(APPEND NP2kai_common_sources "diskimage/cd/cdd_nrg.c")
file(GLOB_RECURSE NP2kai_temp "diskimage/fd/*.c")
list(APPEND NP2kai_common_sources ${NP2kai_temp})
file(GLOB_RECURSE NP2kai_temp "fdd/*.c")
list(APPEND NP2kai_common_sources ${NP2kai_temp})
file(GLOB_RECURSE NP2kai_temp "font/*.c")
list(APPEND NP2kai_common_sources ${NP2kai_temp})
file(GLOB_RECURSE NP2kai_temp "generic/*.c")
list(APPEND NP2kai_common_sources ${NP2kai_temp})
file(GLOB_RECURSE NP2kai_temp "io/*.c")
list(APPEND NP2kai_common_sources ${NP2kai_temp})
file(GLOB_RECURSE NP2kai_temp "lio/*.c")
list(APPEND NP2kai_common_sources ${NP2kai_temp})
file(GLOB_RECURSE NP2kai_temp "mem/*.c")
list(APPEND NP2kai_common_sources ${NP2kai_temp})
list(APPEND NP2kai_common_sources "sound/adpcmc.c")
list(APPEND NP2kai_common_sources "sound/adpcmg.c")
list(APPEND NP2kai_common_sources "sound/beepc.c")
list(APPEND NP2kai_common_sources "sound/beepg.c")
list(APPEND NP2kai_common_sources "sound/cs4231c.c")
list(APPEND NP2kai_common_sources "sound/cs4231g.c")
list(APPEND NP2kai_common_sources "sound/fmboard.c")
list(APPEND NP2kai_common_sources "sound/oplgenc.c")
list(APPEND NP2kai_common_sources "sound/oplgeng.c")
list(APPEND NP2kai_common_sources "sound/opngenc.c")
list(APPEND NP2kai_common_sources "sound/opngeng.c")
list(APPEND NP2kai_common_sources "sound/opntimer.c")
list(APPEND NP2kai_common_sources "sound/pcm86c.c")
list(APPEND NP2kai_common_sources "sound/pcm86g.c")
list(APPEND NP2kai_common_sources "sound/pcmmix.c")
list(APPEND NP2kai_common_sources "sound/psggenc.c")
list(APPEND NP2kai_common_sources "sound/psggeng.c")
list(APPEND NP2kai_common_sources "sound/rhythmc.c")
list(APPEND NP2kai_common_sources "sound/s98.c")
list(APPEND NP2kai_common_sources "sound/sndcsec.c")
list(APPEND NP2kai_common_sources "sound/sound.c")
list(APPEND NP2kai_common_sources "sound/soundrom.c")
list(APPEND NP2kai_common_sources "sound/tms3631c.c")
list(APPEND NP2kai_common_sources "sound/tms3631g.c")
file(GLOB_RECURSE NP2kai_temp "sound/fmgen/*.c" "sound/fmgen/*.cpp")
list(APPEND NP2kai_common_sources ${NP2kai_temp})
file(GLOB_RECURSE NP2kai_temp "sound/getsnd/*.c")
list(APPEND NP2kai_common_sources ${NP2kai_temp})
file(GLOB_RECURSE NP2kai_temp "sound/mame/*.c")
list(APPEND NP2kai_common_sources ${NP2kai_temp})
file(GLOB_RECURSE NP2kai_temp "sound/vermouth/*.c")
list(APPEND NP2kai_common_sources ${NP2kai_temp})
file(GLOB_RECURSE NP2kai_temp "trap/*.c")
list(APPEND NP2kai_common_sources ${NP2kai_temp})
file(GLOB_RECURSE NP2kai_temp "vram/*.c")
list(APPEND NP2kai_common_sources ${NP2kai_temp})
file(GLOB_RECURSE NP2kai_temp "wab/*.c")
list(APPEND NP2kai_common_sources ${NP2kai_temp})
list(APPEND NP2kai_normal_sources "debugsub.c")
file(GLOB_RECURSE NP2kai_temp "i286c/*.c")
list(APPEND NP2kai_normal_sources ${NP2kai_temp})
list(APPEND NP2kai_ia32_sources "debugsub386.c")
file(GLOB NP2kai_temp "i386c/*.c")
list(APPEND NP2kai_ia32_sources ${NP2kai_temp})
file(GLOB NP2kai_temp "i386c/ia32/*.c")
list(APPEND NP2kai_ia32_sources ${NP2kai_temp})
file(GLOB NP2kai_temp "i386c/ia32/instructions/*.c")
list(APPEND NP2kai_ia32_sources ${NP2kai_temp})
list(APPEND NP2kai_ia32_sources "i386c/ia32/instructions/fpu/fpdummy.c")
list(APPEND NP2kai_ia32_sources "i386c/ia32/instructions/fpu/fpemul_dosbox.c")
list(APPEND NP2kai_ia32_sources "i386c/ia32/instructions/fpu/fpemul_dosbox2.c")
list(APPEND NP2kai_ia32_sources "i386c/ia32/instructions/fpu/fpemul_softfloat.c")
file(GLOB NP2kai_temp "i386c/ia32/instructions/fpu/softfloat/*.c")
list(APPEND NP2kai_ia32_sources ${NP2kai_temp})
list(APPEND NP2kai_ia32_sources "i386c/ia32/instructions/mmx/3dnow.c")
list(APPEND NP2kai_ia32_sources "i386c/ia32/instructions/mmx/mmx.c")
list(APPEND NP2kai_ia32_sources "i386c/ia32/instructions/sse/sse.c")
list(APPEND NP2kai_ia32_sources "i386c/ia32/instructions/sse2/sse2.c")
list(APPEND NP2kai_ia32_sources "i386c/ia32/instructions/sse3/sse3.c")
file(GLOB_RECURSE NP2kai_temp "i386hax/*.c")
list(APPEND NP2kai_HAXM_sources ${NP2kai_temp})
file(GLOB NP2kai_temp "sdl/*.c")
list(APPEND NP2kai_SDL_sources ${NP2kai_temp})
file(GLOB_RECURSE NP2kai_temp "embed/*.c")
list(APPEND NP2kai_SDL_sources ${NP2kai_temp})
list(APPEND NP2kai_SDL_sources "codecnv/textcnv.c")
list(APPEND NP2kai_SDL_sources "sound/opl3.c")
list(APPEND NP2kai_SDL_sources "sound/opna.c")
list(APPEND NP2kai_SDL_Windows_sources "sdl/windows/main.c")
list(APPEND NP2kai_SDL_UNIX_sources "sdl/unix/main.c")
list(APPEND NP2kai_libretro_sources "sdl/libretro/libretro.c")
list(APPEND NP2kai_OpenDingux_sources "sdl/opendingux/main.c")
file(GLOB NP2kai_temp "x/*.c")
list(APPEND NP2kai_X_sources ${NP2kai_temp})
list(APPEND NP2kai_X_sources "x/gtk2/dialog_about.c")
list(APPEND NP2kai_X_sources "x/gtk2/dialog_calendar.c")
list(APPEND NP2kai_X_sources "x/gtk2/dialog_config.c")
list(APPEND NP2kai_X_sources "x/gtk2/dialog_hostdrv.c")
list(APPEND NP2kai_X_sources "x/gtk2/dialog_ide.c")
list(APPEND NP2kai_X_sources "x/gtk2/dialog_midi.c")
list(APPEND NP2kai_X_sources "x/gtk2/dialog_network.c")
list(APPEND NP2kai_X_sources "x/gtk2/dialog_newdisk.c")
list(APPEND NP2kai_X_sources "x/gtk2/dialog_pci.c")
list(APPEND NP2kai_X_sources "x/gtk2/dialog_screen.c")
list(APPEND NP2kai_X_sources "x/gtk2/dialog_serial.c")
list(APPEND NP2kai_X_sources "x/gtk2/dialog_sound.c")
list(APPEND NP2kai_X_sources "x/gtk2/dialog_wab.c")
list(APPEND NP2kai_X_sources "x/gtk2/gtk_drawmng.c")
list(APPEND NP2kai_X_sources "x/gtk2/gtk_mouse.c")
list(APPEND NP2kai_X_sources "x/gtk2/gtk_keyboard.c")
list(APPEND NP2kai_X_sources "x/gtk2/gtk_main.c")
list(APPEND NP2kai_X_sources "x/gtk2/gtk_menu.c")
list(APPEND NP2kai_X_sources "x/gtk2/gtk_mouse.c")
list(APPEND NP2kai_X_sources "x/gtk2/gtk_screen.c")
list(APPEND NP2kai_X_sources "x/gtk2/gtk_wrapper.c")
list(APPEND NP2kai_X_sources "x/gtk2/window_keydisp.c")
list(APPEND NP2kai_X_sources "x/gtk2/window_softkbd.c")
list(APPEND NP2kai_X_sources "codecnv/textcnv.c")
file(GLOB_RECURSE NP2kai_temp "x/misc/*.cpp")
list(APPEND NP2kai_X_sources ${NP2kai_temp})
file(GLOB_RECURSE NP2kai_temp "x/ext/*.cpp")
list(APPEND NP2kai_X_sources ${NP2kai_temp})
list(APPEND NP2kai_Windows_sources "diskimage/cd/cdd_real.c")
#file(GLOB_RECURSE NP2kai_temp "windows/*.c" "windows/*.cpp")
file(GLOB NP2kai_temp "windows/*.cpp")
list(APPEND NP2kai_Windows_sources ${NP2kai_temp})
file(GLOB NP2kai_temp "windows/commng/*.cpp")
list(APPEND NP2kai_Windows_sources ${NP2kai_temp})
file(GLOB NP2kai_temp "windows/commng/wintab/*.cpp")
list(APPEND NP2kai_Windows_sources ${NP2kai_temp})
file(GLOB NP2kai_temp "windows/debuguty/*.cpp")
list(APPEND NP2kai_Windows_sources ${NP2kai_temp})
file(GLOB NP2kai_temp "windows/dialog/*.c" "windows/dialog/*.cpp")
list(APPEND NP2kai_Windows_sources ${NP2kai_temp})
file(GLOB_RECURSE NP2kai_temp "windows/ext/*.cpp")
list(APPEND NP2kai_Windows_sources ${NP2kai_temp})
file(GLOB NP2kai_temp "windows/misc/*.cpp")
list(APPEND NP2kai_Windows_sources ${NP2kai_temp})
file(GLOB NP2kai_temp "windows/resources/*.cpp")
list(APPEND NP2kai_Windows_sources ${NP2kai_temp})
file(GLOB_RECURSE NP2kai_temp "windows/soundmng/*.cpp")
list(APPEND NP2kai_Windows_sources ${NP2kai_temp})
file(GLOB NP2kai_temp "windows/subwnd/*.cpp")
list(APPEND NP2kai_Windows_sources ${NP2kai_temp})
list(APPEND NP2kai_Windows_sources "windows/resources/1252/np2.rc")
# NP2kai definitions
list(APPEND NP2kai_common_definitions "BIOS_IO_EMULATION" "OSLANG_UTF8" "SUPPORT_8BPP" "SUPPORT_16BPP" "SUPPORT_24BPP" "SUPPORT_32BPP" "SUPPORT_CL_GD5430" "SUPPORT_CRT15KHZ" "SUPPORT_FAST_MEMORYCHECK" "SUPPORT_FMGEN" "SUPPORT_GPIB" "SUPPORT_HOSTDRV" "SUPPORT_HRTIMER" "SUPPORT_IDEIO" "SUPPORT_IDEIO_48BIT" "SUPPORT_KAI_IMAGES" "SUPPORT_LARGE_HDD" "SUPPORT_NORMALDISP" "SUPPORT_PC9861K" "SUPPORT_PX" "SUPPORT_RESUME" "SUPPORT_RS232C_FIFO" "SUPPORT_S98" "SUPPORT_SCSI" "SUPPORT_SMPU98" "SUPPORT_SOFTKBD=0" "SUPPORT_SOUND_SB16" "SUPPORT_STATSAVE=10" "SUPPORT_UTF8" "SUPPORT_V30EXT" "SUPPORT_V30ORIGINAL" "SUPPORT_VIDEOFILTER" "SUPPORT_VPCVHD" "SUPPORT_WAB" "USE_MAME" "VAEG_FIX" "VERMOUTH_LIB")
list(APPEND NP2kai_extra_definitions "SUPPORT_SMPU98" "SUPPORT_NVL_IMAGES" "SUPPORT_SWSEEKSND" "SUPPORT_SWWABRLYSND")
list(APPEND NP2kai_ia32_definitions "CPUCORE_IA32" "IA32_PAGING_EACHSIZE" "IA32_REBOOT_ON_PANIC" "SUPPORT_CRT31KHZ" "SUPPORT_FPU_DOSBOX" "SUPPORT_FPU_DOSBOX2" "SUPPORT_FPU_SOFTFLOAT" "SUPPORT_GAMEPORT" "SUPPORT_MEMDBG32" "SUPPORT_LARGE_MEMORY" "SUPPORT_PC9801_119" "SUPPORT_PC9821" "SUPPORT_PCI" "SUPPORT_PEGC" "SUPPORT_SOUND_SB16" "SUPPORT_VGA_MODEX" "USE_3DNOW" "USE_FASTPAGING" "USE_FPU" "USE_MMX" "USE_SSE" "USE_SSE2" "USE_SSE3" "USE_TSC" "USE_VME")
list(APPEND NP2kai_SDL_definitions "NP2_SDL" "SUPPORT_BMS")
if(NP2kai_Windows)
list(APPEND NP2kai_LinkBreak_definitions "OSLINEBREAK_CRLF")
else()
list(APPEND NP2kai_LinkBreak_definitions "OSLINEBREAK_LF")
endif()
list(APPEND NP2kai_X_definitions "NP2_X" "USE_RESOURCE_BMP" "SUPPORT_BMS")
list(APPEND NP2kai_Windows_definitions "NP2_WIN" "USE_RESOURCE_BMP" "SUPPORT_MULTITHREAD")
# build type
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "RelWithDebInfo")
endif()
if(NOT EMSCRIPTEN)
set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g -Wall -DDEBUG -DTRACE")
set(CMAKE_CXX_FLAGS_RELEASE "-O2 -Wall -DNDEBUG")
set(CMAKE_CXX_FLAGS_MINSIZEREL "-Os -Wall")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-Og -g -Wall -DNDEBUG")
endif()
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
# build option
option(BUILD_OPENDINGUX_GCW0 "Build OpenDingux GCW0 port" OFF)
option(BUILD_OPENDINGUX_RG350 "Build OpenDingux RG350 port" OFF)
option(BUILD_OPENDINGUX_RS90 "Build OpenDingux RS90 port" OFF)
if(EMSCRIPTEN)
elseif(BUILD_OPENDINGUX_GCW0)
include("cmake/CrossOpenDinguxGCW0.cmake")
elseif(BUILD_OPENDINGUX_RG350)
include("cmake/CrossOpenDinguxRG350.cmake")
elseif(BUILD_OPENDINGUX_RS90)
include("cmake/CrossOpenDinguxRS90.cmake")
endif()
if(OPENDINGUX)
option(USE_OPENDINGUX_VGA "OpenDingux has VGA display" OFF)
if(USE_OPENDINGUX_VGA)
list(APPEND OPENDINGUX_VGA_definitions "OPENDINGUX_VGA")
endif()
endif()
if(NOT CMAKE_CROSSCOMPILING)
if(MINGW OR MSYS OR CYGWIN OR CMAKE_HOST_APPLE)
option(BUILD_SDL "Build SDL port" ON)
else()
option(BUILD_SDL "Build SDL port" OFF)
endif()
if(UNIX AND NOT CMAKE_HOST_APPLE)
option(BUILD_X "Build X port" ON)
else()
option(BUILD_X "Build X port" OFF)
endif()
option(BUILD_HAXM "Build HAXM port" OFF)
option(USE_HAXM "Use HAXM" OFF)
option(USE_X "Use X" OFF)
if(BUILD_X)
set(USE_X ON)
endif()
option(USE_THREAD "Use Thread" ON)
option(USE_USB "Use USB" ON)
option(USE_VST3SDK "Use VST3SDK" OFF)
endif()
option(BUILD_I286 "Build normal(i286 older) NP2" OFF)
option(USE_SDL2 "Use SDL2" ON)
if(USE_SDL2)
set(USE_SDL_VERSION 2)
else()
set(USE_SDL_VERSION 1)
endif()
if(CMAKE_CROSSCOMPILING OR BUILD_SDL OR BUILD_X)
option(USE_SDL "Use SDL" ON)
option(USE_SDL_MIXER "Use SDL_mixer" ON)
option(USE_SDL_TTF "Use SDL_ttf" ON)
else()
option(USE_SDL "Use SDL" OFF)
option(USE_SDL_MIXER "Use SDL_mixer" OFF)
option(USE_SDL_TTF "Use SDL_ttf" OFF)
endif()
# function
option(USE_TICKCOUNT "Use TickCount" ON)
if(USE_TICKCOUNT)
list(APPEND NP2kai_TickCount_definitions "SUPPORT_NP2_TICKCOUNT")
list(APPEND NP2kai_TickCount_sources "np2_tickcount.c")
endif()
option(USE_NETWORK "Use Network" ON)
if(USE_NETWORK)
list(APPEND NP2kai_Network_definitions "SUPPORT_NET" "SUPPORT_LGY98")
file(GLOB_RECURSE NP2kai_temp "network/*.c")
list(APPEND NP2kai_Network_sources ${NP2kai_temp})
endif()
option(USE_ASYNCCPU "Use AsyncCPU" OFF)
if(USE_ASYNCCPU)
list(APPEND NP2kai_AsyncCPU_definitions "SUPPORT_ASYNC_CPU")
endif()
if(NOT CMAKE_CROSSCOMPILING)
# math
if(NOT NP2kai_Windows)
list(APPEND lib_math_libraries m)
endif()
# dynamic link
if(NOT NP2kai_Windows)
list(APPEND lib_dl_libraries ${CMAKE_DL_LIBS})
endif()
# SDL
if(NOT MSVC_VERSION)
find_package(SDL)
if(USE_SDL AND (USE_SDL_VERSION EQUAL 1))
if(NOT SDL_FOUND)
message(FATAL_ERROR "-- Not found SDL")
endif()
endif()
find_path(SDL2_CMAKE "FindSDL2.cmake" "cmake/sdl2-cmake-scripts")
if(NOT SDL2_CMAKE)
execute_process(COMMAND ${GIT_EXECUTABLE} submodule update --init --recursive ${NP2kai_SOURCE_DIR}/cmake/sdl2-cmake-modules)
endif()
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${NP2kai_SOURCE_DIR}/cmake/sdl2-cmake-modules")
find_package(SDL2)
if(USE_SDL AND (USE_SDL_VERSION EQUAL 2))
if(NOT SDL2_FOUND)
message(FATAL_ERROR "-- Not found SDL2")
endif()
endif()
else()
find_path(SDL2_FOUND "sdl2_x86-windows" "$ENV{VCPKG_ROOT}/packages")
if(SDL2_FOUND)
message("-- Found SDL2")
set(SDL2_INCLUDE_DIR "$ENV{VCPKG_ROOT}/packages/sdl2_x86-windows/include")
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
set(SDL2_LIBRARY "$ENV{VCPKG_ROOT}/packages/sdl2_x86-windows/debug/lib/SDL2d.lib")
else()
set(SDL2_LIBRARY "$ENV{VCPKG_ROOT}/packages/sdl2_x86-windows/lib/SDL2.lib")
endif()
else()
if(USE_SDL AND (USE_SDL_VERSION EQUAL 2))
message(FATAL_ERROR "-- Not found SDL2")
endif()
endif()
endif()
if(USE_SDL AND (SDL_FOUND OR SDL2_FOUND))
list(APPEND lib_SDL_definitions "SUPPORT_SDL" "SUPPORT_SDL_AUDIO")
if(NP2kai_Windows AND NOT MSVC_VERSION)
list(APPEND lib_SDL_depend_libraries version setupapi gdi32 ole32 oleaut32 imm32 winmm)
endif()
endif()
# SDL_mixer
if(NOT MSVC_VERSION)
find_package(SDL_mixer)
if(USE_SDL_MIXER AND (USE_SDL_VERSION EQUAL 1))
if(NOT SDL_mixer_FOUND)
message(FATAL_ERROR "-- Not found SDL_mixer")
endif()
endif()
find_package(SDL2_mixer)
if(USE_SDL_MIXER AND (USE_SDL_VERSION EQUAL 2))
if(NOT SDL2_mixer_FOUND)
message(FATAL_ERROR "-- Not found SDL2_mixer")
endif()
endif()
else()
find_path(SDL2_mixer_FOUND "sdl2-mixer_x86-windows" "$ENV{VCPKG_ROOT}/packages")
if(SDL2_mixer_FOUND)
message("-- Found SDL2_mixer")
set(SDL2_MIXER_INCLUDE_DIR "$ENV{VCPKG_ROOT}/packages/sdl2-mixer_x86-windows/include/SDL2")
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
set(SDL2_MIXER_LIBRARY "$ENV{VCPKG_ROOT}/packages/sdl2-mixer_x86-windows/debug/lib/SDL2_mixer.lib")
else()
set(SDL2_MIXER_LIBRARY "$ENV{VCPKG_ROOT}/packages/sdl2-mixer_x86-windows/lib/SDL2_mixer.lib")
endif()
else()
if(USE_SDL_MIXER)
message(FATAL_ERROR "-- Not found SDL2_mixer")
endif()
endif()
endif()
if(USE_SDL_MIXER AND (SDL_mixer_FOUND OR SDL2_mixer_FOUND))
list(APPEND lib_SDL_mixer_definitions "SUPPORT_SDL_MIXER")
if(NP2kai_Windows AND NOT MSVC_VERSION)
list(APPEND lib_SDL_mixer_depend_libraries mpg123 FLAC ogg opus opusfile vorbis vorbisfile)
endif()
endif()
# SDL_ttf
if(NOT MSVC_VERSION)
find_package(SDL_ttf)
if(USE_SDL_TTF AND (USE_SDL_VERSION EQUAL 1))
if(NOT SDL_ttf_FOUND)
message(FATAL_ERROR "-- Not found SDL_ttf")
endif()
endif()
find_package(SDL2_ttf)
if(USE_SDL_TTF AND (USE_SDL_VERSION EQUAL 2))
if(NOT SDL2_ttf_FOUND)
message(FATAL_ERROR "-- Not found SDL2_ttf")
endif()
endif()
else()
find_path(SDL2_ttf_FOUND "sdl2-ttf_x86-windows" "$ENV{VCPKG_ROOT}/packages")
if(SDL2_ttf_FOUND)
message("-- Found SDL2_ttf")
set(SDL2_TTF_INCLUDE_DIR "$ENV{VCPKG_ROOT}/packages/sdl2-ttf_x86-windows/include/SDL2")
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
set(SDL2_TTF_LIBRARY "$ENV{VCPKG_ROOT}/packages/sdl2-ttf_x86-windows/debug/lib/SDL2_ttf.lib")
else()
set(SDL2_TTF_LIBRARY "$ENV{VCPKG_ROOT}/packages/sdl2-ttf_x86-windows/lib/SDL2_ttf.lib")
endif()
else()
if(USE_SDL_TTF)
message(FATAL_ERROR "-- Not found SDL2_ttf")
endif()
endif()
endif()
if(USE_SDL_TTF AND (SDL_ttf_FOUND OR SDL2_ttf_FOUND))
list(APPEND lib_SDL_ttf_definitions "SUPPORT_SDL_TTF")
if(NP2kai_Windows AND NOT MSVC_VERSION)
list(APPEND lib_SDL_ttf_depend_libraries freetype)
endif()
endif()
# Threads
find_package(Threads)
if(Threads_FOUND)
if(USE_THREAD)
list(APPEND lib_Threads_definitions "SUPPORT_NP2_THREAD" "SOUND_CRITICAL")
if(CMAKE_USE_PTHREADS_INIT)
list(APPEND lib_Threads_definitions "SUPPORT_PTHREAD")
list(APPEND lib_Threads_libraries pthread)
endif()
list(APPEND NP2kai_Thread_sources "np2_thread.c")
endif()
else()
if(USE_THREAD)
message(FATAL_ERROR "-- Not found Threads")
endif()
endif()
# libusb
if(NOT MSVC_VERSION) # temporaly
if(USE_USB)
find_package(Libusb1 REQUIRED)
list(APPEND lib_usb_definitions "SUPPORT_USB")
list(APPEND lib_usb_include_dirs ${LIBUSB1_INCLUDE_DIRS})
list(APPEND lib_usb_libraries ${LIBUSB1_LIBRARIES})
endif()
endif()
# X11
find_package(X11)
if(NOT X11_FOUND)
if(USE_X)
message(FATAL_ERROR "-- Not found X11")
else()
message("-- Not found X11")
endif()
endif()
# Freetype
find_package(Freetype)
if(NOT Freetype_FOUND)
if(USE_X)
message(FATAL_ERROR "-- Not found Freetype")
else()
message("-- Not found Freetype")
endif()
endif()
# Fontconfig
find_package(Fontconfig)
if(NOT Fontconfig_FOUND)
if(USE_X)
message(FATAL_ERROR "-- Not found Fontconfig")
else()
message("-- Not found Fontconfig")
endif()
endif()
# glib-2.0
if(USE_X)
find_package(PkgConfig REQUIRED)
pkg_check_modules(GLIB REQUIRED glib-2.0)
find_path(lib_glib_include_dirs NAMES glib.h HINTS ${GLIB_INCLUDEDIR} ${GLIB_INCLUDE_DIRS})
find_path(lib_glibconfig_include_dirs NAMES glibconfig.h HINTS ${GLIB_INCLUDEDIR} ${GLIB_INCLUDE_DIRS})
# temporaly glib-2.0 is static link
find_library(lib_glib_libraries NAMES glib-2.0)
if(lib_glib_include_dirs AND lib_glibconfig_include_dirs AND lib_glib_libraries)
message("-- Found glib2.0")
else()
message(FATAL_ERROR "-- Not found glib2.0")
endif()
endif()
# GTK2
find_package(GTK2)
if(NOT GTK2_FOUND)
if(USE_X)
message(FATAL_ERROR "-- Not found GTK2")
else()
message("-- Not found GTK2")
endif()
endif()
# temporaly glib-2.0 is static link
list(FILTER GTK2_LIBRARIES EXCLUDE REGEX ".*glib-2.0.so$")
# OpenSSL
if(NOT MSVC_VERSION)
if(CMAKE_HOST_APPLE)
set(OPENSSL_ROOT_DIR "/usr/local/opt/[email protected]")
set(OPENSSL_LIBRARIES "/usr/local/opt/[email protected]/lib")
endif()
find_package(OpenSSL REQUIRED)
list(APPEND NP2kai_OpenSSL_definitions "SUPPORT_OPENSSL" "SUPPORT_DEBUGSS")
endif()
# HAXM
if(NOT CMAKE_CROSSCOMPILING)
# if(NP2kai_Windows)
# if(EXISTS "\\\\.\\HAX")
# set(HAXM true)
# endif()
# else()
# if(EXISTS "/dev/HAX")
# set(HAXM true)
# endif()
# endif()
# if(HAXM)
# message("-- Found HAXM")
# else()
# if(USE_HAXM)
# message(FATAL_ERROR "-- Not found HAXM")
# else()
# message("-- Not found HAXM")
# endif()
# endif()
if(USE_HAXM)
list(APPEND NP2kai_HAXM_definitions "SUPPORT_IA32_HAXM" "USE_CUSTOM_HOOKINST")
endif()
endif()
# VST3 SDK
if(USE_VST3SDK)
find_path(VST3SDK_CMAKE "README.md" "cmake/vst3_cmake")
if(NOT VST3SDK)
execute_process(COMMAND ${GIT_EXECUTABLE} submodule update --init --recursive ${NP2kai_SOURCE_DIR}/cmake/vst3_cmake)
endif()
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${NP2kai_SOURCE_DIR}/cmake/vst3_cmake/modules")
# set(SMTG_MYPLUGINS_SRC_PATH "sdl/---")
# set(SMTG_MYPLUGINS_SRC_PATH "x/---")
# set(SMTG_MYPLUGINS_SRC_PATH "windows/---")
find_path(VST3SDK "CMakeLists.txt" "vst3sdk")
if(NOT VST3SDK)
execute_process(COMMAND ${GIT_EXECUTABLE} submodule update --init --recursive ${NP2kai_SOURCE_DIR}/vst3sdk)
endif()
add_subdirectory("vst3sdk")
list(APPEND lib_vst3sdk_libraries "vst3sdk")
endif()
if(MSVC_VERSION)
# WDK
find_path(WDK_CMAKE "README.md" "cmake/FindWDK")
if(NOT WDK_CMAKE)
execute_process(COMMAND ${GIT_EXECUTABLE} submodule update --init --recursive ${NP2kai_SOURCE_DIR}/cmake/FindWDK)
endif()
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${NP2kai_SOURCE_DIR}/cmake/FindWDK/cmake")
find_package(WDK REQUIRED)
endif()
endif()
if(CMAKE_CROSSCOMPILING)
# Enscripten
if(EMSCRIPTEN)
if((USE_SDL_VERSION EQUAL 1) AND (USE_SDL_MIXER OR USE_SDL_TTL))
message(FATAL_ERROR "-- Emscripten SDL1 NP2kai cannot be with SDL_mixer and SDL_ttf (-D USE_SDL_MIXER=OFF -D USE_SDL_TTF=OFF)")
endif()
# OpenDigux
elseif(BUILD_OPENDINGUX_GCW0)
if((USE_SDL_VERSION EQUAL 1) AND USE_SDL_TTF)
message(FATAL_ERROR "-- OpenDingux GCW0 NP2kai cannot be with SDL and SDL_ttf (use -D USE_SDL2=OFF -D USE_SDL_TTF=OFF)")
endif()
find_path(gcw0toolchain "bin" "/opt/gcw0-toolchain/usr")
if(gcw0toolchain)
message("-- Found OpenDingux GCW0 toolchain")
else()
message(FATAL_ERROR "-- Not found OpenDingux GCW0 toolchain")
endif()
elseif(BUILD_OPENDINGUX_RG350)
# find_path(rg350toolchain "bin" "/opt/rg350-toolchain/usr")
# if(rg350toolchain)
# message("-- Found OpenDingux RG350 toolchain")
# else()
# message(FATAL_ERROR "-- Not found OpenDingux RG350 toolchain")
# endif()
elseif(BUILD_OPENDINGUX_RS90)
if((USE_SDL_VERSION EQUAL 2) OR USE_SDL_TTF)
message(FATAL_ERROR "-- OpenDingux RS90 NP2kai cannot be with SDL2 and SDL_ttf (use -D USE_SDL2=OFF -D USE_SDL_TTF=OFF)")
endif()
find_path(rs90toolchain "bin" "/opt/rs90-toolchain/usr")
if(rs90toolchain)
message("-- Found OpenDingux RS90 toolchain")
else()
message(FATAL_ERROR "-- Not found OpenDingux RS90 toolchain")
endif()
endif()
endif()
# target base
add_library(NP2kai_bbase INTERFACE)
target_compile_definitions(NP2kai_bbase INTERFACE ${NP2kai_common_definitions} "NP2KAI_GIT_TAG=\"${NP2kai_GIT_TAG}\"" "NP2KAI_GIT_HASH=\"${NP2kai_GIT_HASH}\"")
target_include_directories(NP2kai_bbase INTERFACE ${NP2kai_common_include_dirs})
target_sources(NP2kai_bbase INTERFACE ${NP2kai_common_sources})
if(NP2kai_Windows AND NOT MSVC_VERSION)
target_link_libraries(NP2kai_bbase INTERFACE stdc++)
elseif(NOT NP2kai_Windows)
target_link_libraries(NP2kai_bbase INTERFACE)
endif()
add_library(NP2kai_base INTERFACE)
target_compile_definitions(NP2kai_base INTERFACE ${NP2kai_normal_definitions})
target_include_directories(NP2kai_base INTERFACE ${NP2kai_normal_include_dirs})
target_sources(NP2kai_base INTERFACE ${NP2kai_normal_sources})
target_link_libraries(NP2kai_base INTERFACE NP2kai_bbase)
add_library(NP21kai_base INTERFACE)
target_compile_definitions(NP21kai_base INTERFACE ${NP2kai_ia32_definitions})
target_include_directories(NP21kai_base INTERFACE ${NP2kai_ia32_include_dirs})
target_sources(NP21kai_base INTERFACE ${NP2kai_ia32_sources})
target_link_libraries(NP21kai_base INTERFACE NP2kai_bbase)
add_library(NP21kai_HAXM_base INTERFACE)
target_compile_definitions(NP21kai_HAXM_base INTERFACE ${NP2kai_HAXM_definitions})
target_sources(NP21kai_HAXM_base INTERFACE ${NP2kai_HAXM_sources})
target_link_libraries(NP21kai_HAXM_base INTERFACE NP21kai_base)
if(CMAKE_CROSSCOMPILING)
if(EMSCRIPTEN)
set(NP2kai_Emscripten_MinMemorySize 67108864)
set(NP2kai_Emscripten_MaxMemorySize 1073741824)
add_library(NP2kai_Emscripten_SDL1_base INTERFACE)
target_compile_definitions(NP2kai_Emscripten_SDL1_base INTERFACE ${NP2kai_SDL_definitions} "OSLINEBREAK_LF" "SUPPORT_SDL_AUDIO" "SUPPORT_NP2_TICKCOUNT")
target_include_directories(NP2kai_Emscripten_SDL1_base INTERFACE ${NP2kai_Emscripten_include_dirs})
target_compile_options(NP2kai_Emscripten_SDL1_base INTERFACE "SHELL:-s USE_SDL=1" "SHELL:-s USE_SDL_MIXER=1" "SHELL:-s USE_SDL_TTF=1")
target_link_options(NP2kai_Emscripten_SDL1_base INTERFACE "SHELL:-s INITIAL_MEMORY=${NP2kai_Emscripten_MinMemorySize}" "SHELL:-s MAXIMUM_MEMORY=${NP2kai_Emscripten_MaxMemorySize}" "SHELL:-s USE_SDL=1" "SHELL:-s USE_SDL_MIXER=1" "SHELL:-s USE_SDL_TTF=1" "SHELL:-s ASSERTIONS=1")
target_link_libraries(NP2kai_Emscripten_SDL1_base INTERFACE m ssl crypto)
target_sources(NP2kai_Emscripten_SDL1_base INTERFACE ${NP2kai_SDL_sources} "sdl/em/main.c" "sdl/em/SDL_mixer.c")
add_library(NP2kai_Emscripten_SDL2_base INTERFACE)
target_compile_definitions(NP2kai_Emscripten_SDL2_base INTERFACE ${NP2kai_SDL_definitions} "OSLINEBREAK_LF" "SUPPORT_SDL_AUDIO" ${lib_SDL_mixer_definitions} ${lib_SDL_ttf_definitions} "SUPPORT_NP2_TICKCOUNT")
target_include_directories(NP2kai_Emscripten_SDL2_base INTERFACE ${NP2kai_Emscripten_include_dirs})
target_compile_options(NP2kai_Emscripten_SDL2_base INTERFACE "SHELL:-s USE_SDL=2" "SHELL:-s USE_SDL_MIXER=2" "SHELL:-s USE_SDL_TTF=2")
target_link_options(NP2kai_Emscripten_SDL2_base INTERFACE "SHELL:-s INITIAL_MEMORY=${NP2kai_Emscripten_MinMemorySize}" "SHELL:-s MAXIMUM_MEMORY=${NP2kai_Emscripten_MaxMemorySize}" "SHELL:-s USE_SDL=2" "SHELL:-s USE_SDL_MIXER=2" "SHELL:-s USE_SDL_TTF=2" "SHELL:-s ASSERTIONS=1")
target_link_libraries(NP2kai_Emscripten_SDL2_base INTERFACE m ssl crypto)
target_sources(NP2kai_Emscripten_SDL2_base INTERFACE ${NP2kai_SDL_sources} "sdl/em/main.c")
endif()
if(BUILD_OPENDINGUX_GCW0)
add_library(NP2kai_gcw0_SDL1_base INTERFACE)
target_compile_definitions(NP2kai_gcw0_SDL1_base INTERFACE ${NP2kai_SDL_definitions} "__OPENDINGUX__" ${OPENDINGUX_VGA_definitions} "OSLINEBREAK_LF" "SUPPORT_SDL_AUDIO" ${lib_SDL_mixer_definitions} ${lib_SDL_ttf_definitions} "SUPPORT_NP2_TICKCOUNT" "SUPPORT_NP2_THREAD" ${NP2kai_TickCount_definitions} ${NP2kai_Network_definitions})
target_sources(NP2kai_gcw0_SDL1_base INTERFACE ${NP2kai_SDL_sources} ${NP2kai_OpenDingux_sources} "np2_thread.c" ${NP2kai_TickCount_sources} ${NP2kai_Network_sources})
target_link_directories(NP2kai_gcw0_SDL1_base INTERFACE "/opt/gcw0-toolchain/usr/mipsel-gcw0-linux-uclibc/sysroot/lib")
target_include_directories(NP2kai_gcw0_SDL1_base INTERFACE ${NP2kai_OpenDingux_include_dirs} "/opt/gcw0-toolchain/mipsel-gcw0-linux-uclibc/sysroot/usr/include" "/opt/gcw0-toolchain/usr/mipsel-gcw0-linux-uclibc/sysroot/usr/include/SDL")
target_link_libraries(NP2kai_gcw0_SDL1_base INTERFACE m ssl crypto pthread SDL ${lib_SDL_mixer_depend_libraries} ${lib_SDL_ttf_definitions})
add_library(NP2kai_gcw0_SDL2_base INTERFACE)
target_compile_definitions(NP2kai_gcw0_SDL2_base INTERFACE ${NP2kai_SDL_definitions} "__OPENDINGUX__" ${OPENDINGUX_VGA_definitions} "OSLINEBREAK_LF" "SUPPORT_SDL_AUDIO" ${lib_SDL_mixer_definitions} ${lib_SDL_ttf_definitions} "SUPPORT_NP2_TICKCOUNT" "SUPPORT_NP2_THREAD" ${NP2kai_TickCount_definitions} ${NP2kai_Network_definitions})
target_sources(NP2kai_gcw0_SDL2_base INTERFACE ${NP2kai_SDL_sources} ${NP2kai_OpenDingux_sources} "np2_thread.c" ${NP2kai_TickCount_sources} ${NP2kai_Network_sources})
target_link_directories(NP2kai_gcw0_SDL2_base INTERFACE "/opt/gcw0-toolchain/usr/mipsel-gcw0-linux-uclibc/sysroot/lib")
target_include_directories(NP2kai_gcw0_SDL2_base INTERFACE ${NP2kai_OpenDingux_include_dirs} "/opt/gcw0-toolchain/mipsel-gcw0-linux-uclibc/sysroot/usr/include" "/opt/gcw0-toolchain/usr/mipsel-gcw0-linux-uclibc/sysroot/usr/include/SDL2")
target_link_libraries(NP2kai_gcw0_SDL2_base INTERFACE m ssl crypto pthread SDL2 ${lib_SDL_mixer_depend_libraries} ${lib_SDL_ttf_definitions})
endif()
if(BUILD_OPENDINGUX_RG350)
add_library(NP2kai_rg350_SDL1_base INTERFACE)
target_compile_definitions(NP2kai_rg350_SDL1_base INTERFACE ${NP2kai_SDL_definitions} "__OPENDINGUX__" ${OPENDINGUX_VGA_definitions} "OSLINEBREAK_LF" "SUPPORT_SDL_AUDIO" ${lib_SDL_mixer_definitions} ${lib_SDL_ttf_definitions} "SUPPORT_NP2_TICKCOUNT" "SUPPORT_NP2_THREAD" ${NP2kai_TickCount_definitions} ${NP2kai_Network_definitions})
target_sources(NP2kai_rg350_SDL1_base INTERFACE ${NP2kai_SDL_sources} ${NP2kai_OpenDingux_sources} "np2_thread.c" ${NP2kai_TickCount_sources} ${NP2kai_Network_sources})
target_link_directories(NP2kai_rg350_SDL1_base INTERFACE "/opt/rg350-toolchain/usr/mipsel-gcw0-linux-uclibc/sysroot/usr/lib")
target_include_directories(NP2kai_rg350_SDL1_base INTERFACE ${NP2kai_OpenDingux_include_dirs} "/opt/rg350-toolchain/usr/mipsel-rg350-linux-uclibc/sysroot/usr/include" "/opt/rg350-toolchain/usr/mipsel-rg350-linux-uclibc/sysroot/usr/include/SDL")
target_link_libraries(NP2kai_rg350_SDL1_base INTERFACE m ssl crypto pthread SDL ${lib_SDL_mixer_depend_libraries} ${lib_SDL_ttf_definitions})
add_library(NP2kai_rg350_SDL2_base INTERFACE)
target_compile_definitions(NP2kai_rg350_SDL2_base INTERFACE ${NP2kai_SDL_definitions} "__OPENDINGUX__" ${OPENDINGUX_VGA_definitions} "OSLINEBREAK_LF" "SUPPORT_SDL_AUDIO" ${lib_SDL_mixer_definitions} ${lib_SDL_ttf_definitions} "SUPPORT_NP2_TICKCOUNT" "SUPPORT_NP2_THREAD" ${NP2kai_TickCount_definitions} ${NP2kai_Network_definitions})
target_sources(NP2kai_rg350_SDL2_base INTERFACE ${NP2kai_SDL_sources} ${NP2kai_OpenDingux_sources} "np2_thread.c" ${NP2kai_TickCount_sources} ${NP2kai_Network_sources})
target_link_directories(NP2kai_rg350_SDL2_base INTERFACE "/opt/rg350-toolchain/usr/mipsel-gcw0-linux-uclibc/sysroot/usr/lib")
target_include_directories(NP2kai_rg350_SDL2_base INTERFACE ${NP2kai_OpenDingux_include_dirs} "/opt/rg350-toolchain/usr/mipsel-rg350-linux-uclibc/sysroot/usr/include" "/opt/rg350-toolchain/usr/mipsel-rg350-linux-uclibc/sysroot/usr/include/SDL2")
target_link_libraries(NP2kai_rg350_SDL2_base INTERFACE m ssl crypto pthread SDL2 ${lib_SDL_mixer_depend_libraries} ${lib_SDL_ttf_definitions})
endif()
if(BUILD_OPENDINGUX_RS90)
add_library(NP2kai_rs90_SDL1_base INTERFACE)
# target_compile_definitions(NP2kai_rs90_SDL1_base INTERFACE ${NP2kai_SDL_definitions} "__OPENDINGUX__" ${OPENDINGUX_VGA_definitions} "OSLINEBREAK_LF" "SUPPORT_SDL_AUDIO" ${lib_SDL_mixer_definitions} ${lib_SDL_ttf_definitions} "SUPPORT_NP2_TICKCOUNT" "SUPPORT_NP2_THREAD" ${NP2kai_TickCount_definitions} ${NP2kai_Network_definitions})
target_compile_definitions(NP2kai_rs90_SDL1_base INTERFACE ${NP2kai_SDL_definitions} "__OPENDINGUX__" ${OPENDINGUX_VGA_definitions} "OSLINEBREAK_LF" "SUPPORT_SDL_AUDIO" ${lib_SDL_mixer_definitions} "SUPPORT_NP2_TICKCOUNT" "SUPPORT_NP2_THREAD" ${NP2kai_TickCount_definitions} ${NP2kai_Network_definitions})
target_include_directories(NP2kai_rs90_SDL1_base INTERFACE ${NP2kai_OpenDingux_include_dirs} "/opt/rs90-toolchain/mipsel-rs90-linux-musl/sysroot/usr/include" "/opt/rs90-toolchain/mipsel-rs90-linux-musl/sysroot/usr/include/SDL")
target_sources(NP2kai_rs90_SDL1_base INTERFACE ${NP2kai_SDL_sources} ${NP2kai_OpenDingux_sources} "np2_thread.c" ${NP2kai_TickCount_sources} ${NP2kai_Network_sources})
target_link_directories(NP2kai_rs90_SDL1_base INTERFACE "/opt/rs90-toolchain/mipsel-rs90-linux-musl/sysroot/lib")
target_link_libraries(NP2kai_rs90_SDL1_base INTERFACE m ssl crypto pthread SDL ${lib_SDL_mixer_depend_libraries} ${lib_SDL_ttf_definitions})
add_library(NP2kai_rs90_base INTERFACE)
# target_compile_definitions(NP2kai_rs90_base INTERFACE ${NP2kai_SDL_definitions} "__OPENDINGUX__" ${OPENDINGUX_VGA_definitions} "OSLINEBREAK_LF" "SUPPORT_SDL_AUDIO" ${lib_SDL_mixer_definitions} ${lib_SDL_ttf_definitions} "SUPPORT_NP2_TICKCOUNT" "SUPPORT_NP2_THREAD" ${NP2kai_TickCount_definitions} ${NP2kai_Network_definitions})
target_compile_definitions(NP2kai_rs90_base INTERFACE ${NP2kai_SDL_definitions} "__OPENDINGUX__" ${OPENDINGUX_VGA_definitions} "OSLINEBREAK_LF" "SUPPORT_SDL_AUDIO" ${lib_SDL_mixer_definitions} "SUPPORT_NP2_TICKCOUNT" "SUPPORT_NP2_THREAD" ${NP2kai_TickCount_definitions} ${NP2kai_Network_definitions})
target_include_directories(NP2kai_rs90_base INTERFACE ${NP2kai_OpenDingux_include_dirs} "/opt/rs90-toolchain/mipsel-rs90-linux-musl/sysroot/usr/include" "/opt/rs90-toolchain/mipsel-rs90-linux-musl/sysroot/usr/include/SDL")
target_sources(NP2kai_rs90_base INTERFACE ${NP2kai_SDL_sources} ${NP2kai_OpenDingux_sources} "np2_thread.c" ${NP2kai_TickCount_sources} ${NP2kai_Network_sources})
target_link_directories(NP2kai_rs90_base INTERFACE "/opt/rs90-toolchain/mipsel-rs90-linux-musl/sysroot/lib")
target_link_libraries(NP2kai_rs90_base INTERFACE m ssl crypto pthread SDL2 ${lib_SDL_mixer_depend_libraries} ${lib_SDL_ttf_definitions})
endif()
else()
add_library(NP2kai_SDL_SDL1_base INTERFACE)
target_sources(NP2kai_SDL_SDL1_base INTERFACE ${NP2kai_SDL_sources} ${NP2kai_Thread_sources} ${NP2kai_TickCount_sources} ${NP2kai_Network_sources})
target_compile_definitions(NP2kai_SDL_SDL1_base INTERFACE ${NP2kai_SDL_definitions} ${lib_SDL_mixer_definitions} ${lib_SDL_ttf_definitions} ${NP2kai_extra_definitions} ${NP2kai_LinkBreak_definitions} ${NP2kai_TickCount_definitions} ${NP2kai_Network_definitions} ${SDL_DEFINE} ${SDL_MIXER_DEFINE} ${SDL_TTF_DEFINE} ${NP2kai_OpenSSL_definitions} ${lib_usb_definitions})
target_include_directories(NP2kai_SDL_SDL1_base INTERFACE ${SDL_INCLUDE_DIR} ${SDL_MIXER_INCLUDE_DIR} ${SDL_TTF_INCLUDE_DIR} ${OPENSSL_INCLUDE_DIR} ${lib_usb_include_dirs} ${lib_vst3sdk_include_dirs})
if(MINGW OR MSYS OR CYGWIN)
target_link_libraries(NP2kai_SDL_SDL1_base INTERFACE ${lib_math_libraries} ${lib_vst3sdk_libraries} ${lib_Threads_libraries} ${SDL_LIBRARY} ${SDL_MIXER_LIBRARY} ${SDL_TTF_LIBRARY} ${lib_SDL_depend_libraries} ${lib_SDL_mixer_depend_libraries} ${lib_SDL_ttf_depend_libraries} ${OPENSSL_LIBRARIES} ${lib_usb_libraries} ${lib_dl_libraries} SDL dxguid mad)
else()
target_link_libraries(NP2kai_SDL_SDL1_base INTERFACE ${lib_math_libraries} ${lib_vst3sdk_libraries} ${lib_Threads_libraries} ${SDL_LIBRARY} ${SDL_MIXER_LIBRARY} ${SDL_TTF_LIBRARY} ${lib_SDL_depend_libraries} ${lib_SDL_mixer_depend_libraries} ${lib_SDL_ttf_depend_libraries} ${OPENSSL_LIBRARIES} ${lib_usb_libraries} ${lib_dl_libraries})
endif()
add_library(NP2kai_SDL_SDL2_base INTERFACE)
target_sources(NP2kai_SDL_SDL2_base INTERFACE ${NP2kai_SDL_sources} ${NP2kai_Thread_sources} ${NP2kai_TickCount_sources} ${NP2kai_Network_sources})
target_compile_definitions(NP2kai_SDL_SDL2_base INTERFACE ${NP2kai_SDL_definitions} ${lib_SDL_mixer_definitions} ${lib_SDL_ttf_definitions} ${NP2kai_extra_definitions} ${NP2kai_LinkBreak_definitions} ${NP2kai_TickCount_definitions} ${NP2kai_Network_definitions} ${SDL2_DEFINE} ${SDL2_MIXER_DEFINE} ${SDL2_TTF_DEFINE} ${NP2kai_OpenSSL_definitions} ${lib_usb_definitions})
#target_include_directories(NP2kai_SDL_SDL2_base INTERFACE ${NP2kai_SDL_UNIX_dirs} ${OPENSSL_INCLUDE_DIR} ${lib_usb_include_dirs} ${lib_vst3sdk_include_dirs})
#target_link_libraries(NP2kai_SDL_SDL2_base INTERFACE ${lib_math_libraries} ${lib_vst3sdk_libraries} ${lib_Threads_libraries} SDL2::Main SDL2::Mixer SDL2::TTF ${lib_SDL_depend_libraries} ${lib_SDL_mixer_depend_libraries} ${lib_SDL_ttf_depend_libraries} ${OPENSSL_LIBRARIES} ${lib_usb_libraries} ${lib_dl_libraries})
target_include_directories(NP2kai_SDL_SDL2_base INTERFACE ${OPENSSL_INCLUDE_DIR} ${SDL2_INCLUDE_DIR} ${SDL2_MIXER_INCLUDE_DIR} ${SDL2_TTF_INCLUDE_DIR} ${lib_usb_include_dirs} ${lib_vst3sdk_include_dirs})
target_link_libraries(NP2kai_SDL_SDL2_base INTERFACE ${lib_math_libraries} ${lib_vst3sdk_libraries} ${lib_Threads_libraries} ${SDL2_LIBRARY} ${SDL2_MIXER_LIBRARY} ${SDL2_TTF_LIBRARY} ${lib_SDL_depend_libraries} ${lib_SDL_mixer_depend_libraries} ${lib_SDL_ttf_depend_libraries} ${OPENSSL_LIBRARIES} ${lib_usb_libraries} ${lib_dl_libraries})
add_library(NP2kai_X_SDL1_base INTERFACE)
target_sources(NP2kai_X_SDL1_base INTERFACE ${NP2kai_X_sources} ${NP2kai_Thread_sources} ${NP2kai_TickCount_sources} ${NP2kai_Network_sources})
target_compile_definitions(NP2kai_X_SDL1_base INTERFACE ${NP2kai_X_definitions} ${lib_SDL_definitions} ${lib_SDL_mixer_definitions} ${lib_SDL_ttf_definitions} ${NP2kai_extra_definitions} ${NP2kai_LinkBreak_definitions} ${NP2kai_TickCount_definitions} ${NP2kai_Network_definitions} ${GTK2_DEFINITIONS} ${SDL_DEFINE} ${SDL_MIXER_DEFINE} ${SDL_TTF_DEFINE} ${NP2kai_OpenSSL_definitions} ${lib_usb_definitions} "SYSRESPATH=\"resources\"")
target_include_directories(NP2kai_X_SDL1_base INTERFACE ${NP2kai_X_include_dirs} ${lib_glib_include_dirs} ${lib_glibconfig_include_dirs} ${GTK2_INCLUDE_DIRS} ${X11_INCLUDE_DIRS} ${Freetype_INCLUDE_DIRS} ${Fontconfig_INCLUDE_DIRS} ${SDL_INCLUDE_DIR} ${SDL_MIXER_INCLUDE_DIR} ${SDL_TTF_INCLUDE_DIR} ${OPENSSL_INCLUDE_DIR} ${lib_usb_include_dirs} ${lib_vst3sdk_include_dirs})
target_link_libraries(NP2kai_X_SDL1_base INTERFACE ${lib_math_libraries} glib-2.0 ${GTK2_LIBRARIES} ${X11_LIBRARIES} ${Freetype_LIBRARIES} ${Fontconfig_LIBRARIES} ${lib_vst3sdk_libraries} ${lib_Threads_libraries} ${SDL_LIBRARY} ${SDL_MIXER_LIBRARY} ${SDL_TTF_LIBRARY} ${lib_SDL_depend_libraries} ${lib_SDL_mixer_depend_libraries} ${lib_SDL_ttf_depend_libraries} ${OPENSSL_LIBRARIES} ${lib_usb_libraries} ${lib_dl_libraries})
add_library(NP2kai_X_SDL2_base INTERFACE)
target_sources(NP2kai_X_SDL2_base INTERFACE ${NP2kai_X_sources} ${NP2kai_Thread_sources} ${NP2kai_TickCount_sources} ${NP2kai_Network_sources})
target_compile_definitions(NP2kai_X_SDL2_base INTERFACE ${NP2kai_X_definitions} ${lib_SDL_definitions} ${lib_SDL_mixer_definitions} ${lib_SDL_ttf_definitions} ${NP2kai_extra_definitions} ${NP2kai_LinkBreak_definitions} ${NP2kai_TickCount_definitions} ${NP2kai_Network_definitions} ${GTK2_DEFINITIONS} ${SDL2_DEFINE} ${SDL2_MIXER_DEFINE} ${SDL2_TTF_DEFINE} ${NP2kai_OpenSSL_definitions} ${lib_usb_definitions} "SYSRESPATH=\"resources\"")
#target_include_directories(NP2kai_X_SDL2_base INTERFACE ${NP2kai_X_include_dirs} ${lib_glib_include_dirs} ${lib_glibconfig_include_dirs} ${GTK2_INCLUDE_DIRS} ${X11_INCLUDE_DIRS} ${Fontconfig_INCLUDE_DIRS} ${Freetype_INCLUDE_DIRS} ${OPENSSL_INCLUDE_DIR} ${lib_usb_include_dirs} ${lib_vst3sdk_include_dirs})
target_include_directories(NP2kai_X_SDL2_base INTERFACE ${NP2kai_X_include_dirs} ${lib_glib_include_dirs} ${lib_glibconfig_include_dirs} ${GTK2_INCLUDE_DIRS} ${X11_INCLUDE_DIRS} ${Fontconfig_INCLUDE_DIRS} ${Freetype_INCLUDE_DIRS} ${OPENSSL_INCLUDE_DIR} ${SDL2_INCLUDE_DIR} ${SDL2_MIXER_INCLUDE_DIR} ${SDL2_TTF_INCLUDE_DIR} ${lib_usb_include_dirs} ${lib_vst3sdk_include_dirs})
#target_link_libraries(NP2kai_X_SDL2_base INTERFACE ${lib_math_libraries} glib-2.0 ${GTK2_LIBRARIES} ${X11_LIBRARIES} ${Fontconfig_LIBRARIES} ${Freetype_LIBRARIES} ${lib_vst3sdk_libraries} ${lib_Threads_libraries} SDL2::Main SDL2::Mixer SDL2::TTF ${lib_SDL_depend_libraries} ${lib_SDL_mixer_depend_libraries} ${lib_SDL_ttf_depend_libraries} ${OPENSSL_LIBRARIES} ${lib_usb_libraries} ${lib_dl_libraries})
target_link_libraries(NP2kai_X_SDL2_base INTERFACE ${lib_math_libraries} glib-2.0 ${GTK2_LIBRARIES} ${X11_LIBRARIES} ${Fontconfig_LIBRARIES} ${Freetype_LIBRARIES} ${lib_vst3sdk_libraries} ${lib_Threads_libraries} ${SDL2_LIBRARY} ${SDL2_MIXER_LIBRARY} ${SDL2_TTF_LIBRARY} ${lib_SDL_depend_libraries} ${lib_SDL_mixer_depend_libraries} ${lib_SDL_ttf_depend_libraries} ${OPENSSL_LIBRARIES} ${lib_usb_libraries} ${lib_dl_libraries})
if(MSVC_VERSION)
add_subdirectory(windows/resources/932)
add_subdirectory(windows/resources/936)
add_subdirectory(windows/resources/950)
add_subdirectory(windows/resources/1252)
add_library(NP2kai_Windows_base INTERFACE)
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
target_compile_options(NP2kai_Windows_base INTERFACE /utf-8 /GS /MTd)
else()
target_compile_options(NP2kai_Windows_base INTERFACE /utf-8 /GS /MT)
endif()
target_compile_definitions(NP2kai_Windows_base INTERFACE ${NP2kai_Windows_definitions} ${NP2kai_extra_definitions} ${NP2kai_LinkBreak_definitions} ${NP2kai_TickCount_definitions} ${NP2kai_Network_definitions} ${lib_usb_definitions})
target_include_directories(NP2kai_Windows_base INTERFACE ${NP2kai_Windows_include_dirs} ${lib_usb_include_dirs} ${lib_vst3sdk_include_dirs})
target_sources(NP2kai_Windows_base INTERFACE ${NP2kai_Windows_sources} ${NP2kai_Thread_sources} ${NP2kai_TickCount_sources} ${NP2kai_Network_sources})
target_link_directories(NP2kai_Windows_base INTERFACE "${WDK_ROOT}\\Lib\\${WDK_VERSION}\\ucrt\\x64" "${WDK_ROOT}\\Lib\\${WDK_VERSION}\\um\\x64" "${WDK_ROOT}\\Lib\\${WDK_VERSION}\\km\\x64")
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
# target_link_libraries(NP2kai_Windows_base INTERFACE NP2kai_windows_932 NP2kai_windows_936 NP2kai_windows_950 NP2kai_windows_1252 shlwapi comctl32 atlsd libcmtd libucrtd libvcruntimed libcpmtd dxguid d3d9 ddraw dinput8 dsound ws2_32 ${lib_Threads_libraries} ${lib_usb_libraries} ${lib_vst3sdk_libraries})
target_link_libraries(NP2kai_Windows_base INTERFACE winmm shlwapi comctl32 atls libcmtd libucrtd libvcruntimed libcpmtd dxguid d3d9 ddraw dinput8 dsound ws2_32 ${lib_Threads_libraries} ${OPENSSL_LIBRARIES} ${lib_usb_libraries} ${lib_vst3sdk_libraries})
else()
# target_link_libraries(NP2kai_Windows_base INTERFACE NP2kai_windows_932 NP2kai_windows_936 NP2kai_windows_950 NP2kai_windows_1252 shlwapi comctl32 atls libcmt libucrt libvcruntime libcpmt dxguid d3d9 ddraw dinput8 dsound ws2_32 ${lib_Threads_libraries} ${lib_usb_libraries} ${lib_vst3sdk_libraries})
target_link_libraries(NP2kai_Windows_base INTERFACE winmm shlwapi comctl32 atls libcmt libucrt libvcruntime libcpmt dxguid d3d9 ddraw dinput8 dsound ws2_32 ${lib_Threads_libraries} ${OPENSSL_LIBRARIES} ${lib_usb_libraries} ${lib_vst3sdk_libraries})
endif()
endif()
endif()
# target
if(CMAKE_CROSSCOMPILING)
if(EMSCRIPTEN)
set(CMAKE_EXECUTABLE_SUFFIX ".html")
add_executable(emnp2kai_sdl1)
target_link_options(emnp2kai_sdl1 PUBLIC "SHELL:-s INITIAL_MEMORY=${NP2kai_Emscripten_MinMemorySize}" "SHELL:-s MAXIMUM_MEMORY=33554432")
target_link_libraries(emnp2kai_sdl1 PUBLIC NP2kai_base NP2kai_Emscripten_SDL1_base)
add_executable(emnp21kai_sdl1)
target_link_options(emnp21kai_sdl1 PUBLIC "SHELL:-s INITIAL_MEMORY=${NP2kai_Emscripten_MinMemorySize}" "SHELL:-s MAXIMUM_MEMORY=1073741824")
target_link_libraries(emnp21kai_sdl1 PUBLIC NP21kai_base NP2kai_Emscripten_SDL1_base)
add_executable(emnp2kai)
target_link_options(emnp2kai PUBLIC "SHELL:-s INITIAL_MEMORY=${NP2kai_Emscripten_MinMemorySize}" "SHELL:-s MAXIMUM_MEMORY=33554432")
target_link_libraries(emnp2kai PUBLIC NP2kai_base NP2kai_Emscripten_SDL2_base)
add_executable(emnp21kai)
target_link_options(emnp21kai PUBLIC "SHELL:-s INITIAL_MEMORY=${NP2kai_Emscripten_MinMemorySize}" "SHELL:-s MAXIMUM_MEMORY=1073741824")
target_link_libraries(emnp21kai PUBLIC NP21kai_base NP2kai_Emscripten_SDL2_base)
if(NOT BUILD_I286)
set_target_properties(emnp2kai_sdl1 emnp2kai PROPERTIES EXCLUDE_FROM_ALL true)
endif()
if(USE_SDL_VERSION EQUAL 1)
set_target_properties(emnp2kai emnp21kai PROPERTIES EXCLUDE_FROM_ALL true)
else()
set_target_properties(emnp2kai_sdl1 emnp21kai_sdl1 PROPERTIES EXCLUDE_FROM_ALL true)
endif()
endif()
if(BUILD_OPENDINGUX_GCW0)
set(CMAKE_EXECUTABLE_SUFFIX ".opk")
add_executable(np2kai_gcw0_sdl1)
target_link_libraries(np2kai_gcw0_sdl1 PUBLIC NP2kai_base NP2kai_gcw0_SDL1_base)
add_custom_command(
TARGET np2kai_gcw0_sdl1
POST_BUILD
COMMENT "Genarate .opk pack."
COMMAND cp -r ${NP2kai_SOURCE_DIR}/sdl/opendingux/opk ${NP2kai_BINARY_DIR}/np2kai_gcw0_sdl1_opk
COMMAND mv np2kai_gcw0_sdl1.opk ${NP2kai_BINARY_DIR}/np2kai_gcw0_sdl1_opk/
COMMAND rm ${NP2kai_BINARY_DIR}/np2kai_gcw0_sdl1_opk/default_opendingux_np21kai_desktop
COMMAND sed -i -e 's/Name=NP2kai/Name=NP2kai\(SDL1\)/g' ${NP2kai_BINARY_DIR}/np2kai_gcw0_sdl1_opk/default_opendingux_np2kai_desktop
COMMAND sed -i -e 's/Exec=np2kai/Exec=np2kai_gcw0_sdl1/g' ${NP2kai_BINARY_DIR}/np2kai_gcw0_sdl1_opk/default_opendingux_np2kai_desktop
COMMAND mv ${NP2kai_BINARY_DIR}/np2kai_gcw0_sdl1_opk/default_opendingux_np2kai_desktop ${NP2kai_BINARY_DIR}/np2kai_gcw0_sdl1_opk/default_opendingux_np2kai_gcw0_sdl1.desktop
COMMAND mksquashfs ${NP2kai_BINARY_DIR}/np2kai_gcw0_sdl1_opk ${NP2kai_BINARY_DIR}/np2kai_gcw0_sdl1.opk -all-root -noappend -no-exports
COMMAND rm -r ${NP2kai_BINARY_DIR}/np2kai_gcw0_sdl1_opk
)
add_executable(np21kai_gcw0_sdl1)
target_link_libraries(np21kai_gcw0_sdl1 PUBLIC NP21kai_base NP2kai_gcw0_SDL1_base)
add_custom_command(
TARGET np21kai_gcw0_sdl1
POST_BUILD
COMMENT "Genarate .opk pack."
COMMAND cp -r ${NP2kai_SOURCE_DIR}/sdl/opendingux/opk ${NP2kai_BINARY_DIR}/np21kai_gcw0_sdl1_opk
COMMAND mv np21kai_gcw0_sdl1.opk ${NP2kai_BINARY_DIR}/np21kai_gcw0_sdl1_opk/
COMMAND rm ${NP2kai_BINARY_DIR}/np21kai_gcw0_sdl1_opk/default_opendingux_np2kai_desktop
COMMAND sed -i -e 's/Name=NP21kai/Name=NP21kai\(SDL1\)/g' ${NP2kai_BINARY_DIR}/np21kai_gcw0_sdl1_opk/default_opendingux_np21kai_desktop
COMMAND sed -i -e 's/Exec=np21kai/Exec=np21kai_gcw0_sdl1/g' ${NP2kai_BINARY_DIR}/np21kai_gcw0_sdl1_opk/default_opendingux_np21kai_desktop
COMMAND mv ${NP2kai_BINARY_DIR}/np21kai_gcw0_sdl1_opk/default_opendingux_np21kai_desktop ${NP2kai_BINARY_DIR}/np21kai_gcw0_sdl1_opk/default_opendingux_np21kai_gcw0_sdl1.desktop
COMMAND mksquashfs ${NP2kai_BINARY_DIR}/np21kai_gcw0_sdl1_opk ${NP2kai_BINARY_DIR}/np21kai_gcw0_sdl1.opk -all-root -noappend -no-exports
COMMAND rm -r ${NP2kai_BINARY_DIR}/np21kai_gcw0_sdl1_opk
)
add_executable(np2kai_gcw0)
target_link_libraries(np2kai_gcw0 PUBLIC NP2kai_base NP2kai_gcw0_SDL2_base)
add_custom_command(
TARGET np2kai_gcw0
POST_BUILD
COMMENT "Genarate .opk pack."
COMMAND cp -r ${NP2kai_SOURCE_DIR}/sdl/opendingux/opk ${NP2kai_BINARY_DIR}/np2kai_gcw0_opk
COMMAND mv np2kai_gcw0.opk ${NP2kai_BINARY_DIR}/np2kai_gcw0_opk/
COMMAND rm ${NP2kai_BINARY_DIR}/np2kai_gcw0_opk/default_opendingux_np21kai_desktop
COMMAND sed -i -e 's/Exec=np2kai/Exec=np2kai_gcw0/g' ${NP2kai_BINARY_DIR}/np2kai_gcw0_opk/default_opendingux_np2kai_desktop
COMMAND mv ${NP2kai_BINARY_DIR}/np2kai_gcw0_opk/default_opendingux_np2kai_desktop ${NP2kai_BINARY_DIR}/np2kai_gcw0_opk/default_opendingux_np2kai_gcw0.desktop
COMMAND mksquashfs ${NP2kai_BINARY_DIR}/np2kai_gcw0_opk ${NP2kai_BINARY_DIR}/np2kai_gcw0.opk -all-root -noappend -no-exports
COMMAND rm -r ${NP2kai_BINARY_DIR}/np2kai_gcw0_opk
)
add_executable(np21kai_gcw0)
target_link_libraries(np21kai_gcw0 PUBLIC NP21kai_base NP2kai_gcw0_SDL2_base)
add_custom_command(
TARGET np21kai_gcw0
POST_BUILD
COMMENT "Genarate .opk pack."
COMMAND cp -r ${NP2kai_SOURCE_DIR}/sdl/opendingux/opk ${NP2kai_BINARY_DIR}/np21kai_gcw0_opk
COMMAND mv np21kai_gcw0.opk ${NP2kai_BINARY_DIR}/np21kai_gcw0_opk/
COMMAND rm ${NP2kai_BINARY_DIR}/np21kai_gcw0_opk/default_opendingux_np2kai_desktop
COMMAND sed -i -e 's/Exec=np21kai/Exec=np21kai_gcw0/g' ${NP2kai_BINARY_DIR}/np21kai_gcw0_opk/default_opendingux_np21kai_desktop
COMMAND mv ${NP2kai_BINARY_DIR}/np21kai_gcw0_opk/default_opendingux_np21kai_desktop ${NP2kai_BINARY_DIR}/np21kai_gcw0_opk/default_opendingux_np21kai_gcw0.desktop
COMMAND mksquashfs ${NP2kai_BINARY_DIR}/np21kai_gcw0_opk ${NP2kai_BINARY_DIR}/np21kai_gcw0.opk -all-root -noappend -no-exports
COMMAND rm -r ${NP2kai_BINARY_DIR}/np21kai_gcw0_opk
)
if(NOT BUILD_I286)
set_target_properties(np2kai_gcw0_sdl1 np2kai_gcw0 PROPERTIES EXCLUDE_FROM_ALL true)
endif()
if(USE_SDL_VERSION EQUAL 1)
set_target_properties(np2kai_gcw0 np21kai_gcw0 PROPERTIES EXCLUDE_FROM_ALL true)
else()
set_target_properties(np2kai_gcw0_sdl1 np21kai_gcw0_sdl1 PROPERTIES EXCLUDE_FROM_ALL true)
endif()
endif()
if(BUILD_OPENDINGUX_RG350)
set(CMAKE_EXECUTABLE_SUFFIX ".opk")
add_executable(np2kai_rg350_sdl1)
target_link_libraries(np2kai_rg350_sdl1 PUBLIC NP2kai_base NP2kai_rg350_SDL1_base)
add_custom_command(
TARGET np2kai_rg350_sdl1
POST_BUILD
COMMENT "Genarate .opk pack."
COMMAND cp -r ${NP2kai_SOURCE_DIR}/sdl/opendingux/opk ${NP2kai_BINARY_DIR}/np2kai_rg350_sdl1_opk
COMMAND mv np2kai_rg350_sdl1.opk ${NP2kai_BINARY_DIR}/np2kai_rg350_sdl1_opk/
COMMAND rm ${NP2kai_BINARY_DIR}/np2kai_rg350_sdl1_opk/default_opendingux_np21kai_desktop
COMMAND sed -i -e 's/Name=NP2kai/Name=NP2kai\(SDL1\)/g' ${NP2kai_BINARY_DIR}/np2kai_rg350_sdl1_opk/default_opendingux_np2kai_desktop
COMMAND sed -i -e 's/Exec=np2kai/Exec=np2kai_rg350_sdl1/g' ${NP2kai_BINARY_DIR}/np2kai_rg350_sdl1_opk/default_opendingux_np2kai_desktop
COMMAND mv ${NP2kai_BINARY_DIR}/np2kai_rg350_sdl1_opk/default_opendingux_np2kai_desktop ${NP2kai_BINARY_DIR}/np2kai_rg350_sdl1_opk/default_opendingux_np2kai_rg350_sdl1.desktop
COMMAND mksquashfs ${NP2kai_BINARY_DIR}/np2kai_rg350_sdl1_opk ${NP2kai_BINARY_DIR}/np2kai_rg350_sdl1.opk -all-root -noappend -no-exports
COMMAND rm -r ${NP2kai_BINARY_DIR}/np2kai_rg350_sdl1_opk
)
add_executable(np21kai_rg350_sdl1)
target_link_libraries(np21kai_rg350_sdl1 PUBLIC NP21kai_base NP2kai_rg350_SDL1_base)
add_custom_command(
TARGET np21kai_rg350_sdl1
POST_BUILD
COMMENT "Genarate .opk pack."
COMMAND cp -r ${NP2kai_SOURCE_DIR}/sdl/opendingux/opk ${NP2kai_BINARY_DIR}/np21kai_rg350_sdl1_opk
COMMAND mv np21kai_rg350_sdl1.opk ${NP2kai_BINARY_DIR}/np21kai_rg350_sdl1_opk/
COMMAND rm ${NP2kai_BINARY_DIR}/np21kai_rg350_sdl1_opk/default_opendingux_np2kai_desktop
COMMAND sed -i -e 's/Name=NP21kai/Name=NP21kai\(SDL1\)/g' ${NP2kai_BINARY_DIR}/np21kai_rg350_sdl1_opk/default_opendingux_np21kai_desktop
COMMAND sed -i -e 's/Exec=np21kai/Exec=np21kai_rg350_sdl1/g' ${NP2kai_BINARY_DIR}/np21kai_rg350_sdl1_opk/default_opendingux_np21kai_desktop
COMMAND mv ${NP2kai_BINARY_DIR}/np21kai_rg350_sdl1_opk/default_opendingux_np21kai_desktop ${NP2kai_BINARY_DIR}/np21kai_rg350_sdl1_opk/default_opendingux_np21kai_rg350_sdl1.desktop
COMMAND mksquashfs ${NP2kai_BINARY_DIR}/np21kai_rg350_sdl1_opk ${NP2kai_BINARY_DIR}/np21kai_rg350_sdl1.opk -all-root -noappend -no-exports
COMMAND rm -r ${NP2kai_BINARY_DIR}/np21kai_rg350_sdl1_opk
)
add_executable(np2kai_rg350)
target_link_libraries(np2kai_rg350 PUBLIC NP2kai_base NP2kai_rg350_SDL2_base)
add_custom_command(
TARGET np2kai_rg350
POST_BUILD
COMMENT "Genarate .opk pack."
COMMAND cp -r ${NP2kai_SOURCE_DIR}/sdl/opendingux/opk ${NP2kai_BINARY_DIR}/np2kai_rg350_opk
COMMAND mv np2kai_rg350.opk ${NP2kai_BINARY_DIR}/np2kai_rg350_opk/
COMMAND rm ${NP2kai_BINARY_DIR}/np2kai_rg350_opk/default_opendingux_np21kai_desktop