forked from dlrdave/activizdotnet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
1300 lines (1094 loc) · 42.8 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 2.8.8 FATAL_ERROR)
PROJECT(ActiVizDotNet)
set(VTK_BUILD_SHARED_LIBS "${BUILD_SHARED_LIBS}")
# Determine if we're building ActiVizDotNet (AVDN) as a "top level" project.
#
set(AVDN_BUILD_IS_TOP_LEVEL 0)
if("${ActiVizDotNet_BINARY_DIR}" STREQUAL "${CMAKE_BINARY_DIR}")
set(AVDN_BUILD_IS_TOP_LEVEL 1)
endif("${ActiVizDotNet_BINARY_DIR}" STREQUAL "${CMAKE_BINARY_DIR}")
if(AVDN_BUILD_IS_TOP_LEVEL)
if(NOT LIBRARY_OUTPUT_PATH)
set(LIBRARY_OUTPUT_PATH ${ActiVizDotNet_BINARY_DIR}/bin CACHE INTERNAL "Single output directory for building all libraries.")
endif(NOT LIBRARY_OUTPUT_PATH)
if(NOT EXECUTABLE_OUTPUT_PATH)
set(EXECUTABLE_OUTPUT_PATH ${ActiVizDotNet_BINARY_DIR}/bin CACHE INTERNAL "Single output directory for building all executables.")
endif(NOT EXECUTABLE_OUTPUT_PATH)
endif(AVDN_BUILD_IS_TOP_LEVEL)
# Make it clear that ActiViz is now open source: set the edition to
# "OpenSource" - the Commercial Edition is no longer for sale, but the
# OpenSource Edition is equivalent to it functionally. The Personal Edition
# restrictions are nowhere to be found... :-)
#
#set(AVDN_EDITION "OpenSource")
set(AVDN_EDITION "Supported")
set(AVDN_EDITION_SUFFIX "-Supported")
option(BUILD_TESTING "Build testing" OFF)
if(BUILD_TESTING)
INCLUDE(CTest)
ENABLE_TESTING()
endif()
option(BUILD_EXAMPLES "Build examples" OFF)
# List of MSVC dlls for our INSTALL rules below:
#
SET(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP 1)
# because we need the list and we'll add the INSTALL rule conditionally below...
#SET(CMAKE_INSTALL_DEBUG_LIBRARIES 1)
# uncomment if you need to make a debug install/package...
INCLUDE(InstallRequiredSystemLibraries)
# Mummy:
#
find_package(Mummy REQUIRED) # >= 1.0.3
if(NOT Mummy_BASE_DIR)
message(FATAL_ERROR "error: Mummy_BASE_DIR not defined. Please set Mummy_DIR to the directory containing MummyConfig.cmake")
endif()
#message(STATUS "<mummy>")
foreach(v
Mummy_BASE_DIR
Mummy_BIN_DIR
Mummy_CMAKE_BUILD_TYPE
Mummy_CMAKE_CONFIGURATION_TYPES
Mummy_CONFIG_DIR
Mummy_CONFIG_DIR_SUFFIX
Mummy_CONFIG_FILE
Mummy_CONFIGURATION_TYPE
Mummy_DIR
mummy_EXECUTABLE
Mummy_INCLUDE_DIRS
Mummy_LIB_DIR
Mummy_SELECTED_CONFIGURATION
Mummy_VERSION_MAJOR
Mummy_VERSION_MINOR
Mummy_VERSION_PATCH
Mummy_VERSION_STRING
)
#message(STATUS "${v}='${${v}}'")
endforeach()
#message(STATUS "</mummy>")
# Macros to make building C# libs and exes easy:
#
include("${Mummy_DIR}/MummyCMakeMacros.cmake")
# Set CSC_DEBUG_FLAG prior to including FindCsharp.cmake if we want
# to force C# debugging info... If it's set, it's honored. If it's
# not defined, then FindCsharp.cmake uses its own logic to choose
# a reasonable default for CSC_DEBUG_FLAG.
#
if(DEFINED BUILDNAME)
# Likely built via a script, default debug setting is OFF:
set(AVDN_BUILD_CSHARP_DEBUG_DEFAULT OFF)
else()
# Likely built by a real live developer, default debug setting is ON:
set(AVDN_BUILD_CSHARP_DEBUG_DEFAULT ON)
endif()
option(AVDN_BUILD_CSHARP_DEBUG
"Build C# components with '/debug' command line flag"
${AVDN_BUILD_CSHARP_DEBUG_DEFAULT}
)
if(AVDN_BUILD_CSHARP_DEBUG)
set(CSC_DEBUG_FLAG "/debug")
endif()
if(NOT DEFINED AVDN_CONFIG)
if(AVDN_BUILD_CSHARP_DEBUG)
set(AVDN_CONFIG_DEFAULT "Debug")
else()
set(AVDN_CONFIG_DEFAULT "Release")
endif()
set(AVDN_CONFIG "${AVDN_CONFIG_DEFAULT}") # CACHE?
endif()
# Define MUMMY_ADD_CSHARP_CONFIG so the linkresource arguments get put
# into the response file instead of directly on the csc command line,
# because there are too many VTK dlls to list them all on an 8K
# command line now...
set(MUMMY_ADD_CSHARP_CONFIG "${AVDN_CONFIG}")
# Tools locations - either already found by parent project, specified on the
# command line, or available in the PATH... If not, you'll have to find
# these things yourself at configure time... :-)
#
include("${Mummy_DIR}/FindCsharp.cmake")
if(NOT csc_EXECUTABLE)
find_program(csc_EXECUTABLE csc)
endif()
if(NOT csc_EXECUTABLE)
message(FATAL_ERROR "error: C# compiler not found. csc_EXECUTABLE='${csc_EXECUTABLE}'")
endif()
if(NOT mummy_EXECUTABLE)
find_program(mummy_EXECUTABLE mummy)
endif()
if(NOT mummy_EXECUTABLE)
message(FATAL_ERROR "error: mummy not found. mummy_EXECUTABLE='${mummy_EXECUTABLE}'")
endif()
if(NOT gccxml_EXECUTABLE)
find_program(gccxml_EXECUTABLE gccxml)
endif()
if(NOT gccxml_EXECUTABLE)
message(FATAL_ERROR "error: gccxml not found. gccxml_EXECUTABLE='${gccxml_EXECUTABLE}'")
endif()
include_directories(${Mummy_INCLUDE_DIRS})
set(gccxml_compiler "${CMAKE_CXX_COMPILER}")
if(MSVC80)
set(gccxml_compiler "msvc8")
endif()
if(MSVC90)
set(gccxml_compiler "msvc9")
endif()
# VTK:
#
FIND_PACKAGE(VTK)
IF(NOT VTK_USE_FILE)
MESSAGE(FATAL_ERROR "error: VTK_USE_FILE not defined. Please set VTK_DIR to a compatible VTK build/binary tree...")
ENDIF(NOT VTK_USE_FILE)
INCLUDE(${VTK_USE_FILE})
# Read VTK_SOURCE_DIR value from "${VTK_DIR}/CMakeCache.txt" (assumes that
# VTK_DIR points to a build tree of VTK where the source directory is also
# still valid/in-sync -- does not work with an install tree of VTK...)
# Save the value in our own variable, AVDN_VTK_SOURCE_DIR.
#
# We need this value to access the @AVDN_VTK_SOURCE_DIR@/Wrapping/hints file
# which is referenced by MummySettings.xml.
#
# We also need it down in the Testing subdirectory to access *.tcl
# scripts so they can be converted to C# equivalents.
#
# We also pull out the values of the following VTK cache variables for our
# own information:
# VTK_DATA_ROOT
# VTK_USE_PARALLEL
# VTK_USE_SYSTEM_EXPAT
# VTK_USE_SYSTEM_FREETYPE
# VTK_USE_SYSTEM_JPEG
# VTK_USE_SYSTEM_LIBPROJ4
# VTK_USE_SYSTEM_LIBXML2
# VTK_USE_SYSTEM_PNG
# VTK_USE_SYSTEM_TIFF
# VTK_USE_SYSTEM_ZLIB
#
FILE(READ "${VTK_DIR}/CMakeCache.txt" AVDN_vtk_cmakecache)
STRING(REGEX REPLACE ";" "\\\\;" AVDN_vtk_cmakecache "${AVDN_vtk_cmakecache}")
STRING(REGEX REPLACE "\n" "E;" AVDN_vtk_cmakecache "${AVDN_vtk_cmakecache}")
SET(AVDN_VTK_SOURCE_DIR "")
FOREACH(line ${AVDN_vtk_cmakecache})
IF(NOT line MATCHES "-ADVANCED:INTERNAL=")
IF(line MATCHES "^VTK_SOURCE_DIR.*=(.*)E$")
STRING(REGEX REPLACE "^VTK_SOURCE_DIR.*=(.*)E$" "\\1" AVDN_VTK_SOURCE_DIR "${line}")
ENDIF(line MATCHES "^VTK_SOURCE_DIR.*=(.*)E$")
IF(line MATCHES "^Module_vtkParallelMPI.*=(.*)E$")
STRING(REGEX REPLACE "^Module_vtkParallelMPI.*=(.*)E$" "\\1" AVDN_VTK_PARALLEL_MPI "${line}")
ENDIF(line MATCHES "^Module_vtkParallelMPI.*=(.*)E$")
IF(line MATCHES "^VTK_USE_SYSTEM_EXPAT.*=(.*)E$")
STRING(REGEX REPLACE "^VTK_USE_SYSTEM_EXPAT.*=(.*)E$" "\\1" AVDN_VTK_USE_SYSTEM_EXPAT "${line}")
ENDIF(line MATCHES "^VTK_USE_SYSTEM_EXPAT.*=(.*)E$")
IF(line MATCHES "^VTK_USE_SYSTEM_FREETYPE.*=(.*)E$")
STRING(REGEX REPLACE "^VTK_USE_SYSTEM_FREETYPE.*=(.*)E$" "\\1" AVDN_VTK_USE_SYSTEM_FREETYPE "${line}")
ENDIF(line MATCHES "^VTK_USE_SYSTEM_FREETYPE.*=(.*)E$")
IF(line MATCHES "^VTK_USE_SYSTEM_JPEG.*=(.*)E$")
STRING(REGEX REPLACE "^VTK_USE_SYSTEM_JPEG.*=(.*)E$" "\\1" AVDN_VTK_USE_SYSTEM_JPEG "${line}")
ENDIF(line MATCHES "^VTK_USE_SYSTEM_JPEG.*=(.*)E$")
IF(line MATCHES "^VTK_USE_SYSTEM_LIBPROJ4.*=(.*)E$")
STRING(REGEX REPLACE "^VTK_USE_SYSTEM_LIBPROJ4.*=(.*)E$" "\\1" AVDN_VTK_USE_SYSTEM_LIBPROJ4 "${line}")
ENDIF(line MATCHES "^VTK_USE_SYSTEM_LIBPROJ4.*=(.*)E$")
IF(line MATCHES "^VTK_USE_SYSTEM_LIBXML2.*=(.*)E$")
STRING(REGEX REPLACE "^VTK_USE_SYSTEM_LIBXML2.*=(.*)E$" "\\1" AVDN_VTK_USE_SYSTEM_LIBXML2 "${line}")
ENDIF(line MATCHES "^VTK_USE_SYSTEM_LIBXML2.*=(.*)E$")
IF(line MATCHES "^VTK_USE_SYSTEM_PNG.*=(.*)E$")
STRING(REGEX REPLACE "^VTK_USE_SYSTEM_PNG.*=(.*)E$" "\\1" AVDN_VTK_USE_SYSTEM_PNG "${line}")
ENDIF(line MATCHES "^VTK_USE_SYSTEM_PNG.*=(.*)E$")
IF(line MATCHES "^VTK_USE_SYSTEM_TIFF.*=(.*)E$")
STRING(REGEX REPLACE "^VTK_USE_SYSTEM_TIFF.*=(.*)E$" "\\1" AVDN_VTK_USE_SYSTEM_TIFF "${line}")
ENDIF(line MATCHES "^VTK_USE_SYSTEM_TIFF.*=(.*)E$")
IF(line MATCHES "^VTK_USE_SYSTEM_ZLIB.*=(.*)E$")
STRING(REGEX REPLACE "^VTK_USE_SYSTEM_ZLIB.*=(.*)E$" "\\1" AVDN_VTK_USE_SYSTEM_ZLIB "${line}")
ENDIF(line MATCHES "^VTK_USE_SYSTEM_ZLIB.*=(.*)E$")
ENDIF(NOT line MATCHES "-ADVANCED:INTERNAL=")
ENDFOREACH(line)
set(AVDN_EXTRA_EXCLUDE_CLASSES ${AVDN_EXTRA_EXCLUDE_CLASSES} CACHE STRING
"Force the wrap_exclude to 1 for these classes")
set(AVDN_EXTRA_EXCLUDE_CLASSES_XML "")
foreach(class ${AVDN_EXTRA_EXCLUDE_CLASSES})
set(AVDN_EXTRA_EXCLUDE_CLASSES_XML
"${AVDN_EXTRA_EXCLUDE_CLASSES_XML} <Class name=\"${class}\" wrappable=\"false\"/>\n")
endforeach()
if(NOT "${AVDN_EXTRA_EXCLUDE_CLASSES_XML}" STREQUAL "")
set(AVDN_EXTRA_EXCLUDE_CLASSES_XML "\n <!-- AVDN_EXTRA_EXCLUDE_CLASSES_XML -->\n${AVDN_EXTRA_EXCLUDE_CLASSES_XML}")
endif()
# Set the VTK Data root
set(AVDN_VTK_DATA_ROOT "${VTK_DIR}/ExternalData/Testing")
# If a real strong name signing keyfile has not been predefined,
# then use the public key file in the source tree to /delaysign
# .NET assemblies...
#
set(AVDN_SNKEYFILE "" CACHE FILEPATH "Specify the SNKEY" )
if(AVDN_SNKEYFILE STREQUAL "")
get_filename_component(AVDN_SNKEYFILE "${ActiVizDotNet_SOURCE_DIR}/Kitware.VTK.pub.snk" ABSOLUTE)
endif()
message(STATUS "AVDN_EDITION='${AVDN_EDITION}'")
message(STATUS "AVDN_EXTRA_EXCLUDE_CLASSES='${AVDN_EXTRA_EXCLUDE_CLASSES}'")
message(STATUS "AVDN_SNKEYFILE='${AVDN_SNKEYFILE}'")
message(STATUS "AVDN_VTK_DATA_ROOT='${AVDN_VTK_DATA_ROOT}'")
message(STATUS "AVDN_VTK_SOURCE_DIR='${AVDN_VTK_SOURCE_DIR}'")
message(STATUS "AVDN_VTK_USE_SYSTEM_EXPAT='${AVDN_VTK_USE_SYSTEM_EXPAT}'")
message(STATUS "AVDN_VTK_USE_SYSTEM_FREETYPE='${AVDN_VTK_USE_SYSTEM_FREETYPE}'")
message(STATUS "AVDN_VTK_USE_SYSTEM_JPEG='${AVDN_VTK_USE_SYSTEM_JPEG}'")
message(STATUS "AVDN_VTK_USE_SYSTEM_LIBPROJ4='${AVDN_VTK_USE_SYSTEM_LIBPROJ4}'")
message(STATUS "AVDN_VTK_USE_SYSTEM_LIBXML2='${AVDN_VTK_USE_SYSTEM_LIBXML2}'")
message(STATUS "AVDN_VTK_USE_SYSTEM_PNG='${AVDN_VTK_USE_SYSTEM_PNG}'")
message(STATUS "AVDN_VTK_USE_SYSTEM_TIFF='${AVDN_VTK_USE_SYSTEM_TIFF}'")
message(STATUS "AVDN_VTK_USE_SYSTEM_ZLIB='${AVDN_VTK_USE_SYSTEM_ZLIB}'")
message(STATUS "VTK_BUILD_SHARED_LIBS='${VTK_BUILD_SHARED_LIBS}'")
message(STATUS "VTK_DIR='${VTK_DIR}'")
message(STATUS "csc_EXECUTABLE='${csc_EXECUTABLE}'")
message(STATUS "gccxml_EXECUTABLE='${gccxml_EXECUTABLE}'")
message(STATUS "mono_EXECUTABLE='${mono_EXECUTABLE}'")
message(STATUS "mummy_EXECUTABLE='${mummy_EXECUTABLE}'")
message(STATUS "gccxml_compiler='${gccxml_compiler}'...")
# Organization:
#
# If MV_ONE_EXPORT_LAYER_DLL is 0 then all the generated export-layer/*.cxx
# files get built into multiple export layer DLLs called
# ${CMAKE_SHARED_LIBRARY_PREFIX}${module}EL${CMAKE_SHARED_LIBRARY_SUFFIX}.
# If VTK is built as dlls, we need to use multiple export layer DLLs.
#
# If MV_ONE_EXPORT_LAYER_DLL is 1 then all the generated export-layer/*.cxx
# files get built into one large export layer DLL called
# ${CMAKE_SHARED_LIBRARY_PREFIX}Kitware.VTK.Unmanaged${CMAKE_SHARED_LIBRARY_SUFFIX}.
# If VTK is built as static libs, we need to use one large export layer DLL.
#
if(VTK_BUILD_SHARED_LIBS)
set(MV_ONE_EXPORT_LAYER_DLL 0)
else()
set(MV_ONE_EXPORT_LAYER_DLL 1)
endif()
set(AVDN_SOURCE_TREE_IS_SVN_CHECKOUT 0)
set(AVDN_SVN_STATUS "")
set(AVDN_SVN_STATUS_BRIEF "")
set(AVDN_SVN_STATUS_ENCODED "")
set(AVDN_WC_LAST_CHANGED_REV "1009")
#
# This value is an artificial number that is simply incremented manually
# now after switching to git from svn... Whenever we do "real packaging
# releases" this number should be incremented manually until this code
# is updated to reflect our shiny, new git repo-ness.
# Version
#
configure_file(
"${ActiVizDotNet_SOURCE_DIR}/ActiVizDotNetVersion.cmake.in"
"${ActiVizDotNet_BINARY_DIR}/ActiVizDotNetVersion.cmake"
@ONLY
)
include("${ActiVizDotNet_BINARY_DIR}/ActiVizDotNetVersion.cmake")
include_directories(${ActiVizDotNet_SOURCE_DIR})
set(AVDN_INSTALL_FILES "")
set(AVDN_INSTALL_TARGETS "")
# Events
#
# Still TODO:
#
# (1) - Generate correct RemoveAllRelayHandlers code for each object
# that has any events.
#
# (2) - figure out a way to get RemoveAllRelayHandlers called from the
# right place in the Dispose method...
#
# (3) - Use ADD_CUSTOM_COMMAND and a custom target to set up dependencies
# on the "EventFragment-*" output files from this script and the "extra.cs"
# files where the fragments will eventually end up. For now, just put all
# of them into vtkObject_Extra.cs
#
add_custom_command(
OUTPUT ${ActiVizDotNet_BINARY_DIR}/csharp/GenerateEventFragmentsSentinel.txt
COMMAND ${CMAKE_COMMAND}
"-DActiVizDotNet_BINARY_DIR:STRING=${ActiVizDotNet_BINARY_DIR}"
"-DAVDN_VTK_SOURCE_DIR:STRING=${AVDN_VTK_SOURCE_DIR}"
-P "${ActiVizDotNet_SOURCE_DIR}/GenerateEventFragments.cmake"
DEPENDS
${ActiVizDotNet_SOURCE_DIR}/GenerateEventFragments.cmake
${AVDN_VTK_SOURCE_DIR}/Common/Core/vtkCommand.h
${CMAKE_COMMAND}
)
# Use these settings when building with the Msvc compiler:
#
include("${ActiVizDotNet_SOURCE_DIR}/MsvcMacros.cmake")
#MSVC_LINK_TO_STATIC_CRT()
MSVC80_FORCE_MANIFEST_LINKER_FLAG()
MSVC80_SUPPRESS_CRT_DEPRECATED_WARNINGS()
set(exe_dir "${VTK_BINARY_DIR}/${CMAKE_CFG_INTDIR}")
if(EXECUTABLE_OUTPUT_PATH)
set(exe_dir "${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}")
endif()
# Run gccxml/mummy on each wrapped class:
#
set(WRAPPED_CLASS_TABLE "")
set(generated_files "")
set(ALLMODULES_EL_SOURCES "")
set(ALLMODULES_CS_SOURCES "")
set(ALLMODULES_SENTINELS "")
configure_file(
"${ActiVizDotNet_SOURCE_DIR}/MummySettings.xml.in"
"${ActiVizDotNet_BINARY_DIR}/xml/MummySettings.xml"
@ONLY
)
configure_file(
"${ActiVizDotNet_SOURCE_DIR}/vtkObjectEL_Extra.cxx.in"
"${ActiVizDotNet_BINARY_DIR}/export-layer/vtkObjectEL_Extra.cxx"
@ONLY
)
#configure_file(
# "${ActiVizDotNet_SOURCE_DIR}/vtkObject_Extra.cs.in"
# "${ActiVizDotNet_BINARY_DIR}/csharp/vtkObject_Extra.cs"
# @ONLY
#)
add_custom_command(
OUTPUT ${ActiVizDotNet_BINARY_DIR}/csharp/AssembleExtraSourcesSentinel.txt
COMMAND ${CMAKE_COMMAND}
"-DActiVizDotNet_BINARY_DIR:STRING=${ActiVizDotNet_BINARY_DIR}"
"-Daes_class:STRING=vtkObject"
-P "${ActiVizDotNet_SOURCE_DIR}/AssembleExtraSources.cmake"
DEPENDS
${ActiVizDotNet_SOURCE_DIR}/AssembleExtraSources.cmake
${ActiVizDotNet_SOURCE_DIR}/vtkObject_Extra.cs.in
${ActiVizDotNet_SOURCE_DIR}/vtkObject_EventFragments.cmake
${ActiVizDotNet_BINARY_DIR}/csharp/GenerateEventFragmentsSentinel.txt
${CMAKE_COMMAND}
)
add_custom_target(
AssembleExtraSources ALL
DEPENDS ${ActiVizDotNet_BINARY_DIR}/csharp/AssembleExtraSourcesSentinel.txt
)
# Set variables for proper incremental rebuilds when hand-crafted
# C# or C++ export layer files are modified. Any files listed as
# extra code files in MummySettings.xml.in should be listed in
# some class's _EXTRA_DEPENDENCIES variable...
#
set(vtkImageData_EXTRA_DEPENDENCIES
"${ActiVizDotNet_SOURCE_DIR}/vtkImageDataEL_Extra.cxx"
"${ActiVizDotNet_SOURCE_DIR}/vtkImageData_Extra.cs"
)
set(vtkObject_EXTRA_DEPENDENCIES
"${ActiVizDotNet_BINARY_DIR}/export-layer/vtkObjectEL_Extra.cxx"
"${ActiVizDotNet_BINARY_DIR}/csharp/vtkObject_Extra.cs"
)
set(vtkProgrammableAttributeDataFilter_EXTRA_DEPENDENCIES
"${ActiVizDotNet_SOURCE_DIR}/vtkProgrammableAttributeDataFilterEL_Extra.cxx"
"${ActiVizDotNet_SOURCE_DIR}/vtkProgrammableAttributeDataFilter_Extra.cs"
)
set(vtkStringArray_EXTRA_DEPENDENCIES
"${ActiVizDotNet_SOURCE_DIR}/vtkStringArrayEL_Extra.cxx"
"${ActiVizDotNet_SOURCE_DIR}/vtkStringArray_Extra.cs"
)
macro(derive_gccxml_include_args)
set(gccxml_include_args "")
set(dirs ${ARGV})
list(REMOVE_DUPLICATES dirs)
foreach(dir ${ARGV})
set(gccxml_include_args ${gccxml_include_args} "-I${dir}")
endforeach()
endmacro()
set(modules ${VTK_MODULES_ENABLED})
foreach(module ${modules})
if(NOT ${module}_EXCLUDE_FROM_WRAPPING)
message(STATUS "CSharp wrapping '${module}'...")
foreach(class ${AVDN_EXTRA_EXCLUDE_CLASSES})
set(VTK_CLASS_WRAP_EXCLUDE_${class} 1)
endforeach()
set(${module}_EL_SOURCES "")
set(${module}_CS_SOURCES "")
set(${module}_SENTINELS "")
vtk_module_load(${module})
vtk_module_headers_load(${module})
vtk_module_dep_includes(${module})
derive_gccxml_include_args(
${Mummy_INCLUDE_DIRS}
${${module}_DEPENDS_INCLUDE_DIRS}
${${module}_INCLUDE_DIRS}
${${module}_SYSTEM_INCLUDE_DIRS}
)
# List of classes that should be parsed by GCCXML with the #define __WRAP__ option
set(AVDN_VTK__WRAP__CLASSES
#vtkBitArray #already have the functions
vtkCharArray
vtkDoubleArray
vtkFloatArray
vtkIdTypeArray
vtkIntArray
vtkLongArray
vtkLongLongArray
vtkShortArray
vtkSignedCharArray
vtkUnsignedCharArray
vtkUnsignedIntArray
vtkUnsignedLongArray
vtkUnsignedLongLongArray
vtkUnsignedShortArray
vtkSMPTools
vtkHyperTreeGrid
vtkMappedUnstructuredGrid)
foreach(class ${${module}_HEADERS})
if(NOT ${module}_HEADER_${class}_WRAP_EXCLUDE)
set(header "${class}.h")
set(cxxclass "${class}")
# Build one master in-memory table so that we don't have to re-do all the
# logic in this nested FOREACH loop later on... Instead we'll simply iterate
# the in-memory table built here:
#
set(WRAPPED_CLASS_TABLE ${WRAPPED_CLASS_TABLE} "${cxxclass} ${module} ${header}")
# If the class is an array we need to #define the __WRAP__ option for gccxml to pickup
# the real base class (because it's templated).
list(FIND AVDN_VTK__WRAP__CLASSES ${class} FileUseVTK__WRAP__)
if(FileUseVTK__WRAP__ EQUAL -1)
configure_file(
"${ActiVizDotNet_SOURCE_DIR}/gccxml.cxx.in"
"${ActiVizDotNet_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx"
@ONLY
)
else()
configure_file(
"${ActiVizDotNet_SOURCE_DIR}/gccxml.wrapvtk.cxx.in"
"${ActiVizDotNet_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx"
@ONLY
)
endif()
IF(HasMyModule EQUAL -1)
message(FATAL_ERROR "You must build VTK with more modules.")
ENDIF()
add_custom_command(
OUTPUT ${ActiVizDotNet_BINARY_DIR}/xml/${cxxclass}.xml
COMMAND ${gccxml_EXECUTABLE}
-fxml=${ActiVizDotNet_BINARY_DIR}/xml/${cxxclass}.xml
-fxml-start=_cable_
${gccxml_include_args} -DCABLE_CONFIGURATION
--gccxml-compiler ${gccxml_compiler}
${ActiVizDotNet_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx
DEPENDS
${ActiVizDotNet_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx
${header}
${gccxml_EXECUTABLE}
)
#
# *before* custom command re-arranging:
#
# OUTPUT ${ActiVizDotNet_BINARY_DIR}/csharp/${cxxclass}.cs
# ${ActiVizDotNet_BINARY_DIR}/export-layer/${cxxclass}EL.cxx
#
# Do not list the *.cs or *EL.cxx files as outputs of this custom command.
# If you do, the custom command chains out into other targets rather than
# being defined solely in the "GenerateCSharp" custom target.
#
# The output of this command is the generated sentinel file that the
# "GenerateCSharp" target depends on. The other files are generated as an
# intentional "side effect" and after the target is done building, the other
# targets that build the generated source code may build... That is controlled
# by target level dependencies to reduce complexity.
#
add_custom_command(
OUTPUT ${ActiVizDotNet_BINARY_DIR}/csharp/${cxxclass}-sentinel.txt
COMMAND ${mummy_EXECUTABLE}
--suppress-warnings 6005 6006 6009 6010 6012 6013 6015 6016 6017 6018 6019 7003
--settings-file ${ActiVizDotNet_BINARY_DIR}/xml/MummySettings.xml
--gccxml-file ${ActiVizDotNet_BINARY_DIR}/xml/${cxxclass}.xml
--csharp-file ${ActiVizDotNet_BINARY_DIR}/csharp/${cxxclass}.cs
--export-layer-file ${ActiVizDotNet_BINARY_DIR}/export-layer/${cxxclass}EL.cxx
COMMAND ${CMAKE_COMMAND} -E touch
${ActiVizDotNet_BINARY_DIR}/csharp/${cxxclass}-sentinel.txt
DEPENDS
${ActiVizDotNet_BINARY_DIR}/xml/${cxxclass}.xml
${ActiVizDotNet_BINARY_DIR}/xml/MummySettings.xml
${mummy_EXECUTABLE}
${${cxxclass}_EXTRA_DEPENDENCIES}
)
set(${module}_EL_SOURCES ${${module}_EL_SOURCES}
"${ActiVizDotNet_BINARY_DIR}/export-layer/${cxxclass}EL.cxx")
set(ALLMODULES_EL_SOURCES ${ALLMODULES_EL_SOURCES}
"${ActiVizDotNet_BINARY_DIR}/export-layer/${cxxclass}EL.cxx")
set(${module}_CS_SOURCES ${${module}_CS_SOURCES}
"${ActiVizDotNet_BINARY_DIR}/csharp/${cxxclass}.cs")
set(ALLMODULES_CS_SOURCES ${ALLMODULES_CS_SOURCES}
"${ActiVizDotNet_BINARY_DIR}/csharp/${cxxclass}.cs")
set(${module}_SENTINELS ${${module}_SENTINELS}
"${ActiVizDotNet_BINARY_DIR}/csharp/${cxxclass}-sentinel.txt")
set(ALLMODULES_SENTINELS ${ALLMODULES_SENTINELS}
"${ActiVizDotNet_BINARY_DIR}/csharp/${cxxclass}-sentinel.txt")
endif()
endforeach()
if(NOT "${${module}_SENTINELS}" STREQUAL "")
add_custom_target(
"${module}GenerateCSharp" ALL
DEPENDS ${${module}_SENTINELS}
)
if("${module}" STREQUAL "vtkCommonCore")
add_dependencies(${module}GenerateCSharp AssembleExtraSources)
endif()
endif()
# else()
# message(STATUS "info: no '${module}' classes to wrap for CSharp")
endif()
endforeach()
set_source_files_properties(
${ALLMODULES_EL_SOURCES}
# ${ALLMODULES_CS_SOURCES}
PROPERTIES GENERATED 1)
# Set list of export-layer dlls in C# syntax as CMake variable
# MV_EXPORTLAYER_DLL_VARIABLES. This gets configured into
# WrappedObject.cs below.
#
set(MV_EXPORTLAYER_DLL_VARIABLES "")
foreach(module ${VTK_MODULES_ENABLED})
if(NOT ${module}_EXCLUDE_FROM_WRAPPING)
set(MV_EXPORTLAYER_DLL_VARIABLES "${MV_EXPORTLAYER_DLL_VARIABLES} /// <summary>\n")
set(MV_EXPORTLAYER_DLL_VARIABLES "${MV_EXPORTLAYER_DLL_VARIABLES} /// Export layer functions for '${module}' are exported from\n")
set(MV_EXPORTLAYER_DLL_VARIABLES "${MV_EXPORTLAYER_DLL_VARIABLES} /// the DLL named by the value of this variable.\n")
set(MV_EXPORTLAYER_DLL_VARIABLES "${MV_EXPORTLAYER_DLL_VARIABLES} /// </summary>\n")
if(MV_ONE_EXPORT_LAYER_DLL)
set(MV_EXPORTLAYER_DLL_VARIABLES "${MV_EXPORTLAYER_DLL_VARIABLES} public const string ${module}EL_dll = \"${CMAKE_SHARED_LIBRARY_PREFIX}Kitware.VTK.Unmanaged${CMAKE_SHARED_LIBRARY_SUFFIX}\";\n")
else()
set(MV_EXPORTLAYER_DLL_VARIABLES "${MV_EXPORTLAYER_DLL_VARIABLES} public const string ${module}EL_dll = \"${CMAKE_SHARED_LIBRARY_PREFIX}Kitware.VTK.${module}.Unmanaged${CMAKE_SHARED_LIBRARY_SUFFIX}\";\n")
endif()
endif()
endforeach()
# Configure list of C# source files:
#
set(csharp_namespace "Kitware.VTK")
configure_file(
"${ActiVizDotNet_SOURCE_DIR}/WrappedObject.cs.in"
"${ActiVizDotNet_BINARY_DIR}/csharp/WrappedObject.cs"
@ONLY
)
configure_file(
"${ActiVizDotNet_SOURCE_DIR}/AssemblyInfo.cs.in"
"${ActiVizDotNet_BINARY_DIR}/csharp/AssemblyInfo.cs"
@ONLY
)
set(ALLMODULES_CS_SOURCES
${ALLMODULES_CS_SOURCES}
"${ActiVizDotNet_SOURCE_DIR}/RenderWindowControl/RenderWindowControl.cs"
"${ActiVizDotNet_SOURCE_DIR}/RenderWindowControl/RenderWindowControl.Designer.cs"
"${ActiVizDotNet_BINARY_DIR}/csharp/WrappedObject.cs"
"${ActiVizDotNet_BINARY_DIR}/csharp/AssemblyInfo.cs"
)
macro(ADD_CUSTOM_COMMAND_COPYFILE srcFile dstFile)
add_custom_command(
OUTPUT "${dstFile}"
DEPENDS "${srcFile}"
COMMAND ${CMAKE_COMMAND}
ARGS -E copy "${srcFile}" "${dstFile}"
)
endmacro()
macro(ADD_CUSTOM_COMMAND_SYMLINK srcFile linkFile)
get_filename_component(srcFilePath "${srcFile}" PATH)
get_filename_component(linkFilePath "${linkFile}" PATH)
if("${srcFilePath}" STREQUAL "${linkFilePath}")
get_filename_component(srcFileName "${srcFile}" NAME)
set(srcFileName "./${srcFileName}")
else()
set(srcFileName "${srcFile}")
endif()
add_custom_command(
OUTPUT "${linkFile}"
DEPENDS "${srcFile}"
COMMAND ${CMAKE_COMMAND}
ARGS -E create_symlink "${srcFileName}" "${linkFile}"
)
endmacro()
set(vtkListOfDLLs "")
set(AVDN_DO_COPY_LIBRARIES_STEPS 1)
if(AVDN_DO_COPY_LIBRARIES_STEPS)
#
# Add custom commands/target to copy the mummy Runtime libs to
# LIBRARY_OUTPUT_PATH and dlls to EXECUTABLE_OUTPUT_PATH:
#
set(lib_dir "${VTK_BINARY_DIR}/${CMAKE_CFG_INTDIR}")
if(LIBRARY_OUTPUT_PATH)
set(lib_dir "${LIBRARY_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}")
endif()
set(exe_dir "${VTK_BINARY_DIR}/${CMAKE_CFG_INTDIR}")
if(EXECUTABLE_OUTPUT_PATH)
set(exe_dir "${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}")
endif()
# x86 binaries (exe, dll and lib) are in ${Mummy_BIN_DIR}:
#
set(bin_src_dir "${Mummy_BIN_DIR}")
set(lib_src_dir "${Mummy_BIN_DIR}")
# x64 binaries (exe, dll and lib) are in ${Mummy_BIN_x64_DIR}:
#
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(bin_src_dir "${Mummy_BIN_x64_DIR}")
set(lib_src_dir "${Mummy_BIN_x64_DIR}")
endif()
if(WIN32)
# .lib file is Windows only...
ADD_CUSTOM_COMMAND_COPYFILE(
"${lib_src_dir}/Kitware.mummy.Runtime.Unmanaged.lib"
"${lib_dir}/Kitware.mummy.Runtime.Unmanaged.lib"
)
endif()
ADD_CUSTOM_COMMAND_COPYFILE(
"${bin_src_dir}/${CMAKE_SHARED_LIBRARY_PREFIX}Kitware.mummy.Runtime.Unmanaged${CMAKE_SHARED_LIBRARY_SUFFIX}"
"${exe_dir}/${CMAKE_SHARED_LIBRARY_PREFIX}Kitware.mummy.Runtime.Unmanaged${CMAKE_SHARED_LIBRARY_SUFFIX}"
)
ADD_CUSTOM_COMMAND_COPYFILE(
"${bin_src_dir}/Kitware.mummy.Runtime.dll"
"${exe_dir}/Kitware.mummy.Runtime.dll"
)
set(MCL_deps
"${exe_dir}/${CMAKE_SHARED_LIBRARY_PREFIX}Kitware.mummy.Runtime.Unmanaged${CMAKE_SHARED_LIBRARY_SUFFIX}"
"${exe_dir}/Kitware.mummy.Runtime.dll"
)
if(WIN32)
# .lib file is Windows only...
set(MCL_deps ${MCL_deps}
"${lib_dir}/Kitware.mummy.Runtime.Unmanaged.lib"
)
endif()
# Rules to copy pdb files only get added if the source pdb files actually
# exist at CMake configure time...
#
if(EXISTS "${bin_src_dir}/kitware.mummy.runtime.unmanaged.pdb")
ADD_CUSTOM_COMMAND_COPYFILE(
"${bin_src_dir}/kitware.mummy.runtime.unmanaged.pdb"
"${exe_dir}/kitware.mummy.runtime.unmanaged.pdb"
)
set(MCL_deps ${MCL_deps}
"${exe_dir}/kitware.mummy.runtime.unmanaged.pdb"
)
endif()
if(EXISTS "${bin_src_dir}/Kitware.mummy.Runtime.pdb")
ADD_CUSTOM_COMMAND_COPYFILE(
"${bin_src_dir}/Kitware.mummy.Runtime.pdb"
"${exe_dir}/Kitware.mummy.Runtime.pdb"
)
set(MCL_deps ${MCL_deps}
"${exe_dir}/Kitware.mummy.Runtime.pdb"
)
endif()
add_custom_target(
Kitware.mummy.CopyLibraries ALL
DEPENDS ${MCL_deps}
)
IF(VTK_BUILD_SHARED_LIBS)
IF(EXISTS "${VTK_DIR}/bin")
#
# Add custom commands/target to copy the VTK Runtime dlls to
# EXECUTABLE_OUTPUT_PATH:
#
SET(VCL_deps "")
SET(vtk_dll_dir "${VTK_DIR}/bin/${CMAKE_CFG_INTDIR}")
# Since this whole chunk copies files from ${vtk_dll_dir} to
# ${exe_dir}, only add the commands to do it if those directories
# are different:
#
IF(NOT "${vtk_dll_dir}" STREQUAL "${exe_dir}")
# Use the list of modules as the basis for which DLLs to copy:
#
foreach(module ${VTK_MODULES_ENABLED})
if(NOT ${module}_EXCLUDE_FROM_WRAPPING)
set(vtkListOfDLLs ${vtkListOfDLLs} ${module})
endif()
endforeach()
# Add extra utility DLLs the kit DLLs depend on:
#
SET(vtkListOfDLLs ${vtkListOfDLLs}
#Cosmo
#LSDyna
#VPIC
vtkoggtheora
vtkgl2ps
vtkalglib
vtkDICOMParser
vtkexoIIc
vtkftgl
vtkhdf5
vtkhdf5_hl
vtkmetaio
vtkNetCDF
vtkNetCDF_cxx
vtksys
vtkverdict
vtkjsoncpp
)
IF(NOT AVDN_VTK_USE_SYSTEM_EXPAT)
SET(vtkListOfDLLs ${vtkListOfDLLs}
vtkexpat
)
ENDIF(NOT AVDN_VTK_USE_SYSTEM_EXPAT)
IF(NOT AVDN_VTK_USE_SYSTEM_FREETYPE)
SET(vtkListOfDLLs ${vtkListOfDLLs}
vtkfreetype
)
ENDIF(NOT AVDN_VTK_USE_SYSTEM_FREETYPE)
IF(NOT AVDN_VTK_USE_SYSTEM_JPEG)
SET(vtkListOfDLLs ${vtkListOfDLLs}
vtkjpeg
)
ENDIF(NOT AVDN_VTK_USE_SYSTEM_JPEG)
IF(NOT AVDN_VTK_USE_SYSTEM_LIBXML2)
SET(vtkListOfDLLs ${vtkListOfDLLs}
vtklibxml2
)
ENDIF(NOT AVDN_VTK_USE_SYSTEM_LIBXML2)
IF(NOT AVDN_VTK_USE_SYSTEM_PNG)
SET(vtkListOfDLLs ${vtkListOfDLLs}
vtkpng
)
ENDIF(NOT AVDN_VTK_USE_SYSTEM_PNG)
IF(NOT AVDN_VTK_USE_SYSTEM_LIBPROJ4)
SET(vtkListOfDLLs ${vtkListOfDLLs}
vtkproj4
)
ENDIF(NOT AVDN_VTK_USE_SYSTEM_LIBPROJ4)
IF(NOT AVDN_VTK_USE_SYSTEM_TIFF)
SET(vtkListOfDLLs ${vtkListOfDLLs}
vtktiff
)
ENDIF(NOT AVDN_VTK_USE_SYSTEM_TIFF)
IF(NOT AVDN_VTK_USE_SYSTEM_ZLIB)
SET(vtkListOfDLLs ${vtkListOfDLLs}
vtkzlib
)
ENDIF(NOT AVDN_VTK_USE_SYSTEM_ZLIB)
# Only on non-Win32 systems, vtksqlite *is* built as a shared lib:
#
IF(NOT WIN32)
SET(vtkListOfDLLs ${vtkListOfDLLs}
vtksqlite
)
ENDIF(NOT WIN32)
# On Linux/Mac, VTK's *real* shared libs are named with ".so.5.8.0" (for example)
# at the end of the file name. The ".so" and ".so.5.8" files are symlinks to the
# real shared lib...
#
SET(vtk_sl_suffix "")
SET(vtk_sl_base_suffix "")
SET(vtk_dl_suffix "")
if(WIN32)
set(vtk_dl_suffix "-${VTK_MAJOR_VERSION}.${VTK_MINOR_VERSION}")
SET(vtk_major_minor ".${VTK_MAJOR_VERSION}.${VTK_MINOR_VERSION}")
else()
SET(vtk_sl_base_suffix ".${VTK_MAJOR_VERSION}.${VTK_MINOR_VERSION}.${VTK_BUILD_VERSION}")
SET(vtk_major_minor ".${VTK_MAJOR_VERSION}.${VTK_MINOR_VERSION}")
ENDIF()
# Loop over all the VTK dlls and add a custom command to copy each one to the
# build tree's "exe_dir". Also add each one to the list of files to install.
#
FOREACH(vtkDLL ${vtkListOfDLLs})
IF(NOT vtk_sl_base_suffix STREQUAL "")
SET(vtk_sl_suffix "${vtk_sl_base_suffix}")
ENDIF(NOT vtk_sl_base_suffix STREQUAL "")
ADD_CUSTOM_COMMAND_COPYFILE(
"${vtk_dll_dir}/${CMAKE_SHARED_LIBRARY_PREFIX}${vtkDLL}${vtk_dl_suffix}${CMAKE_SHARED_LIBRARY_SUFFIX}${vtk_sl_suffix}"
"${exe_dir}/${CMAKE_SHARED_LIBRARY_PREFIX}${vtkDLL}${vtk_dl_suffix}${CMAKE_SHARED_LIBRARY_SUFFIX}${vtk_sl_suffix}"
)
SET(AVDN_INSTALL_FILES ${AVDN_INSTALL_FILES}
"${CMAKE_SHARED_LIBRARY_PREFIX}${vtkDLL}${vtk_dl_suffix}${CMAKE_SHARED_LIBRARY_SUFFIX}${vtk_sl_suffix}"
)
SET(VCL_deps ${VCL_deps}
"${exe_dir}/${CMAKE_SHARED_LIBRARY_PREFIX}${vtkDLL}${vtk_dl_suffix}${CMAKE_SHARED_LIBRARY_SUFFIX}${vtk_sl_suffix}"
)
IF(NOT vtk_sl_base_suffix STREQUAL "")
ADD_CUSTOM_COMMAND_SYMLINK(
"${exe_dir}/${CMAKE_SHARED_LIBRARY_PREFIX}${vtkDLL}${vtk_dl_suffix}${CMAKE_SHARED_LIBRARY_SUFFIX}${vtk_sl_suffix}"
"${exe_dir}/${CMAKE_SHARED_LIBRARY_PREFIX}${vtkDLL}${vtk_dl_suffix}${CMAKE_SHARED_LIBRARY_SUFFIX}${vtk_major_minor}"
)
ADD_CUSTOM_COMMAND_SYMLINK(
"${exe_dir}/${CMAKE_SHARED_LIBRARY_PREFIX}${vtkDLL}${vtk_dl_suffix}${CMAKE_SHARED_LIBRARY_SUFFIX}${vtk_major_minor}"
"${exe_dir}/${CMAKE_SHARED_LIBRARY_PREFIX}${vtkDLL}${vtk_dl_suffix}${CMAKE_SHARED_LIBRARY_SUFFIX}"
)
SET(AVDN_INSTALL_FILES ${AVDN_INSTALL_FILES}
"${CMAKE_SHARED_LIBRARY_PREFIX}${vtkDLL}${vtk_dl_suffix}${CMAKE_SHARED_LIBRARY_SUFFIX}${vtk_major_minor}"
"${CMAKE_SHARED_LIBRARY_PREFIX}${vtkDLL}${vtk_dl_suffix}${CMAKE_SHARED_LIBRARY_SUFFIX}"
)
SET(VCL_deps ${VCL_deps}
"${exe_dir}/${CMAKE_SHARED_LIBRARY_PREFIX}${vtkDLL}${vtk_dl_suffix}${CMAKE_SHARED_LIBRARY_SUFFIX}${vtk_major_minor}"
"${exe_dir}/${CMAKE_SHARED_LIBRARY_PREFIX}${vtkDLL}${vtk_dl_suffix}${CMAKE_SHARED_LIBRARY_SUFFIX}"
)
ENDIF(NOT vtk_sl_base_suffix STREQUAL "")
ENDFOREACH(vtkDLL)
ADD_CUSTOM_TARGET(
Kitware.VTK.CopyDLLs ALL
DEPENDS ${VCL_deps}
)
SET(AVDN_HAS_TARGET_KITWARE_VTK_COPYDLLS 1)
ENDIF(NOT "${vtk_dll_dir}" STREQUAL "${exe_dir}")
ENDIF(EXISTS "${VTK_DIR}/bin")
ENDIF()
# Also copy over the MSVC runtime dlls (so we can use them by
# file name only as /linkresource args to the C# compiler)
#
if(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS)
set(lib_deps "")
foreach(lib ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS})
get_filename_component(f "${lib}" NAME)
ADD_CUSTOM_COMMAND_COPYFILE(
"${lib}"
"${exe_dir}/${f}"
)
set(AVDN_INSTALL_FILES ${AVDN_INSTALL_FILES} "${f}")
set(lib_deps ${lib_deps} "${exe_dir}/${f}")
endforeach()
add_custom_target(
Kitware.VTK.CopyMsvcDLLs ALL
DEPENDS ${lib_deps}
)
set(AVDN_HAS_TARGET_KITWARE_VTK_COPYMSVCDLLS 1)
endif()
endif()
# The big one or the many little ones:
#
set(unmanaged_targets "")
set(unmanaged_dlls "")
if(MV_ONE_EXPORT_LAYER_DLL)
set(AVDN_INSTALL_TARGETS ${AVDN_INSTALL_TARGETS} "Kitware.VTK.Unmanaged")
add_library(Kitware.VTK.Unmanaged SHARED ${ALLMODULES_EL_SOURCES})
set(unmanaged_targets ${unmanaged_targets} "Kitware.VTK.Unmanaged")
set(unmanaged_dlls ${unmanaged_dlls} "${CMAKE_SHARED_LIBRARY_PREFIX}Kitware.VTK.Unmanaged${CMAKE_SHARED_LIBRARY_SUFFIX}")
if(WIN32)
target_link_libraries(Kitware.VTK.Unmanaged "${exe_dir}/Kitware.mummy.Runtime.Unmanaged.lib")
else()