-
Notifications
You must be signed in to change notification settings - Fork 20
/
CMakeLists.txt
1600 lines (1475 loc) · 71.4 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
cmake_minimum_required (VERSION 3.0)
#set( CMAKE_VERBOSE_MAKEFILE on )
#set(CMAKE_BUILD_TYPE Debug) # Warning! this will recompile everything!
project(PolyVR)
message( "Configuring for system name / version: " ${CMAKE_SYSTEM_NAME} " / " ${CMAKE_SYSTEM_VERSION} )
macro(addDefinition v1 v2)
if(${v1})
add_definitions( ${v2} )
endif()
endmacro()
if("${CMAKE_SYSTEM_NAME}" STREQUAL "Emscripten")
set(WASM ON)
endif()
if(WASM)
unset(UNIX)
message( " -> WASM variable set" )
endif()
set(versionScript "genVersion.sh")
if(WIN32)
message( " -> WIN32 variable set" )
set(versionScript "genVersion.bat")
endif()
add_custom_target(
versionTarget
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/src/version/${versionScript}
)
if(LINUX)
message( " -> LINUX variable set" )
add_custom_target(cefResourceCopy)
add_custom_command(TARGET cefResourceCopy PRE_BUILD COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/ressources/cef18/icudtl.dat ${CMAKE_BINARY_DIR})
add_custom_command(TARGET cefResourceCopy PRE_BUILD COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/ressources/cef18/*.bin ${CMAKE_BINARY_DIR})
endif()
if(APPLE)
message( " -> APPLE variable set" )
add_custom_target(cefResourceCopy)
add_custom_command(TARGET cefResourceCopy PRE_BUILD COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/ressources/cefMac/icudtl.dat ${CMAKE_BINARY_DIR})
add_custom_command(TARGET cefResourceCopy PRE_BUILD COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/ressources/cefMac/*.bin ${CMAKE_BINARY_DIR})
add_custom_command(TARGET cefResourceCopy PRE_BUILD COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/ressources/cefMac/*.dylib ${CMAKE_BINARY_DIR})
add_custom_command(TARGET cefResourceCopy PRE_BUILD COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/ressources/cefMac/*.json ${CMAKE_BINARY_DIR})
endif()
if(NOT APPLE)
# Define the name of your library and specify its source files
add_library(freeglut SHARED)
# Optionally, set compile options and include directories for your library
#target_compile_options(freeglut PRIVATE -Wall -Wextra) # Compiler options
target_include_directories(freeglut PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} "src/core/setup/windows/glut/freeglut/src" "src/core/setup/windows/glut/freeglut/include") # Include directories
target_link_options(freeglut PRIVATE "/NODEFAULTLIB:freeglut.lib")
target_sources(freeglut PRIVATE src/core/setup/windows/glut/freeglut/src/fg_callbacks.c)
target_sources(freeglut PRIVATE src/core/setup/windows/glut/freeglut/src/fg_cursor.c)
target_sources(freeglut PRIVATE src/core/setup/windows/glut/freeglut/src/fg_display.c)
target_sources(freeglut PRIVATE src/core/setup/windows/glut/freeglut/src/fg_ext.c)
target_sources(freeglut PRIVATE src/core/setup/windows/glut/freeglut/src/fg_font.c)
target_sources(freeglut PRIVATE src/core/setup/windows/glut/freeglut/src/fg_font_data.c)
target_sources(freeglut PRIVATE src/core/setup/windows/glut/freeglut/src/fg_gamemode.c)
target_sources(freeglut PRIVATE src/core/setup/windows/glut/freeglut/src/fg_geometry.c)
target_sources(freeglut PRIVATE src/core/setup/windows/glut/freeglut/src/fg_gl2.c)
target_sources(freeglut PRIVATE src/core/setup/windows/glut/freeglut/src/fg_init.c)
target_sources(freeglut PRIVATE src/core/setup/windows/glut/freeglut/src/fg_input_devices.c)
target_sources(freeglut PRIVATE src/core/setup/windows/glut/freeglut/src/fg_joystick.c)
target_sources(freeglut PRIVATE src/core/setup/windows/glut/freeglut/src/fg_main.c)
target_sources(freeglut PRIVATE src/core/setup/windows/glut/freeglut/src/fg_menu.c)
target_sources(freeglut PRIVATE src/core/setup/windows/glut/freeglut/src/fg_misc.c)
target_sources(freeglut PRIVATE src/core/setup/windows/glut/freeglut/src/fg_overlay.c)
target_sources(freeglut PRIVATE src/core/setup/windows/glut/freeglut/src/fg_spaceball.c)
target_sources(freeglut PRIVATE src/core/setup/windows/glut/freeglut/src/fg_state.c)
target_sources(freeglut PRIVATE src/core/setup/windows/glut/freeglut/src/fg_stroke_mono_roman.c)
target_sources(freeglut PRIVATE src/core/setup/windows/glut/freeglut/src/fg_stroke_roman.c)
target_sources(freeglut PRIVATE src/core/setup/windows/glut/freeglut/src/fg_structure.c)
target_sources(freeglut PRIVATE src/core/setup/windows/glut/freeglut/src/fg_teapot.c)
target_sources(freeglut PRIVATE src/core/setup/windows/glut/freeglut/src/fg_videoresize.c)
target_sources(freeglut PRIVATE src/core/setup/windows/glut/freeglut/src/fg_window.c)
target_sources(freeglut PRIVATE src/core/setup/windows/glut/freeglut/src/util/xparsegeometry_repl.c)
if(WIN32)
target_sources(freeglut PRIVATE src/core/setup/windows/glut/freeglut/src/mswin/fg_cmap_mswin.c)
target_sources(freeglut PRIVATE src/core/setup/windows/glut/freeglut/src/mswin/fg_cursor_mswin.c)
target_sources(freeglut PRIVATE src/core/setup/windows/glut/freeglut/src/mswin/fg_display_mswin.c)
target_sources(freeglut PRIVATE src/core/setup/windows/glut/freeglut/src/mswin/fg_ext_mswin.c)
target_sources(freeglut PRIVATE src/core/setup/windows/glut/freeglut/src/mswin/fg_gamemode_mswin.c)
target_sources(freeglut PRIVATE src/core/setup/windows/glut/freeglut/src/mswin/fg_init_mswin.c)
target_sources(freeglut PRIVATE src/core/setup/windows/glut/freeglut/src/mswin/fg_input_devices_mswin.c)
target_sources(freeglut PRIVATE src/core/setup/windows/glut/freeglut/src/mswin/fg_joystick_mswin.c)
target_sources(freeglut PRIVATE src/core/setup/windows/glut/freeglut/src/mswin/fg_main_mswin.c)
target_sources(freeglut PRIVATE src/core/setup/windows/glut/freeglut/src/mswin/fg_menu_mswin.c)
target_sources(freeglut PRIVATE src/core/setup/windows/glut/freeglut/src/mswin/fg_spaceball_mswin.c)
target_sources(freeglut PRIVATE src/core/setup/windows/glut/freeglut/src/mswin/fg_state_mswin.c)
target_sources(freeglut PRIVATE src/core/setup/windows/glut/freeglut/src/mswin/fg_structure_mswin.c)
target_sources(freeglut PRIVATE src/core/setup/windows/glut/freeglut/src/mswin/fg_window_mswin.c)
endif() # win32
endif() # not apple
add_definitions( -D__USE_MISC=1 )
set(INCLUDE_DIRS "")
set(LIB_DIRS "")
if(WASM)
# debugging flags:
# -g -s ASSERTIONS=1
#set(LINKER_FLAGS "${LINKER_FLAGS} -s ALLOW_MEMORY_GROWTH=1 -s EXIT_RUNTIME=1 -s DISABLE_EXCEPTION_CATCHING=0 -g")
set(LINKER_FLAGS "${LINKER_FLAGS} -s ALLOW_MEMORY_GROWTH=1 -s EXIT_RUNTIME=1 -s DISABLE_EXCEPTION_CATCHING=0 -s TOTAL_MEMORY=33554432")
set(LINKER_FLAGS "${LINKER_FLAGS} -s MIN_WEBGL_VERSION=2 -s MAX_WEBGL_VERSION=2")
set(LINKER_FLAGS "${LINKER_FLAGS} -s EXPORTED_RUNTIME_METHODS=['lengthBytesUTF8','stringToUTF8','UTF8ToString']")
add_definitions( -DWASM=1 )
add_definitions( -DGLUT_glut_LIBRARY=1 )
add_definitions( -DGLUT_Xi_LIBRARY=1 )
add_definitions( -DGLUT_Xmu_LIBRARY=1 )
add_definitions( -DCMAKE_TOOLCHAIN_FILE=../emsdk/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake )
add_definitions( -DCMAKE_MODULE_PATH=../emsdk/upstream/emscripten/cmake/Modules )
endif()
if(WIN32)
add_definitions( -DWIN32_LEAN_AND_MEAN=1 -D_WIN32_WINNT=0x0502 )
set(DISK "C")
if(EXISTS "D:/usr/vcpkg")
set(DISK "D")
endif()
set(LIB_DIRS ${LIB_DIRS} "${DISK}:/usr/lib;${DISK}:/usr/vcpkg/installed/x64-windows/lib")
set(INCLUDE_DIRS ${INCLUDE_DIRS} "${DISK}:/usr/vcpkg/installed/x64-windows/include")
set(INCLUDE_DIRS ${INCLUDE_DIRS} "${DISK}:/usr/include")
set(LINKER_FLAGS ${LINKER_FLAGS} wininet.lib dwmapi.lib cairo.lib)
endif()
# command to copy the freeglut dll, lib and header to /c/usr/
if(WIN32)
#(TARGET freeglut POST_BUILD
# COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/src/core/setup/windows/glut/freeglut/include/GL/* ${DISK}:/usr/vcpkg/installed/x64-windows/include/GL/
# WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
#)
add_custom_command(TARGET freeglut POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/build/Release/freeglut.dll ${DISK}:/usr/vcpkg/installed/x64-windows/bin/
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
add_custom_command(TARGET freeglut POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/build/Release/freeglut.lib ${DISK}:/usr/vcpkg/installed/x64-windows/lib/
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
endif()
if(UNIX)
add_definitions( -DBOOST_NO_COMPILER_CONFIG )
add_definitions( -DBOOST_NO_CXX14_DECLTYPE_AUTO )
add_definitions( -DBOOST_NO_CXX14_CONSTEXPR )
add_definitions( -DBOOST_NO_CXX11_DECLTYPE_N3276 )
add_definitions( -DBOOST_NO_CXX11_HDR_ATOMIC=1 )
add_definitions( -DGL_GLEXT_PROTOTYPES )
add_definitions( -DLINUX )
set(LINKER_FLAGS "${LINKER_FLAGS} -lpthread")
endif()
function(FIND_ZLIB)
if(UNIX)
set(LINKER_FLAGS "${LINKER_FLAGS} -lz" PARENT_SCOPE)
endif()
if(WASM)
set(INCLUDE_DIRS ${INCLUDE_DIRS} "../emsdk/upstream/emscripten/cache/ports/zlib/zlib-1.2.11" PARENT_SCOPE)
set(LIB_DIRS ${LIB_DIRS} "../emsdk/upstream/emscripten/cache/sysroot/lib/wasm32-emscripten" PARENT_SCOPE)
set(LINKER_FLAGS "${LINKER_FLAGS} -lz" PARENT_SCOPE)
endif()
if(WIN32)
set(LINKER_FLAGS ${LINKER_FLAGS} zlib PARENT_SCOPE)
endif()
endfunction()
function(FIND_LIBXML)
if(UNIX)
set(INCLUDE_DIRS ${INCLUDE_DIRS} "/usr/include/libxml2" PARENT_SCOPE)
set(LINKER_FLAGS "${LINKER_FLAGS} -lxml2" PARENT_SCOPE)
endif()
if(WASM)
set(INCLUDE_DIRS ${INCLUDE_DIRS} "../include/libxml2" PARENT_SCOPE)
set(LIB_DIRS ${LIB_DIRS} "../lib" PARENT_SCOPE)
set(LINKER_FLAGS "${LINKER_FLAGS} -lxml2" PARENT_SCOPE)
endif()
if(WIN32)
set(LINKER_FLAGS ${LINKER_FLAGS} libxml2 PARENT_SCOPE)
endif()
endfunction()
function(FIND_BOOST)
if(LINUX)
set(LINKER_FLAGS "${LINKER_FLAGS} -lboost_system -lboost_program_options -lboost_serialization -lboost_filesystem" PARENT_SCOPE)
endif()
if(APPLE)
find_package(Boost REQUIRED COMPONENTS system filesystem)
set(INCLUDE_DIRS ${INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} PARENT_SCOPE)
set(LINKER_FLAGS "${LINKER_FLAGS} -lboost_system -lboost_program_options -lboost_serialization -lboost_filesystem" PARENT_SCOPE)
endif()
if(WASM)
#set(INCLUDE_DIRS ${INCLUDE_DIRS} "../emsdk/upstream/emscripten/cache/ports/boost_headers" PARENT_SCOPE)
set(INCLUDE_DIRS ${INCLUDE_DIRS} "../include/boost_headers" PARENT_SCOPE)
set(LIB_DIRS ${LIB_DIRS} "../lib" PARENT_SCOPE)
set(LINKER_FLAGS "${LINKER_FLAGS} -lboost_system -lboost_program_options -lboost_serialization -lboost_filesystem" PARENT_SCOPE)
endif()
if(WIN32)
set(INCLUDE_DIRS ${INCLUDE_DIRS} "${DISK}:/usr/vcpkg/installed/x64-windows/include/boost" PARENT_SCOPE)
set(LINKER_FLAGS ${LINKER_FLAGS} boost_system-vc140-mt boost_program_options-vc140-mt boost_serialization-vc140-mt boost_filesystem-vc140-mt boost_thread-vc140-mt PARENT_SCOPE)
endif()
endfunction()
function(FIND_FREETYPE)
if(LINUX)
set(INCLUDE_DIRS ${INCLUDE_DIRS} "/usr/include/freetype2" PARENT_SCOPE)
set(LINKER_FLAGS "${LINKER_FLAGS} -lfreetype" PARENT_SCOPE)
endif()
if(APPLE)
set(INCLUDE_DIRS ${INCLUDE_DIRS} "/opt/X11/include/freetype2" PARENT_SCOPE)
set(LIB_DIRS ${LIB_DIRS} "/opt/homebrew/lib" PARENT_SCOPE)
set(LINKER_FLAGS "${LINKER_FLAGS} -lfreetype" PARENT_SCOPE)
endif()
if(WASM)
set(INCLUDE_DIRS ${INCLUDE_DIRS} "../emsdk/upstream/emscripten/cache/sysroot/include/freetype2/freetype" PARENT_SCOPE)
set(LIB_DIRS ${LIB_DIRS} "../emsdk/upstream/emscripten/cache/sysroot/lib/wasm32-emscripten" PARENT_SCOPE)
set(LINKER_FLAGS "${LINKER_FLAGS} -lfreetype" PARENT_SCOPE)
endif()
if(WIN32)
set(LINKER_FLAGS ${LINKER_FLAGS} freetype PARENT_SCOPE)
endif()
endfunction()
function(FIND_PYTHON)
if(LINUX)
set(INCLUDE_DIRS ${INCLUDE_DIRS} "/usr/include/python2.7" PARENT_SCOPE)
set(LINKER_FLAGS "${LINKER_FLAGS} -lpython2.7" PARENT_SCOPE)
endif()
if(APPLE)
# TODO get pyenv root
#set(INCLUDE_DIRS ${INCLUDE_DIRS} "${PYENV_PATH}/versions/2.7.18/include/python2.7" PARENT_SCOPE)
set(INCLUDE_DIRS ${INCLUDE_DIRS} "/Users/victorhafner/.pyenv/versions/2.7.18/include/python2.7" PARENT_SCOPE)
set(LIB_DIRS ${LIB_DIRS} "/Users/victorhafner/.pyenv/versions/2.7.18/lib" PARENT_SCOPE)
set(LINKER_FLAGS "${LINKER_FLAGS} -lpython2.7" PARENT_SCOPE)
endif()
if(WASM)
set(INCLUDE_DIRS ${INCLUDE_DIRS} "../include/Python" PARENT_SCOPE)
set(LIB_DIRS ${LIB_DIRS} "../lib" PARENT_SCOPE)
set(LINKER_FLAGS "${LINKER_FLAGS} -lpython2.7" PARENT_SCOPE)
endif()
if(WIN32)
set(INCLUDE_DIRS ${INCLUDE_DIRS} "${DISK}:/usr/vcpkg/installed/x64-windows/include/python2.7" PARENT_SCOPE)
set(LINKER_FLAGS ${LINKER_FLAGS} python27 PARENT_SCOPE)
endif()
endfunction()
#function(FIND_GLUT)
# if(UNIX)
# set(LINKER_FLAGS "${LINKER_FLAGS} -lglut -lGL -lGLU" PARENT_SCOPE)
# endif()
# if(WASM) # GLUT is wrapped for web assembly
# endif()
# if(WIN32)
# set(LINKER_FLAGS ${LINKER_FLAGS} freeglut PARENT_SCOPE)
# endif()
#endfunction()
function(FIND_OPENSG)
if(LINUX)
set(LIB_DIRS ${LIB_DIRS} "/usr/lib/opensg" PARENT_SCOPE)
set(LINKER_FLAGS "${LINKER_FLAGS} -lOSGBase -lOSGContribTrapezoidalShadowMaps -lOSGCluster -lOSGDrawable -lOSGEffectGroups -lOSGFileIO -lOSGGroup -lOSGImageFileIO -lOSGState -lOSGSystem -lOSGUtil -lOSGText -lOSGWindow -lOSGWindowGLUT -lOSGWindowX" PARENT_SCOPE)
endif()
if(APPLE)
set(INCLUDE_DIRS ${INCLUDE_DIRS} "/usr/local/include" PARENT_SCOPE)
set(LIB_DIRS ${LIB_DIRS} "/usr/local/lib64" PARENT_SCOPE)
set(LINKER_FLAGS "${LINKER_FLAGS} -lOSGBase -lOSGContribTrapezoidalShadowMaps -lOSGCluster -lOSGDrawable -lOSGEffectGroups -lOSGFileIO -lOSGGroup -lOSGImageFileIO -lOSGState -lOSGSystem -lOSGUtil -lOSGText -lOSGWindow -lOSGWindowCOCOA -framework Cocoa -framework OpenGL" PARENT_SCOPE)
endif()
if(WASM)
set(INCLUDE_DIRS ${INCLUDE_DIRS} "../include" PARENT_SCOPE)
set(LIB_DIRS ${LIB_DIRS} "../lib" PARENT_SCOPE)
set(LINKER_FLAGS "${LINKER_FLAGS} -lOSGWindowGLUT -lOSGWindowWASM -lOSGWindow -lOSGSystem -lOSGUtil -lOSGDrawable -lOSGGroup -lOSGState -lOSGBase -lOSGFileIO -lOSGImageFileIO" PARENT_SCOPE)
endif()
if(WIN32)
set(LIB_DIRS ${LIB_DIRS} "${DISK}:/usr/lib/opensg" PARENT_SCOPE)
set(LINKER_FLAGS ${LINKER_FLAGS} OSGBase OSGContribTrapezoidalShadowMaps OSGCluster OSGDrawable OSGEffectGroups OSGGroup OSGImageFileIO OSGState OSGSystem OSGUtil OSGText OSGWindow OSGWindowGLUT PARENT_SCOPE)
endif()
endfunction()
function(FIND_PNG)
if(UNIX)
set(LINKER_FLAGS "${LINKER_FLAGS} -lpng" PARENT_SCOPE)
endif()
if(WASM)
set(INCLUDE_DIRS ${INCLUDE_DIRS} "../emsdk/upstream/emscripten/cache/ports/libpng/libpng-1.6.37" PARENT_SCOPE)
set(LIB_DIRS ${LIB_DIRS} "../emsdk/upstream/emscripten/cache/sysroot/lib/wasm32-emscripten" PARENT_SCOPE)
set(LINKER_FLAGS "${LINKER_FLAGS} -lpng" PARENT_SCOPE)
endif()
if(WIN32)
endif()
endfunction()
function(FIND_JPG)
if(UNIX)
set(LINKER_FLAGS "${LINKER_FLAGS} -ljpeg" PARENT_SCOPE)
endif()
if(WASM)
set(INCLUDE_DIRS ${INCLUDE_DIRS} "../emsdk/upstream/emscripten/cache/ports/libjpeg/jpeg-9c" PARENT_SCOPE)
set(LIB_DIRS ${LIB_DIRS} "../emsdk/upstream/emscripten/cache/sysroot/lib/wasm32-emscripten" PARENT_SCOPE)
set(LINKER_FLAGS "${LINKER_FLAGS} -ljpeg" PARENT_SCOPE)
endif()
if(WIN32)
endif()
endfunction()
function(FIND_GDAL)
if(UNIX)
#set(LINKER_FLAGS "${LINKER_FLAGS} -lgdal -lproj -ltiff -ltiffxx -lport -lsqlite3" PARENT_SCOPE)
endif()
if(WASM)
set(INCLUDE_DIRS ${INCLUDE_DIRS} "../include" "../include/libproj" PARENT_SCOPE)
set(LIB_DIRS ${LIB_DIRS} "../lib" PARENT_SCOPE)
set(LINKER_FLAGS "${LINKER_FLAGS} -lgdal -lproj -ltiff -ltiffxx -lport -lsqlite3" PARENT_SCOPE)
endif()
if(WIN32)
set(LINKER_FLAGS ${LINKER_FLAGS} gdal proj tiff PARENT_SCOPE)
endif()
endfunction()
function(FIND_CGAL)
if(UNIX)
#set(LINKER_FLAGS "${LINKER_FLAGS} -lmpir -lmpfr" PARENT_SCOPE)
endif()
if(WASM)
set(INCLUDE_DIRS ${INCLUDE_DIRS} "../include" PARENT_SCOPE)
endif()
if(WIN32)
set(COMPILER_FLAGS ${COMPILER_FLAGS} /bigobj PARENT_SCOPE)
set(LINKER_FLAGS ${LINKER_FLAGS} mpfr gmp PARENT_SCOPE)
endif()
endfunction()
function(FIND_IMGUI)
if(UNIX)
endif()
if(WIN32)
#set(INCLUDE_DIRS ${INCLUDE_DIRS} PARENT_SCOPE)
set(LINKER_FLAGS ${LINKER_FLAGS} imgui PARENT_SCOPE)
endif()
endfunction()
function(FIND_BULLET)
if(LINUX)
set(INCLUDE_DIRS ${INCLUDE_DIRS} "/snap/bullet/1/include/bullet" "/usr/include/bullet" PARENT_SCOPE)
set(LIB_DIRS ${LIB_DIRS} "/snap/bullet/1/lib" PARENT_SCOPE)
set(LINKER_FLAGS "${LINKER_FLAGS} -lBulletSoftBody -lBulletDynamics -lBulletCollision -lLinearMath" PARENT_SCOPE)
endif()
if(APPLE)
set(INCLUDE_DIRS ${INCLUDE_DIRS} "/opt/homebrew/Cellar/bullet/3.25/include/bullet" PARENT_SCOPE)
set(LIB_DIRS ${LIB_DIRS} "/opt/homebrew/Cellar/bullet/3.25/lib" PARENT_SCOPE)
set(LINKER_FLAGS "${LINKER_FLAGS} -lBulletSoftBody -lBulletDynamics -lBulletCollision -lLinearMath" PARENT_SCOPE)
endif()
if(WIN32)
set(INCLUDE_DIRS ${INCLUDE_DIRS} "${DISK}:/usr/vcpkg/installed/x64-windows/include/bullet" PARENT_SCOPE)
set(LINKER_FLAGS ${LINKER_FLAGS} Bullet3Common BulletCollision BulletDynamics BulletInverseDynamics BulletSoftBody LinearMath PARENT_SCOPE)
endif()
endfunction()
function(FIND_COLLADA)
if(WIN32)
set(INCLUDE_DIRS ${INCLUDE_DIRS} "${DISK}:/usr/include/Collada" PARENT_SCOPE)
set(LIB_DIRS ${LIB_DIRS} "${DISK}:/usr/lib/collada" PARENT_SCOPE)
set(LINKER_FLAGS ${LINKER_FLAGS} collada-dom2.5-dp-vc100-mt colladadom141 PARENT_SCOPE)
add_definitions( -DDOM_DYNAMIC )
endif()
if(APPLE)
set(LIB_DIRS ${LIB_DIRS} "/usr/local/lib" PARENT_SCOPE)
set(LINKER_FLAGS "${LINKER_FLAGS} -lcollada-dom2.5-dp" PARENT_SCOPE)
endif()
endfunction()
function(FIND_CEF)
if(LINUX)
set(INCLUDE_DIRS ${INCLUDE_DIRS} "/usr/include/CEF" PARENT_SCOPE)
set(LIB_DIRS ${LIB_DIRS} "/usr/lib/CEF" PARENT_SCOPE)
set(LINKER_FLAGS "${LINKER_FLAGS} -lcef -lcef_dll_wrapper" PARENT_SCOPE)
add_definitions( -DCEF18 )
endif()
if(APPLE)
set(INCLUDE_DIRS ${INCLUDE_DIRS} "/usr/local/include/cef" PARENT_SCOPE)
set(LIB_DIRS ${LIB_DIRS} "/usr/local/lib/cef" PARENT_SCOPE)
set(LINKER_FLAGS "${LINKER_FLAGS} -lcef_dll_wrapper -undefined dynamic_lookup" PARENT_SCOPE)
#set(LINKER_FLAGS "${LINKER_FLAGS} -lcef -lcef_dll_wrapper" PARENT_SCOPE)
#set(LINKER_FLAGS "${LINKER_FLAGS} -lcef_dll_wrapper -F/usr/local/lib/cef -framework \"Chromium Embedded Framework\"" PARENT_SCOPE)
add_definitions( -DCEF18 )
endif()
if(WIN32)
set(INCLUDE_DIRS ${INCLUDE_DIRS} "${DISK}:/usr/include/CEF" PARENT_SCOPE)
set(LIB_DIRS ${LIB_DIRS} "${DISK}:/usr/lib/cef" PARENT_SCOPE)
set(LINKER_FLAGS ${LINKER_FLAGS} libcef_dll_wrapper shared libcef PARENT_SCOPE)
endif()
endfunction()
function(FIND_OCE)
if(UNIX)
#set(LINKER_FLAGS "${LINKER_FLAGS} -loce" PARENT_SCOPE)
endif()
if(WIN32)
set(INCLUDE_DIRS ${INCLUDE_DIRS} "${DISK}:/usr/include/OCE" PARENT_SCOPE)
set(LIB_DIRS ${LIB_DIRS} "${DISK}:/usr/lib/oce" PARENT_SCOPE)
set(LINKER_FLAGS ${LINKER_FLAGS} TKV3d TKernel TKMath TKBRep TKGeomBase TKGeomAlgo TKG3d TKG2d TKShHealing TKTopAlgo TKMesh TKPrim TKBool TKBO TKFillet TKSTEP TKXSBase TKXCAF TKLCAF TKXDESTEP TKIGES TKOffset TKSTEPAttr TKSTEP209 TKSTEPBase PARENT_SCOPE)
endif()
endfunction()
function(FIND_IFC)
if(UNIX)
#set(LINKER_FLAGS "${LINKER_FLAGS} -lifc" PARENT_SCOPE)
endif()
if(WIN32)
set(INCLUDE_DIRS ${INCLUDE_DIRS} "${DISK}:/usr/include/IFC" PARENT_SCOPE)
set(LIB_DIRS ${LIB_DIRS} "${DISK}:/usr/lib/ifc" PARENT_SCOPE)
set(LINKER_FLAGS ${LINKER_FLAGS} IfcGeom IfcParse boost_regex-vc140-mt PARENT_SCOPE)
endif()
endfunction()
function(FIND_OPENVR)
if(WIN32)
set(INCLUDE_DIRS ${INCLUDE_DIRS} "${DISK}:/usr/include/OpenVR" PARENT_SCOPE)
set(LIB_DIRS ${LIB_DIRS} "${DISK}:/usr/lib/openvr" PARENT_SCOPE)
set(LINKER_FLAGS ${LINKER_FLAGS} openvr_api64 glew32 PARENT_SCOPE)
endif()
endfunction()
function(FIND_CURL)
if(UNIX)
set(LINKER_FLAGS "${LINKER_FLAGS} -lcurl" PARENT_SCOPE)
endif()
if(WIN32)
set(LINKER_FLAGS ${LINKER_FLAGS} libcurl PARENT_SCOPE)
endif()
endfunction()
function(FIND_SSH)
if(LINUX)
set(LINKER_FLAGS "${LINKER_FLAGS} -lssh2" PARENT_SCOPE)
endif()
if(APPLE)
set(LINKER_FLAGS "${LINKER_FLAGS} -lssh" PARENT_SCOPE)
endif()
if(WIN32)
set(LINKER_FLAGS ${LINKER_FLAGS} libssh2 PARENT_SCOPE)
endif()
endfunction()
function(FIND_CRYPTOPP)
if(UNIX)
#set(LINKER_FLAGS "${LINKER_FLAGS} -lcryptopp" PARENT_SCOPE)
endif()
if(WIN32)
set(LINKER_FLAGS ${LINKER_FLAGS} cryptopp PARENT_SCOPE)
endif()
endfunction()
function(FIND_AV)
if(APPLE)
set(INCLUDE_DIRS ${INCLUDE_DIRS} "/opt/homebrew/opt/openal-soft/include" PARENT_SCOPE)
set(LIB_DIRS ${LIB_DIRS} "/opt/homebrew/opt/openal-soft/lib" PARENT_SCOPE)
set(LINKER_FLAGS "${LINKER_FLAGS} -lopenal -lavformat -lavcodec -lswscale -lswresample -lavutil" PARENT_SCOPE)
endif()
if(WIN32)
set(LINKER_FLAGS ${LINKER_FLAGS} OpenAL32 avformat avcodec swscale swresample avutil PARENT_SCOPE)
endif()
endfunction()
function(FIND_LAPACKE)
if(LINUX)
set(INCLUDE_DIRS ${INCLUDE_DIRS} "/usr/include/lapacke" PARENT_SCOPE)
set(LINKER_FLAGS "${LINKER_FLAGS} -llapacke -llapack" PARENT_SCOPE)
endif()
if(APPLE)
set(INCLUDE_DIRS ${INCLUDE_DIRS} "/opt/homebrew/opt/lapack/include" PARENT_SCOPE)
set(LIB_DIRS ${LIB_DIRS} "/opt/homebrew/opt/lapack/lib" PARENT_SCOPE)
set(LINKER_FLAGS "${LINKER_FLAGS} -llapacke -llapack" PARENT_SCOPE)
endif()
if(WIN32)
set(LINKER_FLAGS ${LINKER_FLAGS} lapack openblas PARENT_SCOPE)
endif()
endfunction()
function(FIND_EIGEN)
if(APPLE)
set(INCLUDE_DIRS ${INCLUDE_DIRS} "/opt/homebrew/var/homebrew/linked/eigen/include/eigen3" PARENT_SCOPE)
#set(LIB_DIRS ${LIB_DIRS} "/opt/homebrew/var/homebrew/linked/eigen/lib" PARENT_SCOPE)
#set(LINKER_FLAGS "${LINKER_FLAGS} -leigen" PARENT_SCOPE)
endif()
endfunction()
function(FIND_FFTW)
if(UNIX)
set(LINKER_FLAGS "${LINKER_FLAGS} -lfftw3" PARENT_SCOPE)
endif()
if(WIN32)
set(LINKER_FLAGS ${LINKER_FLAGS} fftw3 PARENT_SCOPE)
endif()
endfunction()
function(FIND_OMP)
if(APPLE)
set(INCLUDE_DIRS ${INCLUDE_DIRS} "/opt/homebrew/opt/libomp/include" PARENT_SCOPE)
set(LIB_DIRS ${LIB_DIRS} "/opt/homebrew/opt/libomp/lib" PARENT_SCOPE)
endif()
endfunction()
function(FIND_QRENCODE)
if(UNIX)
#set(LINKER_FLAGS "${LINKER_FLAGS} -lqrencode" PARENT_SCOPE)
endif()
if(WIN32)
set(LINKER_FLAGS ${LINKER_FLAGS} qrencode PARENT_SCOPE)
endif()
endfunction()
function(FIND_RAPTOR)
if(UNIX)
#set(LINKER_FLAGS "${LINKER_FLAGS} -lraptor2" PARENT_SCOPE)
endif()
endfunction()
function(FIND_ICU)
if(LINUX)
set(LINKER_FLAGS "${LINKER_FLAGS} -licui18n -licuuc -licudata" PARENT_SCOPE)
endif()
if(APPLE)
set(INCLUDE_DIRS ${INCLUDE_DIRS} "/opt/homebrew/Cellar/icu4c/74.2/include" PARENT_SCOPE)
set(LINKER_FLAGS "${LINKER_FLAGS} -licui18n -licuuc -licudata" PARENT_SCOPE)
set(LIB_DIRS ${LIB_DIRS} "/opt/homebrew/Cellar/icu4c/74.2/lib" PARENT_SCOPE)
endif()
if(WIN32)
set(LINKER_FLAGS ${LINKER_FLAGS} icudt icuin icuio icutu icuuc PARENT_SCOPE)
endif()
endfunction()
function(FIND_JSON)
if(UNIX)
set(LINKER_FLAGS "${LINKER_FLAGS} -ljsoncpp" PARENT_SCOPE)
endif()
if(WIN32)
set(LINKER_FLAGS ${LINKER_FLAGS} jsoncpp PARENT_SCOPE) # TODO
endif()
endfunction()
set(WITHOUT_TCP OFF)
set(WITHOUT_BULLET OFF)
set(WITHOUT_HACD OFF)
set(WITHOUT_OPENVR OFF)
set(WITHOUT_IMGUI OFF)
set(WITHOUT_EXECINFO OFF)
set(WITHOUT_CRYPTOPP OFF)
set(WITHOUT_VRPN OFF)
set(WITHOUT_ART OFF)
set(WITHOUT_AV OFF)
set(WITHOUT_PRESENTER OFF)
set(WITHOUT_VTK OFF)
set(WITHOUT_CEF OFF)
set(WITHOUT_LAPACKE_BLAS OFF)
set(WITHOUT_EIGEN OFF)
set(WITHOUT_CGAL OFF)
set(WITHOUT_JSONCPP OFF)
set(WITHOUT_OPCUA OFF)
set(WITHOUT_CURL OFF)
set(WITHOUT_MTOUCH OFF)
set(WITHOUT_NUMPY OFF)
set(WITHOUT_SSH OFF)
set(WITHOUT_RAPTOR OFF)
set(WITHOUT_QRENCODE OFF)
set(WITHOUT_COLLADA OFF)
set(WITHOUT_DWG OFF)
set(WITHOUT_STEP OFF)
set(WITHOUT_STEPCODE OFF)
set(WITHOUT_IFC OFF)
set(WITHOUT_VIRTUOSE OFF)
set(WITHOUT_GDAL OFF)
set(WITHOUT_DEFERRED_RENDERING OFF)
set(WITHOUT_PANGO_CAIRO OFF)
set(WITHOUT_UNICODE OFF)
set(WITHOUT_IES OFF)
set(WITHOUT_GLU_TESS OFF)
set(WITHOUT_SHARED_MEMORY OFF)
set(WITHOUT_HDLC OFF)
set(WITHOUT_FFTW OFF)
set(WITHOUT_MDB OFF)
set(WITHOUT_COCOA OFF)
set(WITHOUT_SNAP7 OFF)
set(WITHOUT_E57 OFF)
set(WITHOUT_GLUT OFF)
set(WITHOUT_PDF OFF)
if(LINUX)
#set( WITHOUT_TCP ON)
#set( WITHOUT_BULLET ON)
set( WITHOUT_OPENVR ON)
set( WITHOUT_HACD ON)
#set( WITHOUT_GTK ON)
#set( WITHOUT_EXECINFO ON)
set( WITHOUT_CRYPTOPP ON)
set( WITHOUT_VRPN ON)
#set( WITHOUT_ART ON)
set( WITHOUT_AV ON)
set( WITHOUT_VTK ON)
#set( WITHOUT_CEF ON)
#set( WITHOUT_LAPACKE_BLAS ON)
set( WITHOUT_EIGEN ON)
set( WITHOUT_CGAL ON)
#set( WITHOUT_JSONCPP ON)
set( WITHOUT_OPCUA ON)
#set( WITHOUT_CURL ON)
set( WITHOUT_MTOUCH ON)
#set( WITHOUT_NUMPY ON)
#set( WITHOUT_SSH ON)
set( WITHOUT_RAPTOR ON)
set( WITHOUT_QRENCODE ON)
#set( WITHOUT_COLLADA ON)
set( WITHOUT_DWG ON)
set( WITHOUT_STEP ON)
set( WITHOUT_STEPCODE ON)
set( WITHOUT_IFC ON)
set( WITHOUT_VIRTUOSE ON)
set( WITHOUT_GDAL ON)
#set( WITHOUT_DEFERRED_RENDERING ON)
#set( WITHOUT_PANGO_CAIRO ON)
#set( WITHOUT_UNICODE ON)
set( WITHOUT_IES ON)
#set( WITHOUT_GLU_TESS ON)
#set( WITHOUT_SHARED_MEMORY ON)
set( WITHOUT_HDLC ON)
#set( WITHOUT_FFTW ON)
set( WITHOUT_MDB ON)
endif()
if(APPLE)
#set( WITHOUT_TCP ON)
#set( WITHOUT_BULLET ON)
set( WITHOUT_HACD ON)
set( WITHOUT_OPENVR ON)
set( WITHOUT_IMGUI ON)
#set( WITHOUT_EXECINFO ON)
set( WITHOUT_CRYPTOPP ON)
set( WITHOUT_VRPN ON)
set( WITHOUT_ART ON)
#set( WITHOUT_AV ON)
set( WITHOUT_PRESENTER ON)
set( WITHOUT_VTK ON)
#set( WITHOUT_CEF ON)
#set( WITHOUT_LAPACKE_BLAS ON)
#set( WITHOUT_EIGEN ON)
set( WITHOUT_CGAL ON)
#set( WITHOUT_JSONCPP ON)
set( WITHOUT_OPCUA ON)
#set( WITHOUT_CURL ON)
set( WITHOUT_MTOUCH ON)
set( WITHOUT_NUMPY ON)
set( WITHOUT_SSH ON)
set( WITHOUT_RAPTOR ON)
set( WITHOUT_QRENCODE ON)
#set( WITHOUT_COLLADA ON)
set( WITHOUT_DWG ON)
set( WITHOUT_STEP ON)
set( WITHOUT_STEPCODE ON)
set( WITHOUT_IFC ON)
set( WITHOUT_VIRTUOSE ON)
set( WITHOUT_GDAL ON)
set( WITHOUT_DEFERRED_RENDERING ON)
set( WITHOUT_PANGO_CAIRO ON)
#set( WITHOUT_UNICODE ON)
set( WITHOUT_IES ON)
set( WITHOUT_GLU_TESS ON)
#set( WITHOUT_SHARED_MEMORY ON)
set( WITHOUT_HDLC ON)
#set( WITHOUT_FFTW ON)
set( WITHOUT_MDB ON)
#set( WITHOUT_COCOA ON)
set(WITHOUT_SNAP7 ON)
set(WITHOUT_E57 ON)
set(WITHOUT_GLUT ON)
set(WITHOUT_PDF ON)
endif()
if(WASM)
set( WITHOUT_TCP ON)
set( WITHOUT_BULLET ON)
set( WITHOUT_HACD ON)
set( WITHOUT_OPENVR ON)
set( WITHOUT_IMGUI ON)
set( WITHOUT_EXECINFO ON)
set( WITHOUT_CRYPTOPP ON)
set( WITHOUT_VRPN ON)
set( WITHOUT_ART ON)
set( WITHOUT_AV ON)
set( WITHOUT_PRESENTER ON)
set( WITHOUT_VTK ON)
set( WITHOUT_CEF ON)
set( WITHOUT_LAPACKE_BLAS ON)
set( WITHOUT_EIGEN ON)
set( WITHOUT_CGAL ON)
set( WITHOUT_JSONCPP ON)
set( WITHOUT_OPCUA ON)
set( WITHOUT_CURL ON)
set( WITHOUT_MTOUCH ON)
set( WITHOUT_NUMPY ON)
set( WITHOUT_SSH ON)
set( WITHOUT_RAPTOR ON)
set( WITHOUT_QRENCODE ON)
set( WITHOUT_COLLADA ON)
set( WITHOUT_DWG ON)
set( WITHOUT_STEP ON)
set( WITHOUT_STEPCODE ON)
set( WITHOUT_IFC ON)
set( WITHOUT_VIRTUOSE ON)
#set( WITHOUT_GDAL ON)
set( WITHOUT_DEFERRED_RENDERING ON)
set( WITHOUT_PANGO_CAIRO ON)
set( WITHOUT_UNICODE ON)
set( WITHOUT_IES ON)
set( WITHOUT_GLU_TESS ON)
set( WITHOUT_SHARED_MEMORY ON)
set( WITHOUT_HDLC ON)
set( WITHOUT_FFTW ON)
set( WITHOUT_MDB ON)
set( WITHOUT_COCOA ON)
add_definitions( -DOSG_OGL_ES2 )
endif()
if(WIN32)
set( WITHOUT_HACD ON)
set( WITHOUT_DWG ON)
set( WITHOUT_RAPTOR ON)
set( WITHOUT_OPCUA ON)
set( WITHOUT_IES ON)
set( WITHOUT_VTK ON)
set( WITHOUT_VRPN ON)
set( WITHOUT_MTOUCH ON)
set( WITHOUT_STEPCODE ON)
set( WITHOUT_VIRTUOSE ON)
set( WITHOUT_NUMPY ON)
set( WITHOUT_EXECINFO ON)
set( WITHOUT_HDLC ON)
set( WITHOUT_PRESENTER ON)
set( WITHOUT_MDB ON)
set( WITHOUT_COCOA ON)
add_definitions( -DHAVE_SNPRINTF )
endif()
function(SETUP_VARS)
addDefinition(WITHOUT_TCP -DWITHOUT_TCP )
addDefinition(WITHOUT_BULLET -DWITHOUT_BULLET )
addDefinition(WITHOUT_HACD -DWITHOUT_HACD )
addDefinition(WITHOUT_OPENVR -DWITHOUT_OPENVR )
addDefinition(WITHOUT_IMGUI -DWITHOUT_IMGUI )
addDefinition(WITHOUT_EXECINFO -DWITHOUT_EXECINFO )
addDefinition(WITHOUT_CRYPTOPP -DWITHOUT_CRYPTOPP )
addDefinition(WITHOUT_VRPN -DWITHOUT_VRPN )
addDefinition(WITHOUT_ART -DWITHOUT_ART )
addDefinition(WITHOUT_AV -DWITHOUT_AV )
addDefinition(WITHOUT_PRESENTER -DWITHOUT_PRESENTER )
addDefinition(WITHOUT_VTK -DWITHOUT_VTK )
addDefinition(WITHOUT_CEF -DWITHOUT_CEF )
addDefinition(WITHOUT_LAPACKE_BLAS -DWITHOUT_LAPACKE_BLAS )
addDefinition(WITHOUT_EIGEN -DWITHOUT_EIGEN )
addDefinition(WITHOUT_CGAL -DWITHOUT_CGAL )
addDefinition(WITHOUT_JSONCPP -DWITHOUT_JSONCPP )
addDefinition(WITHOUT_OPCUA -DWITHOUT_OPCUA )
addDefinition(WITHOUT_CURL -DWITHOUT_CURL )
addDefinition(WITHOUT_MTOUCH -DWITHOUT_MTOUCH )
addDefinition(WITHOUT_NUMPY -DWITHOUT_NUMPY )
addDefinition(WITHOUT_SSH -DWITHOUT_SSH )
addDefinition(WITHOUT_RAPTOR -DWITHOUT_RAPTOR )
addDefinition(WITHOUT_QRENCODE -DWITHOUT_QRENCODE )
addDefinition(WITHOUT_COLLADA -DWITHOUT_COLLADA )
addDefinition(WITHOUT_DWG -DWITHOUT_DWG )
addDefinition(WITHOUT_STEP -DWITHOUT_STEP )
addDefinition(WITHOUT_STEPCODE -DWITHOUT_STEPCODE )
addDefinition(WITHOUT_IFC -DWITHOUT_IFC )
addDefinition(WITHOUT_VIRTUOSE -DWITHOUT_VIRTUOSE )
addDefinition(WITHOUT_GDAL -DWITHOUT_GDAL )
addDefinition(WITHOUT_DEFERRED_RENDERING -DWITHOUT_DEFERRED_RENDERING )
addDefinition(WITHOUT_PANGO_CAIRO -DWITHOUT_PANGO_CAIRO )
addDefinition(WITHOUT_UNICODE -DWITHOUT_UNICODE )
addDefinition(WITHOUT_IES -DWITHOUT_IES )
addDefinition(WITHOUT_GLU_TESS -DWITHOUT_GLU_TESS )
addDefinition(WITHOUT_SHARED_MEMORY -DWITHOUT_SHARED_MEMORY )
addDefinition(WITHOUT_HDLC -DWITHOUT_HDLC )
addDefinition(WITHOUT_FFTW -DWITHOUT_FFTW )
addDefinition(WITHOUT_MDB -DWITHOUT_MDB )
addDefinition(WITHOUT_COCOA -DWITHOUT_COCOA )
addDefinition(WITHOUT_SNAP7 -DWITHOUT_SNAP7 )
addDefinition(WITHOUT_E57 -DWITHOUT_E57 )
addDefinition(WITHOUT_GLUT -DWITHOUT_GLUT )
addDefinition(WITHOUT_PDF -DWITHOUT_PDF )
endfunction()
FIND_ZLIB()
FIND_LIBXML()
FIND_FREETYPE()
FIND_BOOST()
FIND_PYTHON()
#FIND_GLUT()
FIND_OPENSG()
FIND_BULLET()
FIND_COLLADA()
FIND_ICU()
FIND_CURL()
FIND_CRYPTOPP()
FIND_QRENCODE()
FIND_RAPTOR()
FIND_AV()
FIND_LAPACKE()
FIND_EIGEN()
FIND_FFTW()
FIND_OMP()
FIND_JSON()
FIND_SSH()
FIND_PNG()
FIND_JPG()
FIND_GDAL()
FIND_CGAL()
FIND_IMGUI()
FIND_CEF()
FIND_OPENVR()
FIND_OCE()
FIND_IFC()
if (APPLE)
set(CMAKE_CXX_STANDARD 11)
else()
set(CMAKE_CXX_STANDARD 11)
endif()
set(CMAKE_CXX_STANDARD_REQUIRED ON)
SETUP_VARS()
if(WASM OR UNIX)
string(STRIP ${LINKER_FLAGS} LINKER_FLAGS)
endif()
set(INCLUDE_DIRS ${INCLUDE_DIRS} "src")
set(INCLUDE_DIRS ${INCLUDE_DIRS} "src/core/networking/snap7/sys")
set(INCLUDE_DIRS ${INCLUDE_DIRS} "src/core/networking/snap7/core")
set(INCLUDE_DIRS ${INCLUDE_DIRS} "src/core/networking/snap7/lib")
set(INCLUDE_DIRS ${INCLUDE_DIRS} "src/core/setup/windows/glut/freeglut/src")
set(INCLUDE_DIRS ${INCLUDE_DIRS} "src/core/setup/windows/glut/freeglut/include")
include_directories(${INCLUDE_DIRS})
link_directories(${LIB_DIRS})
add_executable(polyvr src/main.cpp)
target_sources(polyvr PRIVATE src/PolyVR.cpp)
if(APPLE)
macro(compileHelper name suffix)
set(_helper_target "cefHelper${suffix}")
set(_helper_output_name "CefSubProcessMac${name}")
add_executable(${_helper_target} ressources/cefMac/WKSubProcess.cpp)
target_compile_options(${_helper_target} PRIVATE -std=c++17)
target_link_libraries(${_helper_target} cef_dll_wrapper ${CEF_STANDARD_LIBS})
set_target_properties(${_helper_target} PROPERTIES OUTPUT_NAME ${_helper_output_name})
set_target_properties(${_helper_target} PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/ressources/cefMac/helper")
add_dependencies(polyvr "${_helper_target}")
endmacro()
compileHelper("" "")
compileHelper(" (Alerts)" "_alerts")
compileHelper(" (GPU)" "_gpu")
compileHelper(" (Plugin)" "_plugin")
compileHelper(" (Renderer)" "_renderer")
file(MAKE_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/build/Contents)
endif()
# command to run polyvr after building within visual studio
if(WIN32)
#add_custom_command(TARGET polyvr POST_BUILD
# COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/start-win2.bat
# WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
#)
endif()
# start with optional stuff
if(APPLE)
target_sources(polyvr PRIVATE src/core/setup/windows/VRCocoaWindow.mm)
endif()
if(NOT WASM)
target_sources(polyvr PRIVATE src/core/math/triangulator.cpp)
target_sources(polyvr PRIVATE src/core/networking/VRSharedMemory.cpp)
target_sources(polyvr PRIVATE src/core/scene/rendering/VRDefShading.cpp) # needs compiling def shading in OSG
target_sources(polyvr PRIVATE src/core/scripting/VRPyTriangulator.cpp)
if(NOT WITHOUT_PDF)
target_sources(polyvr PRIVATE src/core/scripting/VRPyPDF.cpp)
target_sources(polyvr PRIVATE src/core/utils/VRPDF.cpp)
endif()
endif()
if(WIN32)
target_sources(polyvr PRIVATE src/core/setup/windows/VRHeadMountedDisplay.cpp)
endif()
if(NOT WITHOUT_MTOUCH)
target_sources(polyvr PRIVATE src/core/setup/devices/VRMultiTouch.cpp)
endif()
if(NOT WITHOUT_PRESENTER)
target_sources(polyvr PRIVATE src/core/setup/devices/VRPresenter.cpp)
endif()
if(NOT WITHOUT_AV)
target_sources(polyvr PRIVATE src/core/objects/material/VRVideo.cpp) # needs libav
target_sources(polyvr PRIVATE src/core/scene/sound/VRSound.cpp) # needs libav
target_sources(polyvr PRIVATE src/core/scene/sound/VRSoundUtils.cpp) # needs libav
target_sources(polyvr PRIVATE src/core/scene/sound/VRSoundManager.cpp) # needs libav
target_sources(polyvr PRIVATE src/core/scene/sound/VRMicrophone.cpp) # needs libav
target_sources(polyvr PRIVATE src/core/scripting/VRPyRecorder.cpp) # needs AV
target_sources(polyvr PRIVATE src/core/scripting/VRPySound.cpp) # needs libav
target_sources(polyvr PRIVATE src/core/tools/VRRecorder.cpp) # needs av
if(NOT WITHOUT_CEF)
target_sources(polyvr PRIVATE src/addons/CEF/VRPyWebCam.cpp)
target_sources(polyvr PRIVATE src/addons/CEF/VRWebCam.cpp)
endif()
endif()
if(NOT WITHOUT_QRENCODE)
target_sources(polyvr PRIVATE src/core/tools/VRQRCode.cpp) # needs qrencode
endif()
if(NOT WITHOUT_EIGEN)
target_sources(polyvr PRIVATE src/addons/Engineering/Mechanics/VRPolarVertex.cpp)
target_sources(polyvr PRIVATE src/addons/Engineering/Mechanics/VRGearSegmentation.cpp) # needs eigen
target_sources(polyvr PRIVATE src/addons/Engineering/Mechanics/VRAxleSegmentation.cpp) # needs eigen
target_sources(polyvr PRIVATE src/addons/Engineering/Mechanics/VRThreadSegmentation.cpp) # needs eigen
endif()
if(NOT WITHOUT_LAPACKE_BLAS)
target_sources(polyvr PRIVATE src/core/math/PCA.cpp) # needs lapacke/blas
target_sources(polyvr PRIVATE src/core/math/Eigendecomposition.cpp) # needs lapacke/blas
target_sources(polyvr PRIVATE src/core/math/SingularValueDecomposition.cpp) # needs lapacke/blas
endif()
if(NOT WITHOUT_FFTW)
target_sources(polyvr PRIVATE src/core/math/fft.cpp)
endif()
if(NOT WITHOUT_BULLET)
target_sources(polyvr PRIVATE src/core/math/kinematics/VRKinematics.cpp) # needs bullet
target_sources(polyvr PRIVATE src/core/scene/VRPhysicsManager.cpp) # needs bullet
target_sources(polyvr PRIVATE src/core/scripting/VRPySpatialCollisionManager.cpp) # needs bullet
target_sources(polyvr PRIVATE src/addons/WorldGenerator/terrain/VRTerrainPhysicsShape.cpp) # needs bullet
target_sources(polyvr PRIVATE src/core/objects/geometry/VRPhysics.cpp) # needs bullet
target_sources(polyvr PRIVATE src/core/objects/geometry/VRSpatialCollisionManager.cpp) # needs bullet
target_sources(polyvr PRIVATE src/addons/Bullet/Particles/VRPyParticles.cpp)
target_sources(polyvr PRIVATE src/addons/Bullet/Particles/VREmitter.cpp)
target_sources(polyvr PRIVATE src/addons/Bullet/Particles/VRParticles.cpp)
target_sources(polyvr PRIVATE src/addons/Bullet/CarDynamics/VRPyCarDynamics.cpp)
target_sources(polyvr PRIVATE src/addons/Bullet/CarDynamics/CarDynamics.cpp)
target_sources(polyvr PRIVATE src/addons/Bullet/CarDynamics/VRDriver.cpp)
target_sources(polyvr PRIVATE src/addons/Bullet/Fluids/VRMetaBalls.cpp)
target_sources(polyvr PRIVATE src/addons/Bullet/Fluids/VRPyFluids.cpp)
target_sources(polyvr PRIVATE src/addons/Bullet/Fluids/VRFluids.cpp)
target_sources(polyvr PRIVATE src/addons/Bullet/SoftBody/SoftBody.cpp)
endif()
if(NOT WITHOUT_BULLET AND NOT WITHOUT_AV)
target_sources(polyvr PRIVATE src/addons/Bullet/CarDynamics/CarSound/CarSound.cpp)
endif()
if(NOT WITHOUT_CGAL)
target_sources(polyvr PRIVATE src/core/math/VRConvexHull.cpp) # needs cgal
target_sources(polyvr PRIVATE src/addons/Engineering/CSG/CSGGeometryAlgorithms.cpp)
target_sources(polyvr PRIVATE src/addons/Engineering/CSG/CSGGeometry.cpp)
#target_sources(polyvr PRIVATE src/addons/Engineering/CSG/csgjs.cpp) # deprecated
target_sources(polyvr PRIVATE src/addons/Engineering/CSG/VRPyCSG.cpp)
target_sources(polyvr PRIVATE src/addons/Engineering/CSG/CSGGeometryBis.cpp)
endif()
if(NOT WITHOUT_SSH)
target_sources(polyvr PRIVATE src/core/networking/VRSSH.cpp) # needs libssh2
endif()
if(NOT WITHOUT_TCP)
target_sources(polyvr PRIVATE src/core/networking/VRPing.cpp)
target_sources(polyvr PRIVATE src/core/networking/VRNetworkClient.cpp)