-
Notifications
You must be signed in to change notification settings - Fork 3
/
CMakeLists.txt
1550 lines (1333 loc) · 60.1 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.6.3 FATAL_ERROR)
FOREACH(policy CMP0012 CMP0013 CMP0014)
IF(POLICY ${policy})
CMAKE_POLICY(SET ${policy} NEW)
ENDIF()
ENDFOREACH()
FOREACH(policy CMP0017)
IF(POLICY ${policy})
CMAKE_POLICY(SET ${policy} OLD)
ENDIF()
ENDFOREACH()
PROJECT(VTK)
# Objective C compile flags, future CMake versions might make this obsolete
IF(APPLE)
STRING(REGEX REPLACE "^.*MacOSX([0-9]*\\.[0-9]*)\\.sdk$" "\\1"
OSX_SDK_VERSION "${CMAKE_OSX_SYSROOT}")
SET(VTK_OBJCXX_FLAGS_DEFAULT)
IF(OSX_SDK_VERSION)
IF(${OSX_SDK_VERSION} VERSION_GREATER "10.4")
SET(VTK_OBJCXX_FLAGS_DEFAULT "-fobjc-gc")
ENDIF(${OSX_SDK_VERSION} VERSION_GREATER "10.4")
ENDIF(OSX_SDK_VERSION)
SET(VTK_REQUIRED_OBJCXX_FLAGS ${VTK_OBJCXX_FLAGS_DEFAULT} CACHE STRING "Extra flags for Objective C compilation")
MARK_AS_ADVANCED(VTK_REQUIRED_OBJCXX_FLAGS)
ENDIF(APPLE)
# The Cygwin maintainers have requested that we not define WIN32. Thus developers
# must use the X11 packages to build cygwin vtk.
IF(CYGWIN)
unset(WIN32)
ENDIF()
# the following lines are for cross compiling support
# we may get here also from ParaView, in this case don't change the filename
IF(NOT EXPORT_EXECUTABLES_FILE)
# the generators which are needed during the build have to be imported
# from a native build, which exports them, requires cmake cvs or 2.6
IF(CMAKE_CROSSCOMPILING)
FIND_PACKAGE(VTKCompileTools REQUIRED)
ENDIF(CMAKE_CROSSCOMPILING)
SET(EXPORT_EXECUTABLES_FILE "${CMAKE_BINARY_DIR}/VTKCompileToolsConfig.cmake")
SET(EXPORT_EXECUTABLES_NAMESPACE "")
FILE(WRITE "${EXPORT_EXECUTABLES_FILE}" "#generated by VTK, do not edit\n")
ENDIF(NOT EXPORT_EXECUTABLES_FILE)
GET_PROPERTY(VTK_TARGET_SUPPORTS_SHARED_LIBS
GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS)
# Warn when using "old style" CMake install commands... But only when
# building VTK itself.
#
IF("${VTK_BINARY_DIR}" STREQUAL "${CMAKE_BINARY_DIR}")
MACRO(INSTALL_TARGETS)
MESSAGE(FATAL_ERROR "Somebody is calling old INSTALL_TARGETS command with arguments: ${ARGV}")
ENDMACRO(INSTALL_TARGETS)
MACRO(INSTALL_PROGRAMS)
MESSAGE(FATAL_ERROR "Somebody is calling old INSTALL_PROGRAMS command with arguments: ${ARGV}")
ENDMACRO(INSTALL_PROGRAMS)
MACRO(INSTALL_FILES)
MESSAGE(FATAL_ERROR "Somebody is calling old INSTALL_FILES command with arguments: ${ARGV}")
ENDMACRO(INSTALL_FILES)
ENDIF("${VTK_BINARY_DIR}" STREQUAL "${CMAKE_BINARY_DIR}")
SET(VTK_CMAKE_DIR "${VTK_SOURCE_DIR}/CMake")
SET(CMAKE_MODULE_PATH "${VTK_SOURCE_DIR}/CMake" ${CMAKE_MODULE_PATH})
# Add supplemental compiler warnings, and GCC visibility support.
INCLUDE(vtkCompilerExtras)
# Check the source tree - right now just for local Git hooks.
INCLUDE(vtkCheckSourceTree)
# Set a default build type if none was specified
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
message(STATUS "Setting build type to 'Debug' as none was specified.")
set(CMAKE_BUILD_TYPE Debug CACHE STRING "Choose the type of build." FORCE)
# Set the possible values of build type for cmake-gui
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release"
"MinSizeRel" "RelWithDebInfo")
endif()
#-----------------------------------------------------------------------------
# VTK version number. An even minor number corresponds to releases.
SET(VTK_MAJOR_VERSION 5)
SET(VTK_MINOR_VERSION 10)
SET(VTK_BUILD_VERSION 0)
SET(VTK_VERSION
"${VTK_MAJOR_VERSION}.${VTK_MINOR_VERSION}.${VTK_BUILD_VERSION}")
# Append the library version information to the library target
# properties. A parent project may set its own properties and/or may
# block this.
IF(NOT VTK_NO_LIBRARY_VERSION)
SET(VTK_LIBRARY_PROPERTIES ${VTK_LIBRARY_PROPERTIES}
VERSION "${VTK_VERSION}"
SOVERSION "${VTK_MAJOR_VERSION}.${VTK_MINOR_VERSION}"
)
ENDIF(NOT VTK_NO_LIBRARY_VERSION)
INCLUDE(vtkTargetExportMacros)
#-----------------------------------------------------------------------------
# Determine whether we are being built by CTest and if so the version.
# For CTest 2.2 and higher this will contain the version number. For
# earlier CTest versions this will contain just "1". If not
# configuring from CTest this should be empty, so set the result to a
# literal "0" (helps with numerical comparisons).
SET(VTK_TEST_FROM_CTEST "$ENV{DASHBOARD_TEST_FROM_CTEST}")
IF(NOT VTK_TEST_FROM_CTEST)
SET(VTK_TEST_FROM_CTEST 0)
ENDIF(NOT VTK_TEST_FROM_CTEST)
# Determine whether tests requiring the configuration type to be known
# can be run. Start by assuming the configuration type is known.
# This is the case when using a generator supporting only one
# configuration type.
SET(VTK_TEST_CONFIG_TYPE_KNOWN 1)
IF(CMAKE_CONFIGURATION_TYPES)
# When there are multiple configuration types we must be running
# tests with a CTest that knows how to give the configuration type
# to the test when it runs. This requires CTest 2.2 or higher.
IF(VTK_TEST_FROM_CTEST LESS "2.2")
# This is either a CTest older than 2.2 or not a CTest.
# The configuration type will not be known when running the tests.
SET(VTK_TEST_CONFIG_TYPE_KNOWN 0)
ENDIF(VTK_TEST_FROM_CTEST LESS "2.2")
ENDIF(CMAKE_CONFIGURATION_TYPES)
#-----------------------------------------------------------------------------
# Load some macros.
INCLUDE(vtkDependentOption)
INCLUDE(vtkThirdParty)
INCLUDE(vtkExportKit)
INCLUDE(vtkMakeInstantiator)
INCLUDE(CMakeExportBuildSettings)
#-----------------------------------------------------------------------------
# Choose static or shared libraries.
INCLUDE(vtkSelectSharedLibraries)
#-----------------------------------------------------------------------------
# Does VTK require support for 64 bit file systems
INCLUDE(CheckCXXSourceRuns)
FILE(READ "${VTK_CMAKE_DIR}/vtkRequireLargeFilesSupport.cxx"
VTK_REQUIRE_LARGE_FILE_SUPPORT_FILE)
CHECK_CXX_SOURCE_RUNS("${VTK_REQUIRE_LARGE_FILE_SUPPORT_FILE}"
CMAKE_REQUIRE_LARGE_FILE_SUPPORT "Support for 64 bit file systems")
SET(VTK_REQUIRE_LARGE_FILE_SUPPORT ${CMAKE_REQUIRE_LARGE_FILE_SUPPORT})
#-----------------------------------------------------------------------------
# Does the const_reverse_iterator have the comparison operators? Before GCC
# 4.1 they were not present.
INCLUDE(CheckCXXSourceCompiles)
SET(VTK_CONST_REVERSE_ITERATOR_COMPARISON_FILE
"#include <vector>
int main()
{
std::vector<int> test;
std::vector<int>::const_reverse_iterator it = test.rbegin();
it != test.rend();
return 0;
}")
CHECK_CXX_SOURCE_COMPILES("${VTK_CONST_REVERSE_ITERATOR_COMPARISON_FILE}"
VTK_CONST_REVERSE_ITERATOR_COMPARISON)
#-----------------------------------------------------------------------------
# Discover the name of the runtime library path environment variable
# and put the result in SHARED_LIBRARY_PATH_VAR_NAME.
# The result depends on the platform and on some platforms it depends on
# the compiler options (32-bit vs. 64-bit).
INCLUDE(SharedLibraryPathVarName)
#-----------------------------------------------------------------------------
# Output directories.
IF(NOT LIBRARY_OUTPUT_PATH)
SET(LIBRARY_OUTPUT_PATH ${VTK_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 ${VTK_BINARY_DIR}/bin CACHE INTERNAL "Single output directory for building all executables.")
ENDIF(NOT EXECUTABLE_OUTPUT_PATH)
#-----------------------------------------------------------------------------
# Directories with the configuration subdir, for advanced use only.
# These are only used when passing arguments to custom commands,
# or when writing config files for use by external projects.
# In other circumstances, the build system will handle the config
# subdirectory automatically.
IF("${CMAKE_CFG_INTDIR}" STREQUAL ".")
SET(VTK_LIBRARY_DIR ${LIBRARY_OUTPUT_PATH})
SET(VTK_EXECUTABLE_DIR ${EXECUTABLE_OUTPUT_PATH})
ELSE("${CMAKE_CFG_INTDIR}" STREQUAL ".")
SET(VTK_LIBRARY_DIR ${LIBRARY_OUTPUT_PATH}/${CMAKE_CFG_INTDIR})
SET(VTK_EXECUTABLE_DIR ${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR})
ENDIF("${CMAKE_CFG_INTDIR}" STREQUAL ".")
#-----------------------------------------------------------------------------
# Where the cxx tests are, for use in ADD_TEST
SET(CXX_TEST_PATH ${EXECUTABLE_OUTPUT_PATH})
IF(CMAKE_CONFIGURATION_TYPES)
SET(CXX_TEST_CONFIG /\${CTEST_CONFIGURATION_TYPE})
ELSE()
SET(CXX_TEST_CONFIG "")
ENDIF()
#-----------------------------------------------------------------------------
# Configure install locations. This allows parent projects to modify
# the install location. Optionally allow the project to specify a
# single VTK_INSTALL_ROOT which basically adds to its install prefix
# for VTK only.
# The location in which to install VTK executables.
IF(NOT VTK_INSTALL_BIN_DIR)
SET(VTK_INSTALL_BIN_DIR ${VTK_INSTALL_ROOT}/bin)
ENDIF(NOT VTK_INSTALL_BIN_DIR)
# The location in which to install VTK header files.
IF(NOT VTK_INSTALL_INCLUDE_DIR)
SET(VTK_INSTALL_INCLUDE_DIR
${VTK_INSTALL_ROOT}/include/vtk-${VTK_MAJOR_VERSION}.${VTK_MINOR_VERSION}
)
ENDIF(NOT VTK_INSTALL_INCLUDE_DIR)
# The location in which to install VTK libraries.
IF(NOT VTK_INSTALL_LIB_DIR)
SET(VTK_INSTALL_LIB_DIR
${VTK_INSTALL_ROOT}/lib/vtk-${VTK_MAJOR_VERSION}.${VTK_MINOR_VERSION}
)
ENDIF(NOT VTK_INSTALL_LIB_DIR)
# The location in which to install misc VTK files
IF(NOT VTK_INSTALL_SHARE_DIR)
SET(VTK_INSTALL_SHARE_DIR
${VTK_INSTALL_ROOT}/share/vtk-${VTK_MAJOR_VERSION}.${VTK_MINOR_VERSION}
)
ENDIF(NOT VTK_INSTALL_SHARE_DIR)
# The location in which to install CMake scripts for packaging VTK.
IF(NOT VTK_INSTALL_PACKAGE_DIR)
SET(VTK_INSTALL_PACKAGE_DIR ${VTK_INSTALL_LIB_DIR})
ENDIF(NOT VTK_INSTALL_PACKAGE_DIR)
# The location in which to install VTK doxygen documentation helper
# files.
IF(NOT VTK_INSTALL_DOXYGEN_DIR)
SET(VTK_INSTALL_DOXYGEN_DIR ${VTK_INSTALL_PACKAGE_DIR}/doxygen)
ENDIF(NOT VTK_INSTALL_DOXYGEN_DIR)
# The location in which to install VTK documentation files that
# are not automatically generated.
IF(NOT VTK_INSTALL_DOC_DIR)
SET(VTK_INSTALL_DOC_DIR ${VTK_INSTALL_PACKAGE_DIR}/doc)
ENDIF(NOT VTK_INSTALL_DOC_DIR)
# Compute the proper location for installing the Tcl package. This
# must be a fixed relative path below the library install location and
# is therefore not settable by parent projects.
SET(VTK_INSTALL_TCL_DIR ${VTK_INSTALL_LIB_DIR})
IF(NOT VTK_INSTALL_JAVA_DIR)
SET(VTK_INSTALL_JAVA_DIR ${VTK_INSTALL_PACKAGE_DIR}/java)
ENDIF(NOT VTK_INSTALL_JAVA_DIR)
OPTION(VTK_INSTALL_THIRD_PARTY_LIBRARIES "Use fixup bundle to install vtk and vtkpython dependencies." OFF)
MARK_AS_ADVANCED(VTK_INSTALL_THIRD_PARTY_LIBRARIES)
# There are three basic components to the VTK installation: runtime,
# development, and documentation. Install rules for each component
# are surrounded by blockers. Parent projects or users can specify
# VTK_INSTALL_NO_RUNTIME, VTK_INSTALL_NO_DEVELOPMENT, or
# VTK_INSTALL_NO_DOCUMENTATION to avoid installation of the
# corresponding component.
# Shared libraries are considered both runtime and development and
# static libraries are considered development only. In order to
# switch library installation on and off correctly we make the
# decision here.
SET(VTK_INSTALL_NO_LIBRARIES)
IF(BUILD_SHARED_LIBS)
IF(VTK_INSTALL_NO_RUNTIME AND VTK_INSTALL_NO_DEVELOPMENT)
SET(VTK_INSTALL_NO_LIBRARIES ON)
ENDIF(VTK_INSTALL_NO_RUNTIME AND VTK_INSTALL_NO_DEVELOPMENT)
ELSE(BUILD_SHARED_LIBS)
IF(VTK_INSTALL_NO_DEVELOPMENT)
SET(VTK_INSTALL_NO_LIBRARIES ON)
ENDIF(VTK_INSTALL_NO_DEVELOPMENT)
ENDIF(BUILD_SHARED_LIBS)
# Because INSTALL_* commands require a leading / and because INSTALL (cmake 2.4
# and newer) requires no leading / to install under INSTALL_PREFIX, we
# are stripping the leading /. In the future, there should be no leading
# / in any install directory variables
STRING(REGEX REPLACE "^/" "" VTK_INSTALL_LIB_DIR_CM24 "${VTK_INSTALL_LIB_DIR}")
STRING(REGEX REPLACE "^/" "" VTK_INSTALL_BIN_DIR_CM24 "${VTK_INSTALL_BIN_DIR}")
STRING(REGEX REPLACE "^/" "" VTK_INSTALL_SHARE_DIR_CM24 "${VTK_INSTALL_SHARE_DIR}")
STRING(REGEX REPLACE "^/" "" VTK_INSTALL_INCLUDE_DIR_CM24 "${VTK_INSTALL_INCLUDE_DIR}")
STRING(REGEX REPLACE "^/" "" VTK_INSTALL_PACKAGE_DIR_CM24 "${VTK_INSTALL_PACKAGE_DIR}")
STRING(REGEX REPLACE "^/" "" VTK_INSTALL_DOXYGEN_DIR_CM24 "${VTK_INSTALL_DOXYGEN_DIR}")
STRING(REGEX REPLACE "^/" "" VTK_INSTALL_DOC_DIR_CM24 "${VTK_INSTALL_DOC_DIR}")
STRING(REGEX REPLACE "^/" "" VTK_INSTALL_TCL_DIR_CM24 "${VTK_INSTALL_TCL_DIR}")
STRING(REGEX REPLACE "^/" "" VTK_INSTALL_JAVA_DIR_CM24 "${VTK_INSTALL_JAVA_DIR}")
#-----------------------------------------------------------------------------
# Provide option to build executables as forwarding executables where by a launcher that
# sets the appropriate environment is installed in /bin/ which then 'launches' the 'real'
# executable under lib.
if(UNIX)
OPTION(VTK_BUILD_FORWARDING_EXECUTABLES "Build forwarding executables for vtk, vtkpython, etc." OFF)
INCLUDE(vtkForwardingExecutable)
MARK_AS_ADVANCED(VTK_BUILD_FORWARDING_EXECUTABLES)
endif()
#-----------------------------------------------------------------------------
# Save the compiler settings so another project can import them.
CMAKE_EXPORT_BUILD_SETTINGS(${VTK_BINARY_DIR}/VTKBuildSettings.cmake)
IF(NOT VTK_INSTALL_NO_DEVELOPMENT)
INSTALL(FILES "${VTK_BINARY_DIR}/VTKBuildSettings.cmake"
DESTINATION ${VTK_INSTALL_PACKAGE_DIR_CM24}
COMPONENT Development)
ENDIF(NOT VTK_INSTALL_NO_DEVELOPMENT)
#-----------------------------------------------------------------------------
# Provide compatibility options.
OPTION(VTK_LEGACY_REMOVE "Remove all legacy code completely." OFF)
OPTION(VTK_LEGACY_SILENT "Silence all legacy code messages." OFF)
MARK_AS_ADVANCED(VTK_LEGACY_REMOVE VTK_LEGACY_SILENT)
#-----------------------------------------------------------------------------
OPTION(VTK_USE_METAIO "Build metaio" ON)
MARK_AS_ADVANCED(VTK_USE_METAIO)
# Determine the set of VTK kits that should be built.
OPTION(VTK_USE_RENDERING "Build the vtkRendering kit. Needed for displaying data or using widgets." ON)
OPTION(VTK_USE_INFOVIS "Build the vtkInfovis kit. Needed for performing information visualization." ON)
OPTION(VTK_USE_TEXT_ANALYSIS "Build the vtkTextAnalysis kit. Needed for performing text analysis." OFF)
VTK_DEPENDENT_OPTION(VTK_USE_PARALLEL "Build the vtkParallel kit." OFF "" OFF)
VTK_DEPENDENT_OPTION(VTK_USE_VIEWS "Build the vtkViews kit. Needed for creating packaged and linked views." ON
"VTK_USE_RENDERING;VTK_USE_INFOVIS" OFF)
VTK_DEPENDENT_OPTION(VTK_USE_GEOVIS "Build the vtkGeovis kit. Needed for performing geographic visualization." ON
"VTK_USE_VIEWS" OFF)
OPTION(VTK_USE_N_WAY_ARRAYS "Add support for arbitrary-dimension sparse and dense arrays." ON)
# Determine Shading Support
VTK_DEPENDENT_OPTION(VTK_USE_CG_SHADERS "Build pixel and vertex shader support for Cg." OFF
"VTK_USE_RENDERING" OFF)
VTK_DEPENDENT_OPTION(VTK_USE_GLSL_SHADERS "Build pixel and vertex shader support for GLSL." ON
"VTK_USE_RENDERING" OFF)
VTK_DEPENDENT_OPTION(VTK_USE_CHARTS "Build VTK chart support (OpenGL based)" ON
"VTK_USE_RENDERING;VTK_USE_VIEWS" OFF)
VTK_DEPENDENT_OPTION(VTK_USE_CHEMISTRY "Build VTK chemistry support" OFF
"VTK_USE_RENDERING" OFF)
SET(VTK_DEFAULT_SHADERS_DIR
"${VTK_BINARY_DIR}/Utilities/MaterialLibrary/Repository"
CACHE INTERNAL
"The directory in which code for Shaders is provided.")
SET(VTK_MATERIALS_DIRS
${VTK_DEFAULT_SHADERS_DIR}
CACHE STRING
"; separated directories to search for materials/shaders")
MARK_AS_ADVANCED(VTK_USE_CG_SHADERS VTK_USE_GLSL_SHADERS VTK_MATERIALS_DIRS)
# Add Option to enable Qt Support.
OPTION(VTK_USE_QT "Build Qt support" OFF)
IF(VTK_USE_QT)
# Now require Qt 4.5.0 or later
SET(QT_MIN_VERSION "4.5.0")
SET(QT_OFFICIAL_VERSION "4.5")
SET(QT_REQUIRED TRUE)
SET(QT_USE_QTSQL 1)
FIND_PACKAGE(Qt4)
IF(NOT QT4_FOUND)
MESSAGE(SEND_ERROR "Qt ${QT_MIN_VERSION} or greater not found. Please check the QT_QMAKE_EXECUTABLE variable.")
ELSE(NOT QT4 FOUND)
# enforce Carbon or Cocoa in VTK for Qt/Mac if we are not building with X11 explicitly turned on
IF(Q_WS_MAC AND NOT VTK_USE_X)
IF(QT_MAC_USE_COCOA)
SET(VTK_USE_CARBON OFF CACHE BOOL "Build VTK with Carbon" FORCE)
SET(VTK_USE_COCOA ON CACHE BOOL "Build VTK with Cocoa" FORCE)
ELSE(QT_MAC_USE_COCOA)
SET(VTK_USE_CARBON ON CACHE BOOL "Build VTK with Carbon" FORCE)
SET(VTK_USE_COCOA OFF CACHE BOOL "Build VTK with Cocoa" FORCE)
ENDIF(QT_MAC_USE_COCOA)
ENDIF(Q_WS_MAC AND NOT VTK_USE_X)
ENDIF(NOT QT4_FOUND)
ENDIF(VTK_USE_QT)
# Determine GUI Support.
VTK_DEPENDENT_OPTION(VTK_USE_GUISUPPORT "Build VTK with GUI Support" OFF
"VTK_USE_RENDERING" OFF)
MARK_AS_ADVANCED(VTK_USE_GUISUPPORT)
IF(VTK_USE_QT AND VTK_USE_RENDERING)
SET(VTK_USE_GUISUPPORT 1 CACHE BOOL "Build VTK with GUI Support" FORCE)
ENDIF()
# Determing Qt GUI. This is no longer a user settable option. It's value depends
# on whether VTK_USE_GUISUPPORT and VTK_USE_RENDERING and VTK_USE_QT are all
# set to ON.
IF (VTK_USE_QT AND VTK_USE_GUISUPPORT AND VTK_USE_RENDERING)
SET (VTK_USE_QVTK ON CACHE INTERNAL "Build QVTK widget and plugin for Qt" FORCE)
ELSE (VTK_USE_QT AND VTK_USE_GUISUPPORT AND VTK_USE_RENDERING)
SET (VTK_USE_QVTK OFF CACHE INTERNAL "Build QVTK widget and plugin for Qt" FORCE)
ENDIF (VTK_USE_QT AND VTK_USE_GUISUPPORT AND VTK_USE_RENDERING)
# Remove old options from an existing cache.
IF(NOT "VTK_USE_HYBRID" MATCHES "^VTK_USE_HYBRID$")
SET(VTK_USE_HYBRID "" CACHE INTERNAL "Hiding old option")
ENDIF(NOT "VTK_USE_HYBRID" MATCHES "^VTK_USE_HYBRID$")
IF(NOT "VTK_USE_PATENTED" MATCHES "^VTK_USE_PATENTED$")
SET(VTK_USE_PATENTED "" CACHE INTERNAL "Hiding old option")
ENDIF(NOT "VTK_USE_PATENTED" MATCHES "^VTK_USE_PATENTED$")
IF(NOT "VTK_USE_VOLUMERENDERING" MATCHES "^VTK_USE_VOLUMERENDERING$")
SET(VTK_USE_VOLUMERENDERING "" CACHE INTERNAL "Hiding old option")
ENDIF(NOT "VTK_USE_VOLUMERENDERING" MATCHES "^VTK_USE_VOLUMERENDERING$")
SET(VTK_KITS COMMON FILTERING IO GRAPHICS GENERIC_FILTERING IMAGING)
# Include Rendering in module path to find vtkTestingObjectFactory
IF(VTK_USE_RENDERING)
SET(CMAKE_MODULE_PATH "${VTK_SOURCE_DIR}/Rendering/" ${CMAKE_MODULE_PATH})
ENDIF()
IF(VTK_USE_RENDERING)
SET(VTK_KITS ${VTK_KITS} RENDERING)
SET(VTK_KITS ${VTK_KITS} VOLUMERENDERING)
SET(VTK_KITS ${VTK_KITS} HYBRID)
SET(VTK_KITS ${VTK_KITS} WIDGETS)
ENDIF(VTK_USE_RENDERING)
IF(VTK_USE_PARALLEL)
SET(VTK_KITS ${VTK_KITS} PARALLEL)
ENDIF(VTK_USE_PARALLEL)
IF(VTK_USE_INFOVIS)
SET(VTK_KITS ${VTK_KITS} INFOVIS)
ENDIF(VTK_USE_INFOVIS)
IF(VTK_USE_TEXT_ANALYSIS)
SET(VTK_KITS ${VTK_KITS} TEXT_ANALYSIS)
ENDIF(VTK_USE_TEXT_ANALYSIS)
IF(VTK_USE_GEOVIS)
SET(VTK_KITS ${VTK_KITS} GEOVIS)
ENDIF(VTK_USE_GEOVIS)
IF(VTK_USE_VIEWS)
SET(VTK_KITS ${VTK_KITS} VIEWS)
ENDIF(VTK_USE_VIEWS)
# from GUISupport
IF(VTK_USE_QVTK)
SET(VTK_KITS ${VTK_KITS} QVTK)
ENDIF(VTK_USE_QVTK)
IF(VTK_USE_MFC)
SET(VTK_KITS ${VTK_KITS} MFC)
ENDIF(VTK_USE_MFC)
IF(VTK_USE_CHARTS)
SET(VTK_KITS ${VTK_KITS} CHARTS)
ENDIF(VTK_USE_CHARTS)
IF(VTK_USE_CHEMISTRY)
SET(VTK_KITS ${VTK_KITS} CHEMISTRY)
ENDIF(VTK_USE_CHEMISTRY)
#-----------------------------------------------------------------------------
# Determine GUI.
IF (NOT VTK_DONT_INCLUDE_USE_X)
# We moved VTK_USE_X option code into a separate file so that
# projects including VTK can include this cmake script and use
# the option themselves, in which case, they set the VTK_DONT_INCLUDE_USE_X
# variable to ensure that VTK doesn't set up the option again.
INCLUDE(vtkUseX)
ENDIF (NOT VTK_DONT_INCLUDE_USE_X)
VTK_DEPENDENT_OPTION(VTK_USE_CARBON "Build classes using Carbon API." OFF
"APPLE;VTK_USE_RENDERING" OFF)
VTK_DEPENDENT_OPTION(VTK_USE_COCOA "Build classes using Cocoa API." ON
"APPLE;VTK_USE_RENDERING" OFF)
IF(VTK_USE_CARBON AND VTK_USE_COCOA)
MESSAGE(SEND_ERROR "Only one of VTK_USE_CARBON and VTK_USE_COCOA may be ON.")
# Since Cocoa is the default, assume user wants to switch to Carbon
SET(VTK_USE_COCOA OFF)
ENDIF(VTK_USE_CARBON AND VTK_USE_COCOA)
#-----------------------------------------------------------------------------
# Determine whether to use the experimental Ogg/Theora writer.
OPTION(VTK_USE_OGGTHEORA_ENCODER "Build experimental Ogg/Theora support" OFF)
MARK_AS_ADVANCED(VTK_USE_OGGTHEORA_ENCODER)
#-----------------------------------------------------------------------------
# VTK requires special compiler flags on some platforms.
INCLUDE(vtkDetermineCompilerFlags)
# Tell VTK source files they are being built inside VTK.
ADD_DEFINITIONS(-DVTK_IN_VTK)
#-----------------------------------------------------------------------------
# Platform configuration tests.
INCLUDE(CMakeBackwardCompatibilityC)
INCLUDE(TestForANSIStreamHeaders)
INCLUDE(TestForSTDNamespace)
INCLUDE(TestForANSIForScope)
INCLUDE(CheckTypeSize)
# Simulate old CMakeBackwardCompatibilityCXX test.
INCLUDE(TestForSSTREAM)
# Tests for various integer, bool and float types
INCLUDE(vtkTestTypes)
# Socket tests etc.
INCLUDE(Parallel/VTKParallelCMakeTests.cmake)
# Check for full template specialization support by compiler.
INCLUDE(vtkTestFullSpecialization)
# Check for explicit template instantiation support by compiler.
INCLUDE(vtkTestExplicitInstantiation)
# Test for atomics and other compiler intrinsics
INCLUDE(vtkTestBuiltins)
# Setup clean configuration of vtkConfigure.h and vtkToolkits.h.
MACRO(VTK_PREPARE_CMAKEDEFINE not invar outvar)
IF(${not} ${invar})
SET(${outvar} 1)
ELSE(${not} ${invar})
SET(${outvar})
ENDIF(${not} ${invar})
ENDMACRO(VTK_PREPARE_CMAKEDEFINE)
VTK_PREPARE_CMAKEDEFINE("" CMAKE_WORDS_BIGENDIAN VTK_WORDS_BIGENDIAN)
VTK_PREPARE_CMAKEDEFINE("" CMAKE_USE_PTHREADS VTK_USE_PTHREADS)
VTK_PREPARE_CMAKEDEFINE("" CMAKE_USE_SPROC VTK_USE_SPROC)
VTK_PREPARE_CMAKEDEFINE("" CMAKE_HP_PTHREADS VTK_HP_PTHREADS)
VTK_PREPARE_CMAKEDEFINE("" CMAKE_USE_WIN32_THREADS VTK_USE_WIN32_THREADS)
VTK_PREPARE_CMAKEDEFINE("" CMAKE_NO_ANSI_STRING_STREAM VTK_NO_ANSI_STRING_STREAM)
VTK_PREPARE_CMAKEDEFINE("" CMAKE_NO_STD_NAMESPACE VTK_NO_STD_NAMESPACE)
VTK_PREPARE_CMAKEDEFINE(NOT CMAKE_ANSI_FOR_SCOPE VTK_NO_FOR_SCOPE)
VTK_PREPARE_CMAKEDEFINE(NOT VTK_EXPLICIT_TEMPLATES
VTK_NO_EXPLICIT_TEMPLATE_INSTANTIATION)
VTK_PREPARE_CMAKEDEFINE(NOT VTK_COMPILER_HAS_FULL_SPECIALIZATION
VTK_NO_FULL_TEMPLATE_SPECIALIZATION)
#-----------------------------------------------------------------------------
# Include file dependency tracking regular expression.
SET(VTK_REGEX "vtk[^.]*\\.([^t]|t[^x]|tx[^x]|cxx|hxx)")
IF(VTK_NO_EXPLICIT_TEMPLATE_INSTANTIATION)
# Track all .txx file dependencies.
SET(VTK_REGEX_TXX "vtk[^.]*\\.txx")
ELSE(VTK_NO_EXPLICIT_TEMPLATE_INSTANTIATION)
# Track all .txx file dependencies except *Implicit.txx files.
SET(VTK_REGEX_TXX "vtk[^.]*([^t]|[^i]t|[^c]it|[^i]cit|[^l]icit|[^p]licit|[^m]plicit|[^I]mplicit)\\.txx")
ENDIF(VTK_NO_EXPLICIT_TEMPLATE_INSTANTIATION)
INCLUDE_REGULAR_EXPRESSION("(^|/)((lex|png|j|z|t|D|Q|verdict).*|${VTK_REGEX}|${VTK_REGEX_TXX})$")
#-----------------------------------------------------------------------------
# Determine the set of language wrappers that should be built.
OPTION(VTK_WRAP_TCL "Wrap VTK classes into the TCL language." OFF)
OPTION(VTK_WRAP_PYTHON "Wrap VTK classes into the Python language." OFF)
OPTION(VTK_WRAP_JAVA "Wrap VTK classes into the Java language." OFF)
OPTION(VTK_WRAP_PYTHON_SIP "Make python wrapped classes available to SIP/PyQt." OFF)
IF(VTK_WRAP_PYTHON_SIP)
FIND_PROGRAM(SIP_EXECUTABLE NAMES sip DOC "Path to sip executable")
FIND_PATH(SIP_INCLUDE_DIR NAMES sip.h
PATHS "${PYTHON_INCLUDE_PATH}" "${PYTHON_INCLUDE_PATH}/../Lib/site-packages/PyQt4/include")
ENDIF(VTK_WRAP_PYTHON_SIP)
# Python requires shared libraries.
IF(VTK_WRAP_PYTHON AND VTK_TARGET_SUPPORTS_SHARED_LIBS AND NOT BUILD_SHARED_LIBS )
MESSAGE(SEND_ERROR "VTK_WRAP_PYTHON requires BUILD_SHARED_LIBS to be ON.")
SET(VTK_WRAP_PYTHON 0)
ENDIF(VTK_WRAP_PYTHON AND VTK_TARGET_SUPPORTS_SHARED_LIBS AND NOT BUILD_SHARED_LIBS )
# Java requires shared libraries on Windows.
IF(VTK_WRAP_JAVA AND WIN32 AND NOT BUILD_SHARED_LIBS)
MESSAGE(SEND_ERROR "VTK_WRAP_JAVA requires BUILD_SHARED_LIBS to be ON.")
SET(VTK_WRAP_JAVA 0)
ENDIF(VTK_WRAP_JAVA AND WIN32 AND NOT BUILD_SHARED_LIBS)
SET(VTK_LANGUAGES "")
IF(VTK_WRAP_TCL)
SET(VTK_LANGUAGES ${VTK_LANGUAGES} TCL)
ENDIF(VTK_WRAP_TCL)
IF(VTK_WRAP_PYTHON)
SET(VTK_LANGUAGES ${VTK_LANGUAGES} PYTHON)
ENDIF(VTK_WRAP_PYTHON)
IF(VTK_WRAP_JAVA)
SET(VTK_LANGUAGES ${VTK_LANGUAGES} JAVA)
ENDIF(VTK_WRAP_JAVA)
#-----------------------------------------------------------------------------
# Configure testing support.
INCLUDE(CTest)
MARK_AS_ADVANCED(DART_ROOT TCL_TCLSH CVSCOMMAND CVS_UPDATE_OPTIONS DART_TESTING_TIMEOUT)
IF(BUILD_TESTING)
ENABLE_TESTING()
ENDIF(BUILD_TESTING)
CONFIGURE_FILE(${VTK_CMAKE_DIR}/CTestCustom.ctest.in
${VTK_BINARY_DIR}/CMake/CTestCustom.ctest @ONLY)
FILE(WRITE ${VTK_BINARY_DIR}/CTestCustom.cmake
"INCLUDE(\"${VTK_BINARY_DIR}/CMake/CTestCustom.ctest\")\n")
OPTION(VTK_USE_DISPLAY "Turn this option off and tests and warning/error macros will not popup windows" ON)
MARK_AS_ADVANCED(VTK_USE_DISPLAY)
#------------------------------------------------------------------------------
# Options for C++ test driver
# locale
OPTION(VTK_TESTING_USE_LOCALE "VTK c++ tests will start with specified locale." OFF)
MARK_AS_ADVANCED(VTK_TESTING_USE_LOCALE)
SET(VTK_TESTING_LOCALE "" CACHE STRING "Locale for VTK C++ tests. Example fr_FR.utf8, empty string for env variable.")
MARK_AS_ADVANCED(VTK_TESTING_LOCALE)
# Leave this option ON by default. It helps to catch floating point math
# exceptions early on nightly dashboard runs.
#
OPTION(VTK_TESTING_USE_FPE "VTK tests call vtkFloatingPointExceptions::Enable()" ON)
MARK_AS_ADVANCED(VTK_TESTING_USE_FPE)
SET(CMAKE_TESTDRIVER_BEFORE_TESTMAIN)
IF(VTK_TESTING_USE_LOCALE)
SET(CMAKE_TESTDRIVER_BEFORE_TESTMAIN "${CMAKE_TESTDRIVER_BEFORE_TESTMAIN}
setlocale(LC_ALL,\"${VTK_TESTING_LOCALE}\");
std::locale::global(std::locale(\"${VTK_TESTING_LOCALE}\"));")
ENDIF(VTK_TESTING_USE_LOCALE)
IF(VTK_TESTING_USE_FPE)
SET(CMAKE_TESTDRIVER_BEFORE_TESTMAIN "${CMAKE_TESTDRIVER_BEFORE_TESTMAIN}
vtkFloatingPointExceptions::Enable();\n")
ENDIF(VTK_TESTING_USE_FPE)
SET(CMAKE_TESTDRIVER_BEFORE_TESTMAIN "${CMAKE_TESTDRIVER_BEFORE_TESTMAIN}
try {")
SET(CMAKE_TESTDRIVER_AFTER_TESTMAIN " }
catch(std::exception& e)
{
fprintf(stderr, \"Test driver caught exception: [%s]\\n\", e.what());
result = -1;
}")
#-----------------------------------------------------------------------------
# Select a streams library.
INCLUDE(vtkSelectStreamsLibrary)
VTK_SELECT_STREAMS_LIBRARY(VTK_USE_ANSI_STDLIB ${VTK_SOURCE_DIR})
# Check the severity of EOF bugs in the streams library.
# this must be after the test for the long types
INCLUDE(vtkTestStreamsLibrary)
IF(VTK_USE_RENDERING AND WIN32)
# Check for vfw32 support
INCLUDE(vtkTestVideoForWindows)
ENDIF(VTK_USE_RENDERING AND WIN32)
#-----------------------------------------------------------------------------
# Configure KWSys to be named "vtksys".
SET(KWSYS_NAMESPACE vtksys)
SET(KWSYS_USE_Base64 1)
SET(KWSYS_USE_CommandLineArguments 1)
SET(KWSYS_USE_DynamicLoader 1)
SET(KWSYS_USE_Process 1)
SET(KWSYS_USE_RegularExpression 1)
SET(KWSYS_USE_SystemTools 1)
SET(KWSYS_USE_SystemInformation 1)
SET(KWSYS_USE_FundamentalType 1)
SET(KWSYS_USE_MD5 1)
SET(KWSYS_USE_Glob 1)
SET(KWSYS_USE_DateStamp 1)
SET(KWSYS_HEADER_ROOT ${VTK_BINARY_DIR}/Utilities)
SET(KWSYS_PROPERTIES_CXX ${VTK_LIBRARY_PROPERTIES})
SET(KWSYS_INSTALL_EXPORT_NAME ${VTK_INSTALL_EXPORT_NAME})
IF(NOT VTK_USE_ANSI_STDLIB)
SET(KWSYS_IOS_FORCE_OLD 1)
ENDIF(NOT VTK_USE_ANSI_STDLIB)
IF(NOT VTK_INSTALL_NO_LIBRARIES)
SET(KWSYS_LIBRARY_INSTALL_DIR ${VTK_INSTALL_LIB_DIR})
SET(KWSYS_INSTALL_BIN_DIR ${VTK_INSTALL_BIN_DIR_CM24})
SET(KWSYS_INSTALL_LIB_DIR ${VTK_INSTALL_LIB_DIR_CM24})
SET(KWSYS_INSTALL_COMPONENT_NAME_RUNTIME RuntimeLibraries)
ENDIF(NOT VTK_INSTALL_NO_LIBRARIES)
IF(NOT VTK_INSTALL_NO_DEVELOPMENT)
SET(KWSYS_INSTALL_INCLUDE_DIR ${VTK_INSTALL_INCLUDE_DIR_CM24})
SET(KWSYS_INSTALL_COMPONENT_NAME_DEVELOPMENT Development)
ENDIF(NOT VTK_INSTALL_NO_DEVELOPMENT)
#-----------------------------------------------------------------------------
# Dispatch the build into the proper subdirectories.
SET(VTK_HAS_EXODUS 1)
#-----------------------------------------------------------------------------
# Provide a few configuration options.
OPTION(BUILD_EXAMPLES "Build VTK examples." OFF)
IF("${CMAKE_SIZEOF_VOID_P}" GREATER 4)
SET(VTK_USE_64BIT_IDS_DEFAULT ON)
ELSE("${CMAKE_SIZEOF_VOID_P}" GREATER 4)
SET(VTK_USE_64BIT_IDS_DEFAULT OFF)
ENDIF("${CMAKE_SIZEOF_VOID_P}" GREATER 4)
OPTION(VTK_USE_64BIT_IDS "Build VTK with 64 bit ids"
${VTK_USE_64BIT_IDS_DEFAULT})
OPTION(VTK_DEBUG_LEAKS "Build leak checking support into VTK." OFF)
MARK_AS_ADVANCED(VTK_DEBUG_LEAKS VTK_USE_64BIT_IDS)
VTK_DEPENDENT_OPTION(VTK_USE_MANGLED_MESA "Use mangled Mesa with OpenGL." OFF
"VTK_USE_RENDERING" OFF)
VTK_DEPENDENT_OPTION(VTK_OPENGL_HAS_OSMESA
"The opengl library being used supports off screen Mesa calls." OFF
"VTK_USE_RENDERING;UNIX" OFF)
# Off-Screen MESA cannot be used with Mangled MESA.
IF(VTK_OPENGL_HAS_OSMESA AND VTK_USE_MANGLED_MESA)
MESSAGE(FATAL_ERROR
"Off-Screen MESA cannot be used with Mangled MESA. Turn off either "
"VTK_OPENGL_HAS_OSMESA or VTK_USE_MANGLED_MESA.")
ENDIF(VTK_OPENGL_HAS_OSMESA AND VTK_USE_MANGLED_MESA)
SET(VTK_CAN_DO_OFF_SCREEN)
IF(VTK_USE_MANGLED_MESA OR VTK_OPENGL_HAS_OSMESA OR WIN32)
SET(VTK_CAN_DO_OFF_SCREEN 1)
ENDIF(VTK_USE_MANGLED_MESA OR VTK_OPENGL_HAS_OSMESA OR WIN32)
VTK_DEPENDENT_OPTION(VTK_USE_OFFSCREEN
"Use off screen calls by default." OFF
"VTK_CAN_DO_OFF_SCREEN" OFF)
VTK_DEPENDENT_OPTION(VTK_USE_MPI
"Use Message Passing Interface (MPI) library for parallel support." OFF
"VTK_USE_PARALLEL" OFF)
VTK_DEPENDENT_OPTION(VTK_USE_MATROX_IMAGING
"Use Matrox Imaging Library for video input." OFF
"VTK_USE_RENDERING;WIN32" OFF)
VTK_DEPENDENT_OPTION(VTK_USE_GL2PS "Build VTK with gl2ps support." OFF
"VTK_USE_RENDERING" ON)
VTK_DEPENDENT_OPTION(VTK_USE_PARALLEL_BGL
"Use the Parallel Boost Graph Library"
OFF
"VTK_USE_BOOST;VTK_USE_MPI;VTK_USE_PARALLEL;VTK_USE_64BIT_IDS"
OFF)
SET(VTK_CAN_USE_TK OFF)
SET(VTK_USE_TK_DEFAULT ON)
IF(VTK_WRAP_PYTHON OR VTK_WRAP_TCL)
IF(NOT VTK_DISABLE_TK_INIT)
SET(VTK_CAN_USE_TK ON)
IF(APPLE)
IF (OSX_SDK_VERSION)
IF (${OSX_SDK_VERSION} VERSION_LESS "10.6")
# Until OS X 10.6, building Tk with Cocoa was not possible
IF (VTK_USE_COCOA)
SET(VTK_CAN_USE_TK OFF)
ENDIF (VTK_USE_COCOA)
ELSE (${OSX_SDK_VERSION} VERSION_LESS "10.6")
# For OS X 10.6, the default system Tk is Cocoa, not Carbon
IF (VTK_USE_CARBON)
SET(VTK_USE_TK_DEFAULT OFF)
ENDIF (VTK_USE_CARBON)
ENDIF (${OSX_SDK_VERSION} VERSION_LESS "10.6")
ENDIF (OSX_SDK_VERSION)
ENDIF(APPLE)
ENDIF(NOT VTK_DISABLE_TK_INIT)
ENDIF(VTK_WRAP_PYTHON OR VTK_WRAP_TCL)
VTK_DEPENDENT_OPTION(VTK_USE_TK "Build VTK with Tk support"
${VTK_USE_TK_DEFAULT} "VTK_CAN_USE_TK" OFF)
MARK_AS_ADVANCED(VTK_OPENGL_HAS_OSMESA
VTK_USE_OFFSCREEN
VTK_USE_TK
VTK_USE_GL2PS
VTK_USE_MANGLED_MESA
VTK_USE_MATROX_IMAGING
VTK_USE_MPI
VTK_USE_PARALLEL_BGL)
#-----------------------------------------------------------------------------
# Provide options to use system versions of third-party libraries.
VTK_THIRD_PARTY_OPTION(ZLIB zlib)
set(HDF5_FIND_COMPONENTS "HL;C")
VTK_THIRD_PARTY_OPTION(HDF5 hdf5)
INCLUDE(vtkHDF5Library)
IF(VTK_USE_GL2PS)
VTK_THIRD_PARTY_OPTION(GL2PS gl2ps)
ENDIF(VTK_USE_GL2PS)
VTK_THIRD_PARTY_OPTION(JPEG jpeg)
VTK_THIRD_PARTY_OPTION(PNG png)
VTK_THIRD_PARTY_OPTION(TIFF tiff)
VTK_THIRD_PARTY_OPTION(EXPAT expat)
VTK_THIRD_PARTY_OPTION(FREETYPE freetype)
VTK_THIRD_PARTY_OPTION(LIBXML2 libxml2)
VTK_THIRD_PARTY_OPTION(LIBPROJ4 proj4)
if(VTK_USE_OGGTHEORA_ENCODER)
VTK_THIRD_PARTY_OPTION(OGGTHEORA oggtheora)
endif(VTK_USE_OGGTHEORA_ENCODER)
#-----------------------------------------------------------------------------
# Configure OpenGL support.
IF(VTK_USE_RENDERING)
# At the moment CMake's FindOpenGL considers OpenGL should be found
# in the framework version on OSX. This is a reasonable assumption for
# few people are going to use X. The module warns that if X is to be
# used, one has to set the libs and include dir manually, which is
# exactly what we are going to do below.
IF(APPLE AND VTK_USE_X)
FIND_PATH(OPENGL_INCLUDE_DIR GL/gl.h
/usr/X11R6/include)
FIND_PATH(OPENGL_xmesa_INCLUDE_DIR GL/xmesa.h
/usr/X11R6/include)
FIND_LIBRARY(OPENGL_gl_LIBRARY NAMES GL MesaGL
PATHS /usr/lib /usr/local/lib /usr/X11R6/lib)
FIND_LIBRARY(OPENGL_glu_LIBRARY NAMES GLU MesaGLU
PATHS ${OPENGL_gl_LIBRARY} /usr/lib /usr/local/lib /usr/X11R6/lib)
ENDIF(APPLE AND VTK_USE_X)
FIND_PACKAGE(OpenGL)
FIND_PACKAGE(DirectX QUIET)
if(DirectX_FOUND)
set(VTK_USE_DIRECTX 1)
endif(DirectX_FOUND)
find_package(ApplicationServices)
find_package(IOKit)
if(ApplicationServices_FOUND AND IOKit_FOUND)
set(VTK_USE_CORE_GRAPHICS 1)
endif(ApplicationServices_FOUND AND IOKit_FOUND)
if(VTK_USE_X)
option(VTK_USE_NVCONTROL "Use NVIDIAs X server extension NVCONTROL." OFF)
if(VTK_USE_NVCONTROL)
find_package(NVCtrlLib REQUIRED)
endif(VTK_USE_NVCONTROL)
mark_as_advanced(VTK_USE_NVCONTROL)
endif(VTK_USE_X)
ENDIF(VTK_USE_RENDERING)
VTK_PREPARE_CMAKEDEFINE("" OPENGL_LIBRARY VTK_USE_OPENGL_LIBRARY)
#-----------------------------------------------------------------------------
# Configure Mangled MESA support.
IF(VTK_USE_MANGLED_MESA)
FIND_PACKAGE(MangledMesa)
IF(MANGLED_MESA_INCLUDE_DIR)
USE_MANGLED_MESA(${MANGLED_MESA_INCLUDE_DIR}/GL
${VTK_BINARY_DIR}/MangleMesaInclude)
ENDIF(MANGLED_MESA_INCLUDE_DIR)
ENDIF(VTK_USE_MANGLED_MESA)
#-----------------------------------------------------------------------------
# Configure Off-Screen MESA support.
# If rendering is enabled, but there is no graphics system enabled, enforce osmesa
IF(VTK_USE_RENDERING AND NOT WIN32 AND NOT APPLE AND NOT VTK_USE_X)
SET(VTK_OPENGL_HAS_OSMESA ON CACHE BOOL "Forced to ON since neither OPEN_gl_LIBRARY nor MangledMesa were found" FORCE)
ENDIF(VTK_USE_RENDERING AND NOT WIN32 AND NOT APPLE AND NOT VTK_USE_X)
IF(VTK_OPENGL_HAS_OSMESA)
FIND_PACKAGE(OSMesa)
ENDIF(VTK_OPENGL_HAS_OSMESA)
#-----------------------------------------------------------------------------
# Configure CG-Shading support.
IF(VTK_USE_CG_SHADERS)
FIND_PACKAGE(Cg)
MARK_AS_ADVANCED(CG_COMPILER CG_INCLUDE_PATH CG_LIBRARY CG_GL_LIBRARY)
ENDIF(VTK_USE_CG_SHADERS)
#-----------------------------------------------------------------------------
# Configure GLSL-Shading support.
# TODO: Should verify that GL2.0 is supported.
#-----------------------------------------------------------------------------
# Configure Matrox Imaging support.
IF(VTK_USE_MATROX_IMAGING)
FIND_LIBRARY(MIL_LIBRARY MIL
"C:/Program Files/Matrox Imaging/mil/library/winnt/msc/dll"
"C:/Program Files/Matrox Imaging/mil/library/windows/msc/dll"
)
FIND_PATH(MIL_INCLUDE_PATH mil.h
"C:/Program Files/Matrox Imaging/mil/include"
)
ENDIF(VTK_USE_MATROX_IMAGING)
IF(VTK_USE_MPI)
FIND_PACKAGE(MPI REQUIRED)
ENDIF(VTK_USE_MPI)
#-----------------------------------------------------------------------------
# Configure MPI testing support.
# FLAGS used and set for MPI testing
# VTK_MPIRUN_EXE - full path to mpirun command
# VTK_MPI_PRENUMPROC_FLAGS - flags used directly before the num. of procs flag
# VTK_MPI_NUMPROC_FLAG - flag that is used to tell this mpirun how many procs to start
# VTK_MPI_PREFLAGS - flags used directly before process to be run by mpirun
# VTK_MPI_POSTFLAGS - flags used after all other flags by mpirun
# So, tests will be run something like this:
# ${VTK_MPIRUN_EXE} ${VTK_MPI_PRENUMPROC_FLAGS} ${VTK_MPI_NUMPROC_FLAG} 2 ${VTK_MPI_PREFLAGS} executable ${VTK_MPI_POSTFLAGS}
#
IF(VTK_USE_MPI)
# Use MPI variables defined in the CMake (2.8) FindMPI module.
IF(${MPIEXEC})
SET(VTK_MPIRUN_EXE ${MPIEXEC} CACHE FILEPATH "" FORCE)
SET(VTK_MPI_PRENUMPROC_FLAGS ${MPIEXEC_PREFLAGS} CACHE STRING "These flags will be directly before the number of processess flag (see ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt for more info.)" FORCE)
IF(NOT ${MPI_NUMPROC_FLAG})
SET(VTK_MPI_NUMPROC_FLAG "-np" CACHE STRING "Flag used by mpi to specify the number of processes, the next option will be the number of processes. (see ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt for more info.)" FORCE)
ELSE(NOT ${MPI_NUMPROC_FLAG})
SET(VTK_MPI_NUMPROC_FLAG ${MPIEXEC_NUMPROC_FLAG} CACHE STRING "Flag used by mpi to specify the number of processes, the next option will be the number of processes. (see ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt for more info.)" FORCE)
ENDIF(NOT ${MPI_NUMPROC_FLAG})
SET(VTK_MPI_PREFLAGS ${MPIEXEC_PREFLAGS} CACHE STRING "These flags will be directly before the executable that is being run by VTK_MPIRUN_EXE. (see ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt for more info.)" FORCE)
SET(VTK_MPI_POSTFLAGS ${MPIEXEC_POSTFLAGS} CACHE STRING "These flags will come after all flags given to MPIRun.(see ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt for more info.)" FORCE)
SET(VTK_MPI_MAX_NUMPROCS ${MPIEXEC_MAX_NUMPROCS} CACHE STRING "Maximum number of processors available to run parallel applications. (see ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt for more info.)" FORCE)
ELSE(${MPIEXEC})
# set to the default hardcoded values. This else can probably be deleted when VTK requires CMake 2.8+.
FIND_PROGRAM(VTK_MPIRUN_EXE NAMES mpiexec mpirun lamexec PATHS "C:/Program Files/MPICH/mpd/bin")
SET(VTK_MPI_PRENUMPROC_FLAGS "" CACHE STRING "These flags will be directly before the number of processess flag (see ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt for more info.)")
SET(VTK_MPI_NUMPROC_FLAG "-np" CACHE STRING "Flag used by mpi to specify the number of processes, the next option will be the number of processes. (see ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt for more info.)")
SET(VTK_MPI_PREFLAGS "" CACHE STRING "These flags will be directly before the executable that is being run by VTK_MPIRUN_EXE. (see ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt for more info.)")
SET(VTK_MPI_POSTFLAGS "" CACHE STRING "These flags will come after all flags given to MPIRun.(see ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt for more info.)")
SET(VTK_MPI_MAX_NUMPROCS "2" CACHE STRING "Maximum number of processors available to run parallel applications. (see ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt for more info.)")
ENDIF(${MPIEXEC})
MARK_AS_ADVANCED(
VTK_MPI_PRENUMPROC_FLAGS VTK_MPI_NUMPROC_FLAG VTK_MPIRUN_EXE VTK_MPI_PREFLAGS VTK_MPI_POSTFLAGS VTK_MPI_MAX_NUMPROCS)
SEPARATE_ARGUMENTS(VTK_MPI_PRENUMPROC_FLAGS)
SEPARATE_ARGUMENTS(VTK_MPI_PREFLAGS)
SEPARATE_ARGUMENTS(VTK_MPI_POSTFLAGS)
ENDIF(VTK_USE_MPI)
#-----------------------------------------------------------------------------
# Create STL header wrappers to block warnings in the STL headers.
# This is now deprecated, and should not be used. Kept for backwards compat.
# Should be completely removed before VTK 6.0 is tagged.
IF(NOT VTK_LEGACY_REMOVE)
FOREACH(header
algorithm
deque
exception
functional
iterator
limits
list
map
memory
new
numeric
queue
set
stack
stdexcept
string
utility
vector
)
SET(VTK_STL_HEADER "${header}")
CONFIGURE_FILE(${VTK_SOURCE_DIR}/Utilities/vtkstd.h.in
${VTK_BINARY_DIR}/vtkstd/${header} @ONLY IMMEDIATE)
IF(NOT VTK_INSTALL_NO_DEVELOPMENT)
INSTALL(FILES ${VTK_BINARY_DIR}/vtkstd/${header}
DESTINATION ${VTK_INSTALL_INCLUDE_DIR_CM24}/vtkstd
COMPONENT Development)
ENDIF(NOT VTK_INSTALL_NO_DEVELOPMENT)
ENDFOREACH(header)
ENDIF()
#-----------------------------------------------------------------------------
# VTK utility script locations.
SET(VTK_DOXYGEN_HOME ${VTK_SOURCE_DIR}/Utilities/Doxygen)
SET(VTK_HEADER_TESTING_PY ${VTK_SOURCE_DIR}/Common/Testing/HeaderTesting.py)
SET(VTK_FIND_STRING_TCL ${VTK_SOURCE_DIR}/Common/Testing/Tcl/FindString.tcl)