-
Notifications
You must be signed in to change notification settings - Fork 5
/
CMakeLists.txt
1829 lines (1587 loc) · 65.9 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
# For Emscripten, invoke something like:
# source ~/emsdk_portable/emsdk_env.sh;
# mkdir BUILD; cd BUILD;
# cmake -DCMAKE_TOOLCHAIN_FILE=$EMSCRIPTEN/cmake/Modules/Platform/Emscripten.cmake -DCMAKE_BUILD_TYPE=Release ..
# For Mac, you must use the Xcode generator. Makefile is currently broken.
# mkdir BUILD; cd BUILD;
# cmake -GXcode ..
# For iOS, you must use the Xcode generator and the bundled toolchain
# mkdir BUILD; cd BUILD;
# cmake -DCMAKE_TOOLCHAIN_FILE=../CMakeModules/iOS.toolchain.cmake -GXcode ..
if(APPLE)
# We're using the new Mac RPATH policy.
CMAKE_MINIMUM_REQUIRED(VERSION 3.0)
else()
# Ubuntu 12.04 LTS ships 2.8.7
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
endif()
if(POLICY CMP0054)
cmake_policy(SET CMP0054 NEW)
endif()
PROJECT(IUP)
INCLUDE(CMakeDependentOption)
INCLUDE(CheckFunctionExists)
#SET(CPACK_SET_DESTDIR TRUE)
#INCLUDE(CPack)
# By default, we'll exclude the tests from the ALL target. But for convenience, we also will provide a testsiup aggregate target.
OPTION(IUP_BUILD_TESTS "Build tests with ALL target" OFF)
SET(IUP_TESTS_CUSTOM_TARGET_NAME "testsiup")
ADD_CUSTOM_TARGET(${IUP_TESTS_CUSTOM_TARGET_NAME})
IF(EMSCRIPTEN)
# Emscripten documentation says .so is better than .a, but also implies .bc may be best.
# TODO: Figure out how .bc fits into all of this.
OPTION(WANTS_BUILD_SHARED_LIBRARY "Build dynamic library" ON)
ELSEIF(APPLE)
IF(IOS)
OPTION(WANTS_BUILD_SHARED_LIBRARY "Build dynamic library" OFF)
ELSE()
OPTION(WANTS_BUILD_SHARED_LIBRARY "Build dynamic library" ON)
CMAKE_DEPENDENT_OPTION(WANTS_BUILD_FRAMEWORK "Set to ON to build framework instead of dylib. Only valid if BUILD_SHARED_LIBRARY is ON an is OS X." ON "WANTS_BUILD_SHARED_LIBRARY" ON)
ENDIF()
ELSEIF(UNIX)
OPTION(WANTS_BUILD_SHARED_LIBRARY "Build dynamic library" ON)
ELSE()
OPTION(WANTS_BUILD_SHARED_LIBRARY "Build dynamic library" ON)
ENDIF()
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/CMakeModules/" ${CMAKE_MODULE_PATH})
INCLUDE(HelperFunctions)
IF(APPLE)
# FIXME: Expand to support GNUStep
INCLUDE(HelperApple)
ENDIF()
OPTION(IUP_OPTION_LUA "Build Lua if available" ON)
# I'm keeping this off by default for now, because of a cross-dependency problem of other iuplua* modules depending on symbols in iuplua.
# http://lua-users.org/lists/lua-l/2015-05/msg00263.html
# It's giving me a lot of pain on Mac, and I worry about iOS, Android, and Emscripten, and how it affects portability of your code.
# I worry some platforms may not be able to support modules at all.
# And unfortunately, it seems that your setup code will need to differ depending on which you use,
# which will make writing your cross-platform code more painful.
OPTION(IUP_OPTION_LUA_BUILD_AS_MODULES "Build IupLua* as modules instead of dynamic libraries (when not static)" OFF)
IF(EMSCRIPTEN)
OPTION(IUP_OPTION_ANDROID "Use Android backend" OFF)
OPTION(IUP_OPTION_COCOA "Use Cocoa backend" OFF)
OPTION(IUP_OPTION_COCOATOUCH "Use CocoaTouch backend" OFF)
OPTION(IUP_OPTION_EMSCRIPTEN "Use Emscripten backend" ON)
OPTION(IUP_OPTION_GTK2 "Use GTK2 backend" OFF)
OPTION(IUP_OPTION_GTK3 "Use GTK3 backend" OFF)
OPTION(IUP_OPTION_MOTIF "Use Motif backend" OFF)
OPTION(IUP_OPTION_WIN32 "Use Win32 backend" OFF)
ELSEIF(APPLE)
IF(IOS)
OPTION(IUP_OPTION_ANDROID "Use Android backend" OFF)
OPTION(IUP_OPTION_COCOA "Use Cocoa backend" OFF)
OPTION(IUP_OPTION_COCOATOUCH "Use CocoaTouch backend" ON)
OPTION(IUP_OPTION_EMSCRIPTEN "Use Emscripten backend" OFF)
OPTION(IUP_OPTION_GTK2 "Use GTK2 backend" OFF)
OPTION(IUP_OPTION_GTK3 "Use GTK3 backend" OFF)
OPTION(IUP_OPTION_MOTIF "Use Motif backend" OFF)
OPTION(IUP_OPTION_WIN32 "Use Win32 backend" OFF)
ELSE()
OPTION(IUP_OPTION_ANDROID "Use Android backend" OFF)
OPTION(IUP_OPTION_COCOA "Use Cocoa backend" ON)
OPTION(IUP_OPTION_COCOATOUCH "Use CocoaTouch backend" OFF)
OPTION(IUP_OPTION_EMSCRIPTEN "Use Emscripten backend" OFF)
OPTION(IUP_OPTION_GTK2 "Use GTK2 backend" OFF)
OPTION(IUP_OPTION_GTK3 "Use GTK3 backend" OFF)
OPTION(IUP_OPTION_MOTIF "Use Motif backend" OFF)
OPTION(IUP_OPTION_WIN32 "Use Win32 backend" OFF)
ENDIF()
ELSEIF(ANDROID)
OPTION(IUP_OPTION_ANDROID "Use Android backend" ON)
OPTION(IUP_OPTION_COCOA "Use Cocoa backend" OFF)
OPTION(IUP_OPTION_COCOATOUCH "Use CocoaTouch backend" OFF)
OPTION(IUP_OPTION_EMSCRIPTEN "Use Emscripten backend" OFF)
OPTION(IUP_OPTION_GTK2 "Use GTK2 backend" OFF)
OPTION(IUP_OPTION_GTK3 "Use GTK3 backend" OFF)
OPTION(IUP_OPTION_MOTIF "Use Motif backend" OFF)
OPTION(IUP_OPTION_WIN32 "Use Win32 backend" OFF)
MESSAGE("In android")
ELSEIF(WIN32)
OPTION(IUP_OPTION_ANDROID "Use Android backend" OFF)
OPTION(IUP_OPTION_COCOA "Use Cocoa backend" OFF)
OPTION(IUP_OPTION_COCOATOUCH "Use CocoaTouch backend" OFF)
OPTION(IUP_OPTION_EMSCRIPTEN "Use Emscripten backend" OFF)
OPTION(IUP_OPTION_GTK2 "Use GTK2 backend" OFF)
OPTION(IUP_OPTION_GTK3 "Use GTK3 backend" OFF)
OPTION(IUP_OPTION_MOTIF "Use Motif backend" OFF)
OPTION(IUP_OPTION_WIN32 "Use Win32 backend" ON)
ELSEIF(UNIX)
# WARNING: I know GTK can be used on Windows and Mac,
# but this file currently does not support that configuration.
# To make that work, the FIND stuff needs to be re-run
OPTION(IUP_OPTION_ANDROID "Use Android backend" OFF)
OPTION(IUP_OPTION_COCOA "Use Cocoa backend" OFF)
OPTION(IUP_OPTION_COCOATOUCH "Use CocoaTouch backend" OFF)
OPTION(IUP_OPTION_EMSCRIPTEN "Use Emscripten backend" OFF)
OPTION(IUP_OPTION_WIN32 "Use Win32 backend" OFF)
# Not sure the best way of doing this.
# Find both GTK2 and GTK3 in case the user wants to change the config.
# Otherwise I might accidentally prevent detection.
find_package(PkgConfig REQUIRED)
# I originally tried find_package() for 2.0 but linking failed on Ubuntu 16.10 (but worked on 12.04)
# pkg_check_modules with 2.0 fixed the problem.
#find_package(GTK2 2.0 QUIET COMPONENTS gtk)
pkg_check_modules(GTK2 gtk+-2.0)
# Use the package PkgConfig to detect GTK+ headers/library files
pkg_check_modules(GTK3 gtk+-3.0)
find_package(Motif QUIET)
if(GTK2_FOUND)
OPTION(IUP_OPTION_GTK2 "Use GTK2 backend" ON)
OPTION(IUP_OPTION_GTK3 "Use GTK3 backend" OFF)
OPTION(IUP_OPTION_MOTIF "Use Motif backend" OFF)
OPTION(IUPWEB_OPTION_USEDLOPEN "Use dlopen to load libwebkitgtk-1.0" ON)
elseif(GTK3_FOUND)
OPTION(IUP_OPTION_GTK2 "Use GTK2 backend" OFF)
OPTION(IUP_OPTION_GTK3 "Use GTK3 backend" ON)
OPTION(IUP_OPTION_MOTIF "Use Motif backend" OFF)
OPTION(IUPWEB_OPTION_USEDLOPEN "Use dlopen to load libwebkitgtk-3.0" ON)
elseif(MOTIF_FOUND)
OPTION(IUP_OPTION_GTK2 "Use GTK2 backend" OFF)
OPTION(IUP_OPTION_GTK3 "Use GTK3 backend" OFF)
OPTION(IUP_OPTION_MOTIF "Use Motif backend" ON)
OPTION(IUPWEB_OPTION_USEDLOPEN "Use dlopen to load libwebkit" OFF)
else()
MESSAGE(FATAL_ERROR "Platform backend dependencies were not found.")
endif()
ENDIF()
IF(IUP_OPTION_EMSCRIPTEN)
SET(IUP_USE_EMSCRIPTEN 1)
ELSEIF(IUP_OPTION_ANDROID)
SET(IUP_USE_ANDROID 1)
ELSEIF(IUP_OPTION_COCOA)
SET(IUP_USE_COCOA 1)
ELSEIF(IUP_OPTION_COCOATOUCH)
SET(IUP_USE_COCOATOUCH 1)
ELSEIF(IUP_OPTION_GTK2)
SET(IUP_USE_GTK2 1)
MESSAGE("option gtk2")
# NOTE: This has limited effect since I already ran these for the Option selections on Unix.
# This is here only for people who select this on the platforms where GTK is non-native (Mac, Windows)
find_package(GTK2 2.0 REQUIRED COMPONENTS gtk)
if(NOT GTK2_FOUND)
MESSAGE(FATAL_ERROR "GTK2 dependencies not found")
endif()
if(IUPWEB_OPTION_USEDLOPEN)
else()
pkg_check_modules(WEBKIT QUIET webkit-1.0)
if(NOT WEBKIT_FOUND)
pkg_check_modules(WEBKIT QUIET webkitgtk-2.0)
endif()
endif()
ELSEIF(IUP_OPTION_GTK3)
SET(IUP_USE_GTK3 1)
MESSAGE("option gtk3")
# NOTE: This has limited effect since I already ran these for the Option selections on Unix.
# This is here only for people who select this on the platforms where GTK is non-native (Mac, Windows)
# Use the package PkgConfig to detect GTK+ headers/library files
find_package(PkgConfig REQUIRED)
pkg_check_modules(GTK3 REQUIRED gtk+-3.0)
if(NOT GTK3_FOUND)
MESSAGE(FATAL_ERROR "GTK3 dependencies not found")
endif()
if(IUPWEB_OPTION_USEDLOPEN)
else()
pkg_check_modules(WEBKIT QUIET webkit-1.0)
if(NOT WEBKIT_FOUND)
pkg_check_modules(WEBKIT QUIET webkitgtk-3.0)
endif()
endif()
ELSEIF(IUP_OPTION_MOTIF)
SET(IUP_USE_MOTIF 1)
# NOTE: This has limited effect since I already ran these for the Option selections on Unix.
# This is here only for people who select this on the platforms where GTK is non-native (Mac, Windows)
find_package(Motif REQUIRED)
if(NOT MOTIF_FOUND)
MESSAGE(FATAL_ERROR "Motif dependencies not found")
endif()
ELSEIF(IUP_OPTION_WIN32)
SET(IUP_USE_WIN32 1)
# Needed for UTF8MODE on Windows
OPTION(IUP_OPTION_USE_UNICODE "Comple with Unidode" ON)
ELSE()
MESSAGE(FATAL_ERROR "Unsupported platform backend")
ENDIF()
# Not sure what the default should be for this, and if it should be backend dependent
OPTION(IUPIMGLIB_OPTION_USE_IMGLIB_LARGE "Include images larger than 48x48 (inclusive) for imglib" ON)
FIND_PACKAGE(CD QUIET)
IF(CD_FOUND)
SET(IUP_USE_CD 1)
MESSAGE("CD found")
ELSE()
MESSAGE("CD not found")
ENDIF()
SET(IUP_USE_LUA 0)
IF(IUP_OPTION_LUA)
message("init LUA_LIBRARY: ${LUA_LIBRARY}")
message("init LUA_INCLUDE_DIR: ${LUA_INCLUDE_DIR}")
MESSAGE("finding lua package")
FIND_PACKAGE(Lua QUIET)
IF(LUA_FOUND)
SET(IUP_USE_LUA 1)
MESSAGE("Lua found")
ELSE()
MESSAGE("Lua not found")
ENDIF()
ENDIF()
# RPATH stuff. This MUST be set before any targets that use it are declared.
# Only affects shared libraries.
if(WANTS_BUILD_SHARED_LIBRARY)
HELPER_SETUP_RPATH()
endif()
SET(IUP_C_FLAGS "")
SET(IUPIMGLIB_C_FLAGS "")
SET(IUPOLE_C_FLAGS "")
# Do we need CXX flags for web because of Windows?
SET(IUPWEB_C_FLAGS "")
SET(IUPCD_C_FLAGS "")
SET(IUPCONTROLS_C_FLAGS "")
SET(IUPLUA_C_FLAGS "")
SET(IUPLUAWEB_C_FLAGS "")
SET(IUPEXE_C_FLAGS "")
SET(IUPEXE_LINK_FLAGS "")
MESSAGE("CMAKE_C_COMPILER_ID ${CMAKE_C_COMPILER_ID}")
IF("${CMAKE_C_COMPILER_ID}" MATCHES "Clang")
SET(CMAKE_C_FLAGS "-Wno-invalid-source-encoding ${CMAKE_C_FLAGS}")
SET(CMAKE_CXX_FLAGS "-Wno-invalid-source-encoding ${CMAKE_CXX_FLAGS}")
ELSEIF("${CMAKE_C_COMPILER_ID}" MATCHES "GNU")
SET(CMAKE_C_FLAGS "-Wno-invalid-source-encoding ${CMAKE_C_FLAGS}")
SET(CMAKE_CXX_FLAGS "-Wno-invalid-source-encoding ${CMAKE_CXX_FLAGS}")
ENDIF()
# TODO: We must add visibility annotations to IUP to support Emscripten.
# We can then reuse them for other platforms too.
IF(IUP_USE_EMSCRIPTEN)
# we always need to set this when building a libray with Emscripten
SET(IUP_C_FLAGS "${IUP_C_FLAGS} -DIUP_BUILD_LIBRARY -DIUP_DLL -DIUPWEB_BUILD_LIBRARY")
# we always need to set this when using an Emscripten built library, otherwise symbols get stripped.
SET(IUPEXE_C_FLAGS "${IUPEXE_C_FLAGS} -DIUP_BUILD_LIBRARY -DIUP_DLL -DIUPWEB_BUILD_LIBRARY")
# Without this, all executables only generate .js files without the html wrapper.
SET(CMAKE_EXECUTABLE_SUFFIX ".html")
# IUP executables will always need this switch because IUP is event driven and doesn't quit when Emscripten tries to run/quit main().
# SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -s NO_EXIT_RUNTIME=1")
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} --shell-file ${CMAKE_SOURCE_DIR}/etc/iupemscripten_shell.html -s EXTRA_EXPORTED_RUNTIME_METHODS=\"['cwrap']\" -s NO_EXIT_RUNTIME=1 -s USE_SDL=2 -s USE_SDL_IMAGE=2 -s SDL2_IMAGE_FORMATS='[\"bmp\",\"png\",\"xpm\"]'")
ELSEIF(WANTS_BUILD_SHARED_LIBRARY)
IF("${CMAKE_C_COMPILER_ID}" MATCHES "Clang")
SET(IUP_C_FLAGS "${IUP_C_FLAGS} -fvisibility=hidden")
SET(IUPIMGLIB_C_FLAGS "${IUPIMGLIB_C_FLAGS} -fvisibility=hidden")
SET(IUPOLE_C_FLAGS "${IUPOLE_C_FLAGS} -fvisibility=hidden")
SET(IUPWEB_C_FLAGS "${IUPWEB_C_FLAGS} -fvisibility=hidden")
SET(IUPCD_C_FLAGS "${IUPCD_C_FLAGS} -fvisibility=hidden")
SET(IUPCONTROLS_C_FLAGS "${IUPCONTROLS_C_FLAGS} -fvisibility=hidden")
SET(IUPLUA_C_FLAGS "${IUPLUA_C_FLAGS} -fvisibility=hidden")
SET(IUPLUAWEB_C_FLAGS "${IUPLUAWEB_C_FLAGS} -fvisibility=hidden")
ELSEIF("${CMAKE_C_COMPILER_ID}" MATCHES "GNU")
SET(IUP_C_FLAGS "${IUP_C_FLAGS} -fvisibility=hidden")
SET(IUPIMGLIB_C_FLAGS "${IUPIMGLIB_C_FLAGS} -fvisibility=hidden")
SET(IUPOLE_C_FLAGS "${IUPOLE_C_FLAGS} -fvisibility=hidden")
SET(IUPWEB_C_FLAGS "${IUPWEB_C_FLAGS} -fvisibility=hidden")
SET(IUPCD_C_FLAGS "${IUPCD_C_FLAGS} -fvisibility=hidden")
SET(IUPCONTROLS_C_FLAGS "${IUPCONTROLS_C_FLAGS} -fvisibility=hidden")
SET(IUPLUAWEB_C_FLAGS "${IUPLUAWEB_C_FLAGS} -fvisibility=hidden")
ENDIF()
SET(IUP_C_FLAGS "${IUP_C_FLAGS} -DIUP_BUILD_LIBRARY -DIUP_DLL")
# Yes, IUP_BUILD_LIBRARY and not IUPIMG_BUILD_LIBRARY because the header is in iup.h
SET(IUPIMGLIB_C_FLAGS "${IUPIMGLIB_C_FLAGS} -DIUP_BUILD_LIBRARY -DIUP_DLL")
SET(IUPOLE_C_FLAGS "${IUPOLE_C_FLAGS} -DIUPOLE_BUILD_LIBRARY")
SET(IUPWEB_C_FLAGS "${IUPWEB_C_FLAGS} -DIUPWEB_BUILD_LIBRARY")
SET(IUPCD_C_FLAGS "${IUPCD_C_FLAGS} -DIUPCD_BUILD_LIBRARY")
SET(IUPCONTROLS_C_FLAGS "${IUPCONTROLS_C_FLAGS} -DIUPCONTROLS_BUILD_LIBRARY")
SET(IUPLUA_C_FLAGS "${IUPLUA_C_FLAGS} -DIUPLUA_BUILD_LIBRARY")
SET(IUPLUAWEB_C_FLAGS "${IUPLUAWEB_C_FLAGS} -DIUPLUAWEB_BUILD_LIBRARY")
ENDIF()
IF(MSVC)
# Kind of a hack. Need to get Windows exe's to link and not show a console window. Not sure why it is defaulting to /SUBSYSTEM:CONSOLE even though WIN32 is specified in the ADD_EXECUTABLE
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /SUBSYSTEM:WINDOWS /ENTRY:\"mainCRTStartup\"")
ENDIF()
IF(IUPIMGLIB_OPTION_USE_IMGLIB_LARGE)
SET(IUPIMGLIB_C_FLAGS "${IUPIMGLIB_C_FLAGS} -DIUP_IMAGELIB_LARGE")
ENDIF()
SET(IUP_PUBLIC_HEADERS
${CMAKE_SOURCE_DIR}/include/iup.h
${CMAKE_SOURCE_DIR}/include/iupcbs.h
${CMAKE_SOURCE_DIR}/include/iupdef.h
${CMAKE_SOURCE_DIR}/include/iupdraw.h
${CMAKE_SOURCE_DIR}/include/iupkey.h
${CMAKE_SOURCE_DIR}/include/iup_config.h
${CMAKE_SOURCE_DIR}/include/iup_varg.h
)
SET(IUPIMGLIB_PUBLIC_HEADERS
)
SET(IUPOLE_PUBLIC_HEADERS
${CMAKE_SOURCE_DIR}/include/iupole.h
)
SET(IUPWEB_PUBLIC_HEADERS
${CMAKE_SOURCE_DIR}/include/iupweb.h
)
SET(IUPCD_PUBLIC_HEADERS
)
SET(IUPCONTROLS_PUBLIC_HEADERS
${CMAKE_SOURCE_DIR}/include/iupcontrols.h
)
SET(IUPLUA_PUBLIC_HEADERS
${CMAKE_SOURCE_DIR}/include/iuplua.h
)
SET(IUPLUAWEB_PUBLIC_HEADERS
${CMAKE_SOURCE_DIR}/include/iupluaweb.h
)
SET(IUP_COMMON_SOURCE_FILES
# ${CMAKE_SOURCE_DIR}/src/iup.def
${CMAKE_SOURCE_DIR}/src/iup.c
${CMAKE_SOURCE_DIR}/src/iup_animatedlabel.c
${CMAKE_SOURCE_DIR}/src/iup_array.c
${CMAKE_SOURCE_DIR}/src/iup_array.h
${CMAKE_SOURCE_DIR}/src/iup_assert.c
${CMAKE_SOURCE_DIR}/src/iup_assert.h
${CMAKE_SOURCE_DIR}/src/iup_attrib.c
${CMAKE_SOURCE_DIR}/src/iup_attrib.h
${CMAKE_SOURCE_DIR}/src/iup_backgroundbox.c
${CMAKE_SOURCE_DIR}/src/iup_box.c
${CMAKE_SOURCE_DIR}/src/iup_box.h
${CMAKE_SOURCE_DIR}/src/iup_button.c
${CMAKE_SOURCE_DIR}/src/iup_button.h
${CMAKE_SOURCE_DIR}/src/iup_callback.c
${CMAKE_SOURCE_DIR}/src/iup_canvas.c
${CMAKE_SOURCE_DIR}/src/iup_canvas.h
${CMAKE_SOURCE_DIR}/src/iup_cbox.c
${CMAKE_SOURCE_DIR}/src/iup_childtree.c
${CMAKE_SOURCE_DIR}/src/iup_childtree.h
${CMAKE_SOURCE_DIR}/src/iup_class.c
${CMAKE_SOURCE_DIR}/src/iup_class.h
${CMAKE_SOURCE_DIR}/src/iup_classattrib.c
${CMAKE_SOURCE_DIR}/src/iup_classbase.c
${CMAKE_SOURCE_DIR}/src/iup_classbase.h
${CMAKE_SOURCE_DIR}/src/iup_colorbar.c
${CMAKE_SOURCE_DIR}/src/iup_colorbrowser.c
${CMAKE_SOURCE_DIR}/src/iup_colordlg.c
${CMAKE_SOURCE_DIR}/src/iup_colorhsi.c
${CMAKE_SOURCE_DIR}/src/iup_colorhsi.h
${CMAKE_SOURCE_DIR}/src/iup_config.c
# ${CMAKE_SOURCE_DIR}/src/iup_datepick.c
${CMAKE_SOURCE_DIR}/src/iup_detachbox.c
${CMAKE_SOURCE_DIR}/src/iup_dial.c
${CMAKE_SOURCE_DIR}/src/iup_dialog.c
${CMAKE_SOURCE_DIR}/src/iup_dialog.h
${CMAKE_SOURCE_DIR}/src/iup_dlglist.c
${CMAKE_SOURCE_DIR}/src/iup_dlglist.h
${CMAKE_SOURCE_DIR}/src/iup_draw.c
${CMAKE_SOURCE_DIR}/src/iup_draw.h
${CMAKE_SOURCE_DIR}/src/iup_dropbutton.c
${CMAKE_SOURCE_DIR}/src/iup_drv.h
${CMAKE_SOURCE_DIR}/src/iup_drvdraw.h
${CMAKE_SOURCE_DIR}/src/iup_drvfont.h
${CMAKE_SOURCE_DIR}/src/iup_drvinfo.h
${CMAKE_SOURCE_DIR}/src/iup_expander.c
${CMAKE_SOURCE_DIR}/src/iup_filedlg.c
${CMAKE_SOURCE_DIR}/src/iup_fill.c
${CMAKE_SOURCE_DIR}/src/iup_flatbutton.c
${CMAKE_SOURCE_DIR}/src/iup_flatframe.c
${CMAKE_SOURCE_DIR}/src/iup_flatlabel.c
${CMAKE_SOURCE_DIR}/src/iup_flatscrollbar.c
${CMAKE_SOURCE_DIR}/src/iup_flatscrollbar.h
${CMAKE_SOURCE_DIR}/src/iup_flatscrollbox.c
${CMAKE_SOURCE_DIR}/src/iup_flatseparator.c
${CMAKE_SOURCE_DIR}/src/iup_flattabs.c
${CMAKE_SOURCE_DIR}/src/iup_flattoggle.c
${CMAKE_SOURCE_DIR}/src/iup_focus.c
${CMAKE_SOURCE_DIR}/src/iup_focus.h
${CMAKE_SOURCE_DIR}/src/iup_font.c
${CMAKE_SOURCE_DIR}/src/iup_fontdlg.c
${CMAKE_SOURCE_DIR}/src/iup_frame.c
${CMAKE_SOURCE_DIR}/src/iup_frame.h
${CMAKE_SOURCE_DIR}/src/iup_func.c
${CMAKE_SOURCE_DIR}/src/iup_func.h
${CMAKE_SOURCE_DIR}/src/iup_gauge.c
${CMAKE_SOURCE_DIR}/src/iup_getparam.c
${CMAKE_SOURCE_DIR}/src/iup_globalattrib.c
${CMAKE_SOURCE_DIR}/src/iup_globalattrib.h
${CMAKE_SOURCE_DIR}/src/iup_gridbox.c
${CMAKE_SOURCE_DIR}/src/iup_hbox.c
${CMAKE_SOURCE_DIR}/src/iup_image.c
${CMAKE_SOURCE_DIR}/src/iup_image.h
${CMAKE_SOURCE_DIR}/src/iup_key.c
${CMAKE_SOURCE_DIR}/src/iup_key.h
${CMAKE_SOURCE_DIR}/src/iup_label.c
${CMAKE_SOURCE_DIR}/src/iup_label.h
${CMAKE_SOURCE_DIR}/src/iup_layout.c
${CMAKE_SOURCE_DIR}/src/iup_layout.h
${CMAKE_SOURCE_DIR}/src/iup_layoutdlg.c
${CMAKE_SOURCE_DIR}/src/iup_ledlex.c
${CMAKE_SOURCE_DIR}/src/iup_ledlex.h
${CMAKE_SOURCE_DIR}/src/iup_ledparse.c
${CMAKE_SOURCE_DIR}/src/iup_linefile.c
${CMAKE_SOURCE_DIR}/src/iup_linefile.h
${CMAKE_SOURCE_DIR}/src/iup_link.c
${CMAKE_SOURCE_DIR}/src/iup_list.c
${CMAKE_SOURCE_DIR}/src/iup_list.h
${CMAKE_SOURCE_DIR}/src/iup_loop.c
${CMAKE_SOURCE_DIR}/src/iup_loop.h
${CMAKE_SOURCE_DIR}/src/iup_mask.c
${CMAKE_SOURCE_DIR}/src/iup_mask.h
${CMAKE_SOURCE_DIR}/src/iup_maskmatch.c
${CMAKE_SOURCE_DIR}/src/iup_maskmatch.h
${CMAKE_SOURCE_DIR}/src/iup_maskparse.c
${CMAKE_SOURCE_DIR}/src/iup_maskparse.h
${CMAKE_SOURCE_DIR}/src/iup_menu.c
${CMAKE_SOURCE_DIR}/src/iup_menu.h
${CMAKE_SOURCE_DIR}/src/iup_messagedlg.c
${CMAKE_SOURCE_DIR}/src/iup_names.c
${CMAKE_SOURCE_DIR}/src/iup_names.h
${CMAKE_SOURCE_DIR}/src/iup_normalizer.c
${CMAKE_SOURCE_DIR}/src/iup_normalizer.h
${CMAKE_SOURCE_DIR}/src/iup_object.c
${CMAKE_SOURCE_DIR}/src/iup_object.h
${CMAKE_SOURCE_DIR}/src/iup_open.c
${CMAKE_SOURCE_DIR}/src/iup_predialogs.c
${CMAKE_SOURCE_DIR}/src/iup_predialogs.h
${CMAKE_SOURCE_DIR}/src/iup_progressbar.c
${CMAKE_SOURCE_DIR}/src/iup_progressbar.h
${CMAKE_SOURCE_DIR}/src/iup_progressdlg.c
${CMAKE_SOURCE_DIR}/src/iup_radio.c
${CMAKE_SOURCE_DIR}/src/iup_recplay.c
${CMAKE_SOURCE_DIR}/src/iup_register.c
${CMAKE_SOURCE_DIR}/src/iup_register.h
${CMAKE_SOURCE_DIR}/src/iup_sbox.c
${CMAKE_SOURCE_DIR}/src/iup_scanf.c
${CMAKE_SOURCE_DIR}/src/iup_scrollbox.c
${CMAKE_SOURCE_DIR}/src/iup_show.c
${CMAKE_SOURCE_DIR}/src/iup_spin.c
${CMAKE_SOURCE_DIR}/src/iup_split.c
${CMAKE_SOURCE_DIR}/src/iup_stdcontrols.h
${CMAKE_SOURCE_DIR}/src/iup_str.c
${CMAKE_SOURCE_DIR}/src/iup_str.h
${CMAKE_SOURCE_DIR}/src/iup_strmessage.c
${CMAKE_SOURCE_DIR}/src/iup_strmessage.h
${CMAKE_SOURCE_DIR}/src/iup_table.c
${CMAKE_SOURCE_DIR}/src/iup_table.h
${CMAKE_SOURCE_DIR}/src/iup_tabs.c
${CMAKE_SOURCE_DIR}/src/iup_tabs.h
${CMAKE_SOURCE_DIR}/src/iup_text.c
${CMAKE_SOURCE_DIR}/src/iup_text.h
${CMAKE_SOURCE_DIR}/src/iup_timer.c
${CMAKE_SOURCE_DIR}/src/iup_timer.h
${CMAKE_SOURCE_DIR}/src/iup_toggle.c
${CMAKE_SOURCE_DIR}/src/iup_toggle.h
${CMAKE_SOURCE_DIR}/src/iup_tree.c
${CMAKE_SOURCE_DIR}/src/iup_tree.h
${CMAKE_SOURCE_DIR}/src/iup_user.c
${CMAKE_SOURCE_DIR}/src/iup_val.c
${CMAKE_SOURCE_DIR}/src/iup_val.h
${CMAKE_SOURCE_DIR}/src/iup_vbox.c
${CMAKE_SOURCE_DIR}/src/iup_zbox.c
)
SET(IUPIMGLIB_COMMON_SOURCE_FILES
${CMAKE_SOURCE_DIR}/srcimglib/iup_image_library.c
${CMAKE_SOURCE_DIR}/srcimglib/iup_imglib_circleprogress.c
)
SET(IUPOLE_COMMON_SOURCE_FILES
)
SET(IUPWEB_COMMON_SOURCE_FILES
${CMAKE_SOURCE_DIR}/srcweb/iup_webbrowser.c
${CMAKE_SOURCE_DIR}/srcweb/iup_webbrowser.h
)
SET(IUPCD_COMMON_SOURCE_FILES
${CMAKE_SOURCE_DIR}/srccd/iup_cd.c
${CMAKE_SOURCE_DIR}/srccd/iup_cdutil.c
${CMAKE_SOURCE_DIR}/srccd/iup_cdutil.h
)
SET(IUPCONTROLS_COMMON_SOURCE_FILES
${CMAKE_SOURCE_DIR}/srccontrols/iup_cells.c
${CMAKE_SOURCE_DIR}/srccontrols/iup_controls.c
${CMAKE_SOURCE_DIR}/srccontrols/iup_controls.h
${CMAKE_SOURCE_DIR}/srccontrols/iup_matrixlist.c
${CMAKE_SOURCE_DIR}/srccontrols/matrix/iupmat_aux.c
${CMAKE_SOURCE_DIR}/srccontrols/matrix/iupmat_aux.h
${CMAKE_SOURCE_DIR}/srccontrols/matrix/iupmat_cd.h
${CMAKE_SOURCE_DIR}/srccontrols/matrix/iupmat_colres.c
${CMAKE_SOURCE_DIR}/srccontrols/matrix/iupmat_colres.h
${CMAKE_SOURCE_DIR}/srccontrols/matrix/iupmat_def.h
${CMAKE_SOURCE_DIR}/srccontrols/matrix/iupmat_draw.c
${CMAKE_SOURCE_DIR}/srccontrols/matrix/iupmat_draw.h
${CMAKE_SOURCE_DIR}/srccontrols/matrix/iupmat_edit.c
${CMAKE_SOURCE_DIR}/srccontrols/matrix/iupmat_edit.h
${CMAKE_SOURCE_DIR}/srccontrols/matrix/iupmat_ex.c
${CMAKE_SOURCE_DIR}/srccontrols/matrix/iupmat_getset.c
${CMAKE_SOURCE_DIR}/srccontrols/matrix/iupmat_getset.h
${CMAKE_SOURCE_DIR}/srccontrols/matrix/iupmat_key.c
${CMAKE_SOURCE_DIR}/srccontrols/matrix/iupmat_key.h
${CMAKE_SOURCE_DIR}/srccontrols/matrix/iupmat_mark.c
${CMAKE_SOURCE_DIR}/srccontrols/matrix/iupmat_mark.h
${CMAKE_SOURCE_DIR}/srccontrols/matrix/iupmat_mem.c
${CMAKE_SOURCE_DIR}/srccontrols/matrix/iupmat_mem.h
${CMAKE_SOURCE_DIR}/srccontrols/matrix/iupmat_mouse.c
${CMAKE_SOURCE_DIR}/srccontrols/matrix/iupmat_mouse.h
${CMAKE_SOURCE_DIR}/srccontrols/matrix/iupmat_numlc.c
${CMAKE_SOURCE_DIR}/srccontrols/matrix/iupmat_numlc.h
${CMAKE_SOURCE_DIR}/srccontrols/matrix/iupmat_scroll.c
${CMAKE_SOURCE_DIR}/srccontrols/matrix/iupmat_scroll.h
${CMAKE_SOURCE_DIR}/srccontrols/matrix/iupmatrix.c
${CMAKE_SOURCE_DIR}/srccontrols/matrixex/iupmatex_busy.c
${CMAKE_SOURCE_DIR}/srccontrols/matrixex/iupmatex_clipboard.c
${CMAKE_SOURCE_DIR}/srccontrols/matrixex/iupmatex_copy.c
${CMAKE_SOURCE_DIR}/srccontrols/matrixex/iupmatex_export.c
${CMAKE_SOURCE_DIR}/srccontrols/matrixex/iupmatex_find.c
${CMAKE_SOURCE_DIR}/srccontrols/matrixex/iupmatex_sort.c
${CMAKE_SOURCE_DIR}/srccontrols/matrixex/iupmatex_undo.c
${CMAKE_SOURCE_DIR}/srccontrols/matrixex/iupmatex_units.c
${CMAKE_SOURCE_DIR}/srccontrols/matrixex/iupmatex_visible.c
${CMAKE_SOURCE_DIR}/srccontrols/matrixex/iup_matrixex.c
${CMAKE_SOURCE_DIR}/srccontrols/matrixex/iup_matrixex.h
)
SET(IUP_LINK_LIBRARIES "")
SET(IUP_SOURCE_FILES ${IUP_COMMON_SOURCE_FILES})
SET(IUP_FOREIGN_SOURCE_FILES "")
SET(IUPIMGLIB_LINK_LIBRARIES "iup")
SET(IUPIMGLIB_SOURCE_FILES ${IUPIMGLIB_COMMON_SOURCE_FILES})
SET(IUPIMGLIB_FOREIGN_SOURCE_FILES "")
SET(IUPOLE_LINK_LIBRARIES "")
SET(IUPOLE_SOURCE_FILES ${IUPOLE_COMMON_SOURCE_FILES})
SET(IUPOLE_FOREIGN_SOURCE_FILES "")
SET(IUPWEB_LINK_LIBRARIES "iup")
SET(IUPWEB_SOURCE_FILES ${IUPWEB_COMMON_SOURCE_FILES})
SET(IUPWEB_FOREIGN_SOURCE_FILES "")
SET(IUP_SHOULD_BUILD_IUPWEB FALSE)
SET(IUPCD_LINK_LIBRARIES "iup;${CD_LIBRARY}")
SET(IUPCD_SOURCE_FILES ${IUPCD_COMMON_SOURCE_FILES})
SET(IUPCD_FOREIGN_SOURCE_FILES "")
SET(IUP_SHOULD_BUILD_IUPCD FALSE)
SET(IUPCONTROLS_LINK_LIBRARIES "iupcd;iup")
SET(IUPCONTROLS_SOURCE_FILES ${IUPCONTROLS_COMMON_SOURCE_FILES})
SET(IUPCONTROLS_FOREIGN_SOURCE_FILES "")
SET(IUP_SHOULD_BUILD_IUPCONTROLS FALSE)
IF(IUP_USE_EMSCRIPTEN)
SET(IUP_EMSCRIPTEN_SOURCE_FILES
# TODO: Get clarification on iup_datepick.c
${CMAKE_SOURCE_DIR}/src/iup_datepick.c
${CMAKE_SOURCE_DIR}/src/emscripten/iupemscripten_button.c
${CMAKE_SOURCE_DIR}/src/emscripten/iupemscripten_calendar.c
${CMAKE_SOURCE_DIR}/src/emscripten/iupemscripten_canvas.c
${CMAKE_SOURCE_DIR}/src/emscripten/iupemscripten_clipboard.c
# ${CMAKE_SOURCE_DIR}/src/emscripten/iupemscripten_colordlg.c # Needs to be deleted
${CMAKE_SOURCE_DIR}/src/emscripten/iupemscripten_common.c
# ${CMAKE_SOURCE_DIR}/src/emscripten/iupemscripten_datepick.c
${CMAKE_SOURCE_DIR}/src/emscripten/iupemscripten_dialog.c
${CMAKE_SOURCE_DIR}/src/emscripten/iupemscripten_dragdrop.c
${CMAKE_SOURCE_DIR}/src/emscripten/iupemscripten_draw.c
${CMAKE_SOURCE_DIR}/src/emscripten/iupemscripten_filedlg.c
${CMAKE_SOURCE_DIR}/src/emscripten/iupemscripten_focus.c
${CMAKE_SOURCE_DIR}/src/emscripten/iupemscripten_font.c
${CMAKE_SOURCE_DIR}/src/emscripten/iupemscripten_fontdlg.c
${CMAKE_SOURCE_DIR}/src/emscripten/iupemscripten_frame.c
${CMAKE_SOURCE_DIR}/src/emscripten/iupemscripten_globalattrib.c
${CMAKE_SOURCE_DIR}/src/emscripten/iupemscripten_help.c
${CMAKE_SOURCE_DIR}/src/emscripten/iupemscripten_image.c
${CMAKE_SOURCE_DIR}/src/emscripten/iupemscripten_info.c
${CMAKE_SOURCE_DIR}/src/emscripten/iupemscripten_key.c
${CMAKE_SOURCE_DIR}/src/emscripten/iupemscripten_label.c
${CMAKE_SOURCE_DIR}/src/emscripten/iupemscripten_list.c
${CMAKE_SOURCE_DIR}/src/emscripten/iupemscripten_loop.c
${CMAKE_SOURCE_DIR}/src/emscripten/iupemscripten_menu.c
${CMAKE_SOURCE_DIR}/src/emscripten/iupemscripten_messagedlg.c
${CMAKE_SOURCE_DIR}/src/emscripten/iupemscripten_open.c
${CMAKE_SOURCE_DIR}/src/emscripten/iupemscripten_progressbar.c
${CMAKE_SOURCE_DIR}/src/emscripten/iupemscripten_tabs.c
${CMAKE_SOURCE_DIR}/src/emscripten/iupemscripten_text.c
${CMAKE_SOURCE_DIR}/src/emscripten/iupemscripten_timer.c
${CMAKE_SOURCE_DIR}/src/emscripten/iupemscripten_tips.c
${CMAKE_SOURCE_DIR}/src/emscripten/iupemscripten_toggle.c
${CMAKE_SOURCE_DIR}/src/emscripten/iupemscripten_tree.c
${CMAKE_SOURCE_DIR}/src/emscripten/iupemscripten_val.c
)
SET(IUP_EMSCRIPTEN_FOREIGN_SOURCE_FILES
${CMAKE_SOURCE_DIR}/src/emscripten/iupemscripten_button.js
${CMAKE_SOURCE_DIR}/src/emscripten/iupemscripten_common.js
${CMAKE_SOURCE_DIR}/src/emscripten/iupemscripten_dialog.js
${CMAKE_SOURCE_DIR}/src/emscripten/iupemscripten_label.js
)
LIST(APPEND IUP_SOURCE_FILES
${IUP_EMSCRIPTEN_SOURCE_FILES}
)
LIST(APPEND IUP_FOREIGN_SOURCE_FILES
${IUP_EMSCRIPTEN_FOREIGN_SOURCE_FILES}
)
SET(IUPIMGLIB_EMSCRIPTEN_SOURCE_FILES
# TODO:
${CMAKE_SOURCE_DIR}/srcimglib/iup_imglib_logos48x48.c
${CMAKE_SOURCE_DIR}/srcimglib/iup_imglib_logos32x32.c
)
SET(IUPIMGLIB_EMSCRIPTEN_FOREIGN_SOURCE_FILES
)
LIST(APPEND IUPIMGLIB_SOURCE_FILES
${IUPIMGLIB_EMSCRIPTEN_SOURCE_FILES}
)
LIST(APPEND IUPIMGLIB_FOREIGN_SOURCE_FILES
${IUPIMGLIB_EMSCRIPTEN_FOREIGN_SOURCE_FILES}
)
SET(IUPWEB_EMSCRIPTEN_SOURCE_FILES
# TODO:
)
SET(IUPWEB_EMSCRIPTEN_FOREIGN_SOURCE_FILES
)
LIST(APPEND IUPWEB_SOURCE_FILES
${IUPWEB_EMSCRIPTEN_SOURCE_FILES}
)
LIST(APPEND IUPWEB_FOREIGN_SOURCE_FILES
${IUPWEB_EMSCRIPTEN_FOREIGN_SOURCE_FILES}
)
SET(IUP_SHOULD_BUILD_IUPWEB FALSE)
ELSEIF(IUP_USE_ANDROID)
SET(IUP_ANDROID_SOURCE_FILES
# TODO: Get clarification on iup_datepick.c
${CMAKE_SOURCE_DIR}/src/iup_datepick.c
${CMAKE_SOURCE_DIR}/src/android/source/iupandroid_button.c
${CMAKE_SOURCE_DIR}/src/android/source/iupandroid_calendar.c
${CMAKE_SOURCE_DIR}/src/android/source/iupandroid_canvas.c
${CMAKE_SOURCE_DIR}/src/android/source/iupandroid_clipboard.c
# ${CMAKE_SOURCE_DIR}/src/android/source/iupandroid_colordlg.c # Needs to be deleted
${CMAKE_SOURCE_DIR}/src/android/source/iupandroid_common.c
${CMAKE_SOURCE_DIR}/src/android/source/iupandroid_dialog.c
${CMAKE_SOURCE_DIR}/src/android/source/iupandroid_dragdrop.c
${CMAKE_SOURCE_DIR}/src/android/source/iupandroid_draw.c
${CMAKE_SOURCE_DIR}/src/android/source/iupandroid_drv.h
${CMAKE_SOURCE_DIR}/src/android/source/iupandroid_filedlg.c
${CMAKE_SOURCE_DIR}/src/android/source/iupandroid_focus.c
${CMAKE_SOURCE_DIR}/src/android/source/iupandroid_font.c
${CMAKE_SOURCE_DIR}/src/android/source/iupandroid_fontdlg.c
${CMAKE_SOURCE_DIR}/src/android/source/iupandroid_frame.c
${CMAKE_SOURCE_DIR}/src/android/source/iupandroid_globalattrib.c
${CMAKE_SOURCE_DIR}/src/android/source/iupandroid_help.c
${CMAKE_SOURCE_DIR}/src/android/source/iupandroid_image.c
${CMAKE_SOURCE_DIR}/src/android/source/iupandroid_info.c
${CMAKE_SOURCE_DIR}/src/android/source/iupandroid_jni_IupApplication.c
${CMAKE_SOURCE_DIR}/src/android/source/iupandroid_jni_IupActivity.c
${CMAKE_SOURCE_DIR}/src/android/source/iupandroid_jni_IupCommon.c
${CMAKE_SOURCE_DIR}/src/android/source/iupandroid_jni_IupLaunchActivity.c
${CMAKE_SOURCE_DIR}/src/android/source/iupandroid_jnicacheglobals.c
${CMAKE_SOURCE_DIR}/src/android/source/iupandroid_jnicacheglobals.h
${CMAKE_SOURCE_DIR}/src/android/source/iupandroid_jnimacros.h
#${CMAKE_SOURCE_DIR}/src/android/source/iupandroid_key.c
${CMAKE_SOURCE_DIR}/src/android/source/iupandroid_label.c
${CMAKE_SOURCE_DIR}/src/android/source/iupandroid_list.c
${CMAKE_SOURCE_DIR}/src/android/source/iupandroid_loop.c
${CMAKE_SOURCE_DIR}/src/android/source/iupandroid_menu.c
${CMAKE_SOURCE_DIR}/src/android/source/iupandroid_messagedlg.c
${CMAKE_SOURCE_DIR}/src/android/source/iupandroid_open.c
${CMAKE_SOURCE_DIR}/src/android/source/iupandroid_progressbar.c
${CMAKE_SOURCE_DIR}/src/android/source/iupandroid_tabs.c
${CMAKE_SOURCE_DIR}/src/android/source/iupandroid_text.c
${CMAKE_SOURCE_DIR}/src/android/source/iupandroid_timer.c
${CMAKE_SOURCE_DIR}/src/android/source/iupandroid_tips.c
${CMAKE_SOURCE_DIR}/src/android/source/iupandroid_toggle.c
${CMAKE_SOURCE_DIR}/src/android/source/iupandroid_tree.c
${CMAKE_SOURCE_DIR}/src/android/source/iupandroid_val.c
)
LIST(APPEND IUP_SOURCE_FILES
${IUP_ANDROID_SOURCE_FILES}
)
FIND_LIBRARY(ANDROID_LOG_LIBRARY log)
FIND_LIBRARY(ANDROID_JNIGRAPHICS_LIBRARY jnigraphics)
LIST(APPEND IUP_LINK_LIBRARIES
${ANDROID_JNIGRAPHICS_LIBRARY}
${ANDROID_LOG_LIBRARY}
)
SET(IUPIMGLIB_ANDROID_SOURCE_FILES
# TODO:
${CMAKE_SOURCE_DIR}/srcimglib/iup_imglib_logos48x48.c
${CMAKE_SOURCE_DIR}/srcimglib/iup_imglib_logos32x32.c
)
LIST(APPEND IUPIMGLIB_SOURCE_FILES
${IUPIMGLIB_ANDROID_SOURCE_FILES}
)
SET(IUPWEB_ANDROID_SOURCE_FILES
${CMAKE_SOURCE_DIR}/srcweb/android/iupandroid_webbrowser.c
${CMAKE_SOURCE_DIR}/srcweb/android/iupandroid_jni_IupWebView.c
)
LIST(APPEND IUPWEB_SOURCE_FILES
${IUPWEB_ANDROID_SOURCE_FILES}
)
# Annoying hack to get around Android Studio always rebuilding everything for every target.
# arguments "-DIUP_ANDROID_BUILD_IUPWEB=1"
IF(IUP_ANDROID_BUILD_IUPWEB)
SET(IUP_SHOULD_BUILD_IUPWEB TRUE)
ELSE()
SET(IUP_SHOULD_BUILD_IUPWEB FALSE)
ENDIF()
ELSEIF(IUP_USE_COCOATOUCH)
SET(IUP_COCOATOUCH_SOURCE_FILES
# TODO: Get clarification on iup_datepick.c
${CMAKE_SOURCE_DIR}/src/iup_datepick.c
${CMAKE_SOURCE_DIR}/src/cocoatouch/IupAppDelegate.h
${CMAKE_SOURCE_DIR}/src/cocoatouch/IupAppDelegate.m
${CMAKE_SOURCE_DIR}/src/cocoatouch/IupAppDelegateProtocol.h
${CMAKE_SOURCE_DIR}/src/cocoatouch/iupcocoatouch_button.m
${CMAKE_SOURCE_DIR}/src/cocoatouch/iupcocoatouch_calendar.m
${CMAKE_SOURCE_DIR}/src/cocoatouch/iupcocoatouch_canvas.m
${CMAKE_SOURCE_DIR}/src/cocoatouch/iupcocoatouch_clipboard.m
# ${CMAKE_SOURCE_DIR}/src/cocoatouch/iupcocoatouch_colordlg.m # Needs to be deleted
${CMAKE_SOURCE_DIR}/src/cocoatouch/iupcocoatouch_common.m
# ${CMAKE_SOURCE_DIR}/src/cocoatouch/iupcocoatouch_datepick.m
${CMAKE_SOURCE_DIR}/src/cocoatouch/iupcocoatouch_dialog.m
${CMAKE_SOURCE_DIR}/src/cocoatouch/iupcocoatouch_dragdrop.m
${CMAKE_SOURCE_DIR}/src/cocoatouch/iupcocoatouch_draw.m
${CMAKE_SOURCE_DIR}/src/cocoatouch/iupcocoatouch_drv.h
${CMAKE_SOURCE_DIR}/src/cocoatouch/iupcocoatouch_filedlg.m
${CMAKE_SOURCE_DIR}/src/cocoatouch/iupcocoatouch_focus.m
${CMAKE_SOURCE_DIR}/src/cocoatouch/iupcocoatouch_font.m
${CMAKE_SOURCE_DIR}/src/cocoatouch/iupcocoatouch_fontdlg.m
${CMAKE_SOURCE_DIR}/src/cocoatouch/iupcocoatouch_frame.m
${CMAKE_SOURCE_DIR}/src/cocoatouch/iupcocoatouch_globalattrib.m
${CMAKE_SOURCE_DIR}/src/cocoatouch/iupcocoatouch_help.c
${CMAKE_SOURCE_DIR}/src/cocoatouch/iupcocoatouch_image.m
${CMAKE_SOURCE_DIR}/src/cocoatouch/iupcocoatouch_info.m
${CMAKE_SOURCE_DIR}/src/cocoatouch/iupcocoatouch_key.m
${CMAKE_SOURCE_DIR}/src/cocoatouch/iupcocoatouch_label.m
${CMAKE_SOURCE_DIR}/src/cocoatouch/iupcocoatouch_list.m
${CMAKE_SOURCE_DIR}/src/cocoatouch/iupcocoatouch_loop.m
${CMAKE_SOURCE_DIR}/src/cocoatouch/iupcocoatouch_menu.m
${CMAKE_SOURCE_DIR}/src/cocoatouch/iupcocoatouch_messagedlg.m
${CMAKE_SOURCE_DIR}/src/cocoatouch/iupcocoatouch_open.m
${CMAKE_SOURCE_DIR}/src/cocoatouch/iupcocoatouch_progressbar.m
${CMAKE_SOURCE_DIR}/src/cocoatouch/iupcocoatouch_tabs.m
${CMAKE_SOURCE_DIR}/src/cocoatouch/iupcocoatouch_text.m
${CMAKE_SOURCE_DIR}/src/cocoatouch/iupcocoatouch_timer.m
${CMAKE_SOURCE_DIR}/src/cocoatouch/iupcocoatouch_tips.m
${CMAKE_SOURCE_DIR}/src/cocoatouch/iupcocoatouch_toggle.m
${CMAKE_SOURCE_DIR}/src/cocoatouch/iupcocoatouch_tree.m
${CMAKE_SOURCE_DIR}/src/cocoatouch/iupcocoatouch_val.m
${CMAKE_SOURCE_DIR}/src/cocoatouch/IupLaunchViewController.h
${CMAKE_SOURCE_DIR}/src/cocoatouch/IupLaunchViewController.m
# ${CMAKE_SOURCE_DIR}/src/cocoatouch/iupmac_info.m
)
LIST(APPEND IUP_SOURCE_FILES
${IUP_COCOATOUCH_SOURCE_FILES}
)
FIND_LIBRARY(APPLE_UIKIT_LIBRARY UIKit)
FIND_LIBRARY(APPLE_FOUNDATION_LIBRARY Foundation)
FIND_LIBRARY(APPLE_QUARTZCORE_LIBRARY QuartzCore)
FIND_LIBRARY(APPLE_COREGRAPHICS_LIBRARY CoreGraphics)
LIST(APPEND IUP_LINK_LIBRARIES
${APPLE_UIKIT_LIBRARY}
${APPLE_QUARTZCORE_LIBRARY}
${APPLE_COREGRAPHICS_LIBRARY}
${APPLE_FOUNDATION_LIBRARY}
)
SET(IUPIMGLIB_COCOATOUCH_SOURCE_FILES
# TODO:
${CMAKE_SOURCE_DIR}/srcimglib/iup_imglib_logos48x48.c
${CMAKE_SOURCE_DIR}/srcimglib/iup_imglib_logos32x32.c
)
LIST(APPEND IUPIMGLIB_SOURCE_FILES
${IUPIMGLIB_COCOATOUCH_SOURCE_FILES}
)
FIND_LIBRARY(APPLE_WEBKIT_LIBRARY WebKit)
SET(IUPWEB_COCOATOUCH_SOURCE_FILES
${CMAKE_SOURCE_DIR}/srcweb/iupcocoatouch_webbrowser.m
)
LIST(APPEND IUPWEB_SOURCE_FILES
${IUPWEB_COCOATOUCH_SOURCE_FILES}
)
LIST(APPEND IUPWEB_LINK_LIBRARIES
${APPLE_WEBKIT_LIBRARY}
)
SET(IUP_SHOULD_BUILD_IUPWEB TRUE)
ELSEIF(IUP_USE_COCOA)
SET(IUP_COCOA_SOURCE_FILES
# TODO: Get clarification on iup_datepick.c
${CMAKE_SOURCE_DIR}/src/iup_datepick.c
${CMAKE_SOURCE_DIR}/src/cocoa/IUPCocoaVerticalAlignmentTextFieldCell.h
${CMAKE_SOURCE_DIR}/src/cocoa/IUPCocoaVerticalAlignmentTextFieldCell.m
${CMAKE_SOURCE_DIR}/src/cocoa/IUPTextSpinnerFilesOwner.h
${CMAKE_SOURCE_DIR}/src/cocoa/IUPTextSpinnerFilesOwner.m
${CMAKE_SOURCE_DIR}/src/cocoa/IupAppDelegate.h
${CMAKE_SOURCE_DIR}/src/cocoa/IupAppDelegate.m
${CMAKE_SOURCE_DIR}/src/cocoa/iupcocoa_button.m
${CMAKE_SOURCE_DIR}/src/cocoa/iupcocoa_calendar.m
${CMAKE_SOURCE_DIR}/src/cocoa/iupcocoa_canvas.m
${CMAKE_SOURCE_DIR}/src/cocoa/iupcocoa_clipboard.m
# ${CMAKE_SOURCE_DIR}/src/cocoa/iupcocoa_colordlg.m # Needs to be deleted
${CMAKE_SOURCE_DIR}/src/cocoa/iupcocoa_common.m
# ${CMAKE_SOURCE_DIR}/src/cocoa/iupcocoa_datepick.m
${CMAKE_SOURCE_DIR}/src/cocoa/iupcocoa_dialog.m
${CMAKE_SOURCE_DIR}/src/cocoa/iupcocoa_dragdrop.m
${CMAKE_SOURCE_DIR}/src/cocoa/iupcocoa_draw.m
${CMAKE_SOURCE_DIR}/src/cocoa/iupcocoa_drv.h
${CMAKE_SOURCE_DIR}/src/cocoa/iupcocoa_filedlg.m
${CMAKE_SOURCE_DIR}/src/cocoa/iupcocoa_focus.m
${CMAKE_SOURCE_DIR}/src/cocoa/iupcocoa_font.m
${CMAKE_SOURCE_DIR}/src/cocoa/iupcocoa_fontdlg.m
${CMAKE_SOURCE_DIR}/src/cocoa/iupcocoa_frame.m
${CMAKE_SOURCE_DIR}/src/cocoa/iupcocoa_image.m
${CMAKE_SOURCE_DIR}/src/cocoa/iupcocoa_info.m
${CMAKE_SOURCE_DIR}/src/cocoa/iupcocoa_label.m
${CMAKE_SOURCE_DIR}/src/cocoa/iupcocoa_list.m
${CMAKE_SOURCE_DIR}/src/cocoa/iupcocoa_loop.m
${CMAKE_SOURCE_DIR}/src/cocoa/iupcocoa_menu.m
${CMAKE_SOURCE_DIR}/src/cocoa/iupcocoa_messagedlg.m
${CMAKE_SOURCE_DIR}/src/cocoa/iupcocoa_open.m
${CMAKE_SOURCE_DIR}/src/cocoa/iupcocoa_progressbar.m
${CMAKE_SOURCE_DIR}/src/cocoa/iupcocoa_tabs.m
${CMAKE_SOURCE_DIR}/src/cocoa/iupcocoa_text.m
${CMAKE_SOURCE_DIR}/src/cocoa/iupcocoa_timer.m
${CMAKE_SOURCE_DIR}/src/cocoa/iupcocoa_tips.m
${CMAKE_SOURCE_DIR}/src/cocoa/iupcocoa_toggle.m
${CMAKE_SOURCE_DIR}/src/cocoa/iupcocoa_tree.m
${CMAKE_SOURCE_DIR}/src/cocoa/iupcocoa_val.m
${CMAKE_SOURCE_DIR}/src/cocoa/iupmac_globalattrib.m
${CMAKE_SOURCE_DIR}/src/cocoa/iupmac_help.m
# This file was replaced with iupcocoa_info.m
# ${CMAKE_SOURCE_DIR}/src/cocoa/iupmac_info.m
${CMAKE_SOURCE_DIR}/src/cocoa/iupmac_key.m
${CMAKE_SOURCE_DIR}/src/cocoa/iupmac_keycodes.h
# Stop gap
# ${CMAKE_SOURCE_DIR}/src/gtk/iupmac_help.c
)
LIST(APPEND IUP_SOURCE_FILES
${IUP_COCOA_SOURCE_FILES}
)
LIST(APPEND IUP_COCOA_XIB_FILES
${CMAKE_SOURCE_DIR}/src/cocoa/xib/Base.lproj/CanonicalServiceMenu.xib
${CMAKE_SOURCE_DIR}/src/cocoa/xib/Base.lproj/CanonicalWindowMenu.xib
${CMAKE_SOURCE_DIR}/src/cocoa/xib/Base.lproj/IupCocoaOutlineView.xib
${CMAKE_SOURCE_DIR}/src/cocoa/xib/Base.lproj/IupMainMenu.xib
${CMAKE_SOURCE_DIR}/src/cocoa/xib/Base.lproj/IupTextSpinner.xib
)
LIST(APPEND IUP_SOURCE_FILES
${IUP_COCOA_XIB_FILES}
)
# Not sure how to handle GNUStep
FIND_LIBRARY(APPLE_COCOA_LIBRARY Cocoa)
FIND_LIBRARY(APPLE_QUARTZCORE_LIBRARY QuartzCore)
FIND_LIBRARY(APPLE_SYSTEMCONFIGURATION_LIBRARY SystemConfiguration)
LIST(APPEND IUP_LINK_LIBRARIES
${APPLE_COCOA_LIBRARY}
${APPLE_QUARTZCORE_LIBRARY}
${APPLE_SYSTEMCONFIGURATION_LIBRARY}
)
SET(IUPIMGLIB_COCOA_SOURCE_FILES
# TODO:
${CMAKE_SOURCE_DIR}/srcimglib/iup_imglib_logos48x48.c
${CMAKE_SOURCE_DIR}/srcimglib/iup_imglib_logos32x32.c
)
LIST(APPEND IUPIMGLIB_SOURCE_FILES
${IUPIMGLIB_COCOA_SOURCE_FILES}
)
FIND_LIBRARY(APPLE_WEBKIT_LIBRARY WebKit)
SET(IUPWEB_COCOA_SOURCE_FILES
${CMAKE_SOURCE_DIR}/srcweb/iupcocoa_webbrowser.m
)
LIST(APPEND IUPWEB_SOURCE_FILES
${IUPWEB_COCOA_SOURCE_FILES}
)
LIST(APPEND IUPWEB_LINK_LIBRARIES
${APPLE_WEBKIT_LIBRARY}
)
SET(IUP_SHOULD_BUILD_IUPWEB TRUE)
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/src/cocoa)
ELSEIF(IUP_USE_WIN32)
SET(IUP_WIN32_SOURCE_FILES