An update will be applied January 25th, between 12PM and 1:00PM EST (UTC -5:00). The site may be slow during that time.

CMakeLists.txt 58.4 KB
Newer Older
1
2
CMAKE_MINIMUM_REQUIRED(VERSION 2.6.3 FATAL_ERROR)

3
4
5
6
7
FOREACH(policy CMP0012 CMP0013 CMP0014)
  IF(POLICY ${policy})
    CMAKE_POLICY(SET ${policy} NEW)
  ENDIF()
ENDFOREACH()
8

Ken Martin's avatar
Ken Martin committed
9
PROJECT(VTK)
10

11
12
13
14
15
16
17
18
19
20
21
22
23
24
# 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)

Alexander Neundorf's avatar
   
Alexander Neundorf committed
25
# the following lines are for cross compiling support
Alexander Neundorf's avatar
   
Alexander Neundorf committed
26
# we may get here also from ParaView, in this case don't change the filename
Alexander Neundorf's avatar
   
Alexander Neundorf committed
27
IF(NOT EXPORT_EXECUTABLES_FILE)
Alexander Neundorf's avatar
   
Alexander Neundorf committed
28
29
30
  # 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)
Alexander Neundorf's avatar
   
Alexander Neundorf committed
31
    FIND_PACKAGE(VTKCompileTools REQUIRED)
Alexander Neundorf's avatar
   
Alexander Neundorf committed
32
33
  ENDIF(CMAKE_CROSSCOMPILING)

Alexander Neundorf's avatar
   
Alexander Neundorf committed
34
  SET(EXPORT_EXECUTABLES_FILE "${CMAKE_BINARY_DIR}/VTKCompileToolsConfig.cmake")
35
  SET(EXPORT_EXECUTABLES_NAMESPACE "")
Alexander Neundorf's avatar
   
Alexander Neundorf committed
36
37
38
  FILE(WRITE "${EXPORT_EXECUTABLES_FILE}" "#generated by VTK, do not edit\n")
ENDIF(NOT EXPORT_EXECUTABLES_FILE)

39
40
GET_PROPERTY(VTK_TARGET_SUPPORTS_SHARED_LIBS
  GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS)
Alexander Neundorf's avatar
   
Alexander Neundorf committed
41

42
43
44
45
# Warn when using "old style" CMake install commands... But only when
# building VTK itself.
#
IF("${VTK_BINARY_DIR}" STREQUAL "${CMAKE_BINARY_DIR}")
46
47
48
49
50
51
52
53
54
  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)
55
ENDIF("${VTK_BINARY_DIR}" STREQUAL "${CMAKE_BINARY_DIR}")
56

57
SET(VTK_CMAKE_DIR "${VTK_SOURCE_DIR}/CMake")
58
SET(CMAKE_MODULE_PATH "${VTK_SOURCE_DIR}/CMake" ${CMAKE_MODULE_PATH})
59

60
61
# Add supplemental compiler warnings, and GCC visibility support.
INCLUDE(vtkCompilerExtras)
62

63
64
65
# Check the source tree - right now just for local Git hooks.
INCLUDE(vtkCheckSourceTree)

66
67
68
69
70
71
72
73
74
# 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()

75
#-----------------------------------------------------------------------------
Brad King's avatar
Brad King committed
76
# VTK version number.  An even minor number corresponds to releases.
77
SET(VTK_MAJOR_VERSION 5)
78
SET(VTK_MINOR_VERSION 7)
Ken Martin's avatar
Ken Martin committed
79
SET(VTK_BUILD_VERSION 0)
80
81
SET(VTK_VERSION
    "${VTK_MAJOR_VERSION}.${VTK_MINOR_VERSION}.${VTK_BUILD_VERSION}")
Brad King's avatar
Brad King committed
82

83
84
85
86
87
88
89
90
91
92
# 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)

David Partyka's avatar
David Partyka committed
93
94
INCLUDE(vtkTargetExportMacros)

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
#-----------------------------------------------------------------------------
# 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)

122
123
#-----------------------------------------------------------------------------
# Load some macros.
124
125
126
127
128
INCLUDE(vtkDependentOption)
INCLUDE(vtkThirdParty)
INCLUDE(vtkExportKit)
INCLUDE(vtkMakeInstantiator)
INCLUDE(CMakeExportBuildSettings)
129
130
131

#-----------------------------------------------------------------------------
# Choose static or shared libraries.
132
INCLUDE(vtkSelectSharedLibraries)
133

134
135
#-----------------------------------------------------------------------------
# Does VTK require support for 64 bit file systems
136
INCLUDE(CheckCXXSourceRuns)
137
138
139
FILE(READ "${VTK_CMAKE_DIR}/vtkRequireLargeFilesSupport.cxx"
  VTK_REQUIRE_LARGE_FILE_SUPPORT_FILE)
CHECK_CXX_SOURCE_RUNS("${VTK_REQUIRE_LARGE_FILE_SUPPORT_FILE}"
Alexander Neundorf's avatar
   
Alexander Neundorf committed
140
141
  CMAKE_REQUIRE_LARGE_FILE_SUPPORT "Support for 64 bit file systems")
SET(VTK_REQUIRE_LARGE_FILE_SUPPORT ${CMAKE_REQUIRE_LARGE_FILE_SUPPORT})
142

143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
#-----------------------------------------------------------------------------
# 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)

159
160
161
162
163
164
#-----------------------------------------------------------------------------
# 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).

165
INCLUDE(SharedLibraryPathVarName)
166

167
168
#-----------------------------------------------------------------------------
# Output directories.
169
170
171
172
173
174
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)
175
176
177
178
179
180
181
182

#-----------------------------------------------------------------------------
# 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.

183
184
185
186
187
188
189
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 ".")
190
191
192

#-----------------------------------------------------------------------------
# Where the cxx tests are, for use in ADD_TEST
193
SET(CXX_TEST_PATH ${EXECUTABLE_OUTPUT_PATH})
194
195
196
197
198
IF(CMAKE_CONFIGURATION_TYPES)
  SET(CXX_TEST_CONFIG \${CTEST_CONFIGURATION_TYPE})
ELSE()
  SET(CXX_TEST_CONFIG .)
ENDIF()
199

200
201
202
203
204
#-----------------------------------------------------------------------------
# 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.
205
206

# The location in which to install VTK executables.
207
208
209
IF(NOT VTK_INSTALL_BIN_DIR)
  SET(VTK_INSTALL_BIN_DIR ${VTK_INSTALL_ROOT}/bin)
ENDIF(NOT VTK_INSTALL_BIN_DIR)
210
211

# The location in which to install VTK header files.
212
IF(NOT VTK_INSTALL_INCLUDE_DIR)
213
214
215
  SET(VTK_INSTALL_INCLUDE_DIR
    ${VTK_INSTALL_ROOT}/include/vtk-${VTK_MAJOR_VERSION}.${VTK_MINOR_VERSION}
    )
216
ENDIF(NOT VTK_INSTALL_INCLUDE_DIR)
217
218

# The location in which to install VTK libraries.
219
IF(NOT VTK_INSTALL_LIB_DIR)
220
  SET(VTK_INSTALL_LIB_DIR
221
222
    ${VTK_INSTALL_ROOT}/lib/vtk-${VTK_MAJOR_VERSION}.${VTK_MINOR_VERSION}
    )
223
224
ENDIF(NOT VTK_INSTALL_LIB_DIR)

225
226
# The location in which to install CMake scripts for packaging VTK.
IF(NOT VTK_INSTALL_PACKAGE_DIR)
227
  SET(VTK_INSTALL_PACKAGE_DIR ${VTK_INSTALL_LIB_DIR})
228
229
230
231
232
233
234
235
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)

236
237
238
239
240
241
# 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)

242
243
244
# 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.
245
SET(VTK_INSTALL_TCL_DIR ${VTK_INSTALL_LIB_DIR})
246
247
248
249
250

IF(NOT VTK_INSTALL_JAVA_DIR)
  SET(VTK_INSTALL_JAVA_DIR ${VTK_INSTALL_PACKAGE_DIR}/java)
ENDIF(NOT VTK_INSTALL_JAVA_DIR)

251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
# 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 1)
  ENDIF(VTK_INSTALL_NO_RUNTIME AND VTK_INSTALL_NO_DEVELOPMENT)
ELSE(BUILD_SHARED_LIBS)
  IF(VTK_INSTALL_NO_DEVELOPMENT)
    SET(VTK_INSTALL_NO_LIBRARIES 1)
  ENDIF(VTK_INSTALL_NO_DEVELOPMENT)
ENDIF(BUILD_SHARED_LIBS)

273
274
275
276
# 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
277
278
279
280
281
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_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}")
282
STRING(REGEX REPLACE "^/" "" VTK_INSTALL_DOC_DIR_CM24 "${VTK_INSTALL_DOC_DIR}")
283
284
STRING(REGEX REPLACE "^/" "" VTK_INSTALL_TCL_DIR_CM24 "${VTK_INSTALL_TCL_DIR}")
STRING(REGEX REPLACE "^/" "" VTK_INSTALL_JAVA_DIR_CM24 "${VTK_INSTALL_JAVA_DIR}")
285

286
287
288
#-----------------------------------------------------------------------------
# Save the compiler settings so another project can import them.
CMAKE_EXPORT_BUILD_SETTINGS(${VTK_BINARY_DIR}/VTKBuildSettings.cmake)
289
IF(NOT VTK_INSTALL_NO_DEVELOPMENT)
290
291
292
  INSTALL(FILES "${VTK_BINARY_DIR}/VTKBuildSettings.cmake"
    DESTINATION ${VTK_INSTALL_PACKAGE_DIR_CM24}
    COMPONENT Development)
293
ENDIF(NOT VTK_INSTALL_NO_DEVELOPMENT)
294

295
296
297
298
299
300
#-----------------------------------------------------------------------------
# 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)

301
#-----------------------------------------------------------------------------
Alexander Neundorf's avatar
   
Alexander Neundorf committed
302
OPTION(VTK_USE_METAIO "Build metaio" ON)
303
MARK_AS_ADVANCED(VTK_USE_METAIO)
Alexander Neundorf's avatar
   
Alexander Neundorf committed
304

305
# Determine the set of VTK kits that should be built.
306
OPTION(VTK_USE_RENDERING "Build the vtkRendering kit.  Needed for displaying data or using widgets." ON)
307
OPTION(VTK_USE_INFOVIS "Build the vtkInfovis kit.  Needed for performing information visualization." ON)
308
OPTION(VTK_USE_TEXT_ANALYSIS "Build the vtkTextAnalysis kit.  Needed for performing text analysis." OFF)
309

310
311
312
313
314
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)
Ken Martin's avatar
Ken Martin committed
315

316
OPTION(VTK_USE_N_WAY_ARRAYS "Add support for arbitrary-dimension sparse and dense arrays." ON)
317

318
319
# Determine Shading Support
VTK_DEPENDENT_OPTION(VTK_USE_CG_SHADERS "Build pixel and vertex shader support for Cg." OFF
320
  "VTK_USE_RENDERING" OFF)
321
VTK_DEPENDENT_OPTION(VTK_USE_GLSL_SHADERS "Build pixel and vertex shader support for GLSL." ON
322
  "VTK_USE_RENDERING" OFF)
323

324
325
326
VTK_DEPENDENT_OPTION(VTK_USE_CHARTS "Build VTK chart support (OpenGL based)" ON
  "VTK_USE_RENDERING;VTK_USE_VIEWS" OFF)

327
328
SET(VTK_DEFAULT_SHADERS_DIR
   "${VTK_BINARY_DIR}/Utilities/MaterialLibrary/Repository"
329
   CACHE INTERNAL
330
331
   "The directory in which code for Shaders is provided.")

332
SET(VTK_MATERIALS_DIRS
333
334
335
336
  ${VTK_DEFAULT_SHADERS_DIR}
  CACHE STRING
  "; separated directories to search for materials/shaders")

337
MARK_AS_ADVANCED(VTK_USE_CG_SHADERS VTK_USE_GLSL_SHADERS VTK_MATERIALS_DIRS)
338

Alexander Neundorf's avatar
   
Alexander Neundorf committed
339
# Python multithreading support
Alexander Neundorf's avatar
   
Alexander Neundorf committed
340
SET(_DEFAULT_SKIP_PYTHON_MULTITHREADING_SUPPORT 0)
Alexander Neundorf's avatar
   
Alexander Neundorf committed
341
IF(CMAKE_SYSTEM MATCHES BlueGene  OR  CMAKE_SYSTEM MATCHES Catamount)
Alexander Neundorf's avatar
   
Alexander Neundorf committed
342
  SET(_DEFAULT_SKIP_PYTHON_MULTITHREADING_SUPPORT 1)
Alexander Neundorf's avatar
   
Alexander Neundorf committed
343
ENDIF(CMAKE_SYSTEM MATCHES BlueGene  OR  CMAKE_SYSTEM MATCHES Catamount)
Alexander Neundorf's avatar
   
Alexander Neundorf committed
344
OPTION(VTK_NO_PYTHON_THREADS "Disable multithreading support in the Python bindings" ${_DEFAULT_SKIP_PYTHON_MULTITHREADING_SUPPORT})
345
MARK_AS_ADVANCED(VTK_NO_PYTHON_THREADS)
346
347
348
349
350

# Add Option to enable Qt Support.
OPTION(VTK_USE_QT "Build Qt support" OFF)

IF(VTK_USE_QT)
351
# Now require Qt 4.5.0 or later
352
353
354
355
356
357
358
  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.")
359
  ELSE(NOT QT4 FOUND)
360
361
    # 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)
362
363
364
365
366
367
368
      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)
369
    ENDIF(Q_WS_MAC AND NOT VTK_USE_X)
370
  ENDIF(NOT QT4_FOUND)
371
ENDIF(VTK_USE_QT)
372

Clinton Stimpson's avatar
   
Clinton Stimpson committed
373
# Determine GUI Support.
Clinton Stimpson's avatar
   
Clinton Stimpson committed
374
VTK_DEPENDENT_OPTION(VTK_USE_GUISUPPORT "Build VTK with GUI Support" OFF
Clinton Stimpson's avatar
   
Clinton Stimpson committed
375
                     "VTK_USE_RENDERING" OFF)
376
MARK_AS_ADVANCED(VTK_USE_GUISUPPORT)
377
378
379
IF(VTK_USE_QT AND VTK_USE_RENDERING)
  SET(VTK_USE_GUISUPPORT 1 CACHE BOOL "Build VTK with GUI Support" FORCE)
ENDIF()
Clinton Stimpson's avatar
   
Clinton Stimpson committed
380

381
382
383
384
385
386
387
388
# 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)
389

390
# Remove old options from an existing cache.
Alexander Neundorf's avatar
   
Alexander Neundorf committed
391
IF(NOT "VTK_USE_HYBRID" MATCHES "^VTK_USE_HYBRID$")
392
  SET(VTK_USE_HYBRID "" CACHE INTERNAL "Hiding old option")
Alexander Neundorf's avatar
   
Alexander Neundorf committed
393
394
ENDIF(NOT "VTK_USE_HYBRID" MATCHES "^VTK_USE_HYBRID$")
IF(NOT "VTK_USE_PATENTED" MATCHES "^VTK_USE_PATENTED$")
395
  SET(VTK_USE_PATENTED "" CACHE INTERNAL "Hiding old option")
Alexander Neundorf's avatar
   
Alexander Neundorf committed
396
397
ENDIF(NOT "VTK_USE_PATENTED" MATCHES "^VTK_USE_PATENTED$")
IF(NOT "VTK_USE_VOLUMERENDERING" MATCHES "^VTK_USE_VOLUMERENDERING$")
398
  SET(VTK_USE_VOLUMERENDERING "" CACHE INTERNAL "Hiding old option")
Alexander Neundorf's avatar
   
Alexander Neundorf committed
399
ENDIF(NOT "VTK_USE_VOLUMERENDERING" MATCHES "^VTK_USE_VOLUMERENDERING$")
400

401
SET(VTK_KITS COMMON FILTERING IO GRAPHICS GENERIC_FILTERING IMAGING)
Alexander Neundorf's avatar
   
Alexander Neundorf committed
402

403
404
IF(VTK_USE_RENDERING)
  SET(VTK_KITS ${VTK_KITS} RENDERING)
405
  SET(VTK_KITS ${VTK_KITS} VOLUMERENDERING)
406
  SET(VTK_KITS ${VTK_KITS} HYBRID)
407
408
  SET(VTK_KITS ${VTK_KITS} WIDGETS)
ENDIF(VTK_USE_RENDERING)
Alexander Neundorf's avatar
   
Alexander Neundorf committed
409

410
411
412
IF(VTK_USE_PARALLEL)
  SET(VTK_KITS ${VTK_KITS} PARALLEL)
ENDIF(VTK_USE_PARALLEL)
Alexander Neundorf's avatar
   
Alexander Neundorf committed
413

414
415
416
IF(VTK_USE_INFOVIS)
  SET(VTK_KITS ${VTK_KITS} INFOVIS)
ENDIF(VTK_USE_INFOVIS)
Ken Martin's avatar
Ken Martin committed
417

418
419
420
421
IF(VTK_USE_TEXT_ANALYSIS)
  SET(VTK_KITS ${VTK_KITS} TEXT_ANALYSIS)
ENDIF(VTK_USE_TEXT_ANALYSIS)

Ken Martin's avatar
Ken Martin committed
422
423
424
425
IF(VTK_USE_GEOVIS)
  SET(VTK_KITS ${VTK_KITS} GEOVIS)
ENDIF(VTK_USE_GEOVIS)

426
427
428
429
IF(VTK_USE_VIEWS)
  SET(VTK_KITS ${VTK_KITS} VIEWS)
ENDIF(VTK_USE_VIEWS)

Clinton Stimpson's avatar
   
Clinton Stimpson committed
430
431
432
433
# from GUISupport
IF(VTK_USE_QVTK)
  SET(VTK_KITS ${VTK_KITS} QVTK)
ENDIF(VTK_USE_QVTK)
Alexander Neundorf's avatar
   
Alexander Neundorf committed
434

435
436
437
438
IF(VTK_USE_MFC)
  SET(VTK_KITS ${VTK_KITS} MFC)
ENDIF(VTK_USE_MFC)

439
440
441
IF(VTK_USE_CHARTS)
  SET(VTK_KITS ${VTK_KITS} CHARTS)
ENDIF(VTK_USE_CHARTS)
442
443
444

#-----------------------------------------------------------------------------
# Determine GUI.
445
446
447
448
449
450

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.
451
  INCLUDE(vtkUseX)
452
ENDIF (NOT VTK_DONT_INCLUDE_USE_X)
453

454
VTK_DEPENDENT_OPTION(VTK_USE_CARBON "Build classes using Carbon API." OFF
455
                     "APPLE;VTK_USE_RENDERING" OFF)
456
VTK_DEPENDENT_OPTION(VTK_USE_COCOA "Build classes using Cocoa API." ON
457
458
459
460
                     "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.")
461
462
  # Since Cocoa is the default, assume user wants to switch to Carbon
  SET(VTK_USE_COCOA OFF)
463
464
ENDIF(VTK_USE_CARBON AND VTK_USE_COCOA)

465
466
467
468
469
#-----------------------------------------------------------------------------
# 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)

470
471
#-----------------------------------------------------------------------------
# VTK requires special compiler flags on some platforms.
472
INCLUDE(vtkDetermineCompilerFlags)
473

474
475
476
# Tell VTK source files they are being built inside VTK.
ADD_DEFINITIONS(-DVTK_IN_VTK)

477
#-----------------------------------------------------------------------------
478
# Platform configuration tests.
479
INCLUDE(CMakeBackwardCompatibilityC)
Alexander Neundorf's avatar
   
Alexander Neundorf committed
480
481
482
483
INCLUDE(TestForANSIStreamHeaders)
INCLUDE(TestForSTDNamespace)
INCLUDE(TestForANSIForScope)
INCLUDE(CheckTypeSize)
Ken Martin's avatar
Ken Martin committed
484

485
# Simulate old CMakeBackwardCompatibilityCXX test.
486
INCLUDE(TestForSSTREAM)
487

Alexander Neundorf's avatar
   
Alexander Neundorf committed
488
# Tests for various integer, bool and float types
489
INCLUDE(vtkTestTypes)
490

Alexander Neundorf's avatar
   
Alexander Neundorf committed
491
# Socket tests etc.
492
493
INCLUDE(Parallel/VTKParallelCMakeTests.cmake)

Alexander Neundorf's avatar
   
Alexander Neundorf committed
494
# Check for full template specialization support by compiler.
495
INCLUDE(vtkTestFullSpecialization)
Alexander Neundorf's avatar
   
Alexander Neundorf committed
496

497
# Check for explicit template instantiation support by compiler.
498
INCLUDE(vtkTestExplicitInstantiation)
499

500
501
502
503
504
505
506
507
# 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)
Alexander Neundorf's avatar
   
Alexander Neundorf committed
508

509
510
511
512
513
514
515
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)
516
VTK_PREPARE_CMAKEDEFINE(NOT CMAKE_ANSI_FOR_SCOPE VTK_NO_FOR_SCOPE)
517
518
VTK_PREPARE_CMAKEDEFINE(NOT VTK_EXPLICIT_TEMPLATES
                  VTK_NO_EXPLICIT_TEMPLATE_INSTANTIATION)
519
520
VTK_PREPARE_CMAKEDEFINE(NOT VTK_COMPILER_HAS_FULL_SPECIALIZATION
                        VTK_NO_FULL_TEMPLATE_SPECIALIZATION)
521

522
#-----------------------------------------------------------------------------
523
# Include file dependency tracking regular expression.
524
SET(VTK_REGEX "vtk[^.]*\\.([^t]|t[^x]|tx[^x]|cxx|hxx)")
525
526
527
528
529
530
531
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)
532
INCLUDE_REGULAR_EXPRESSION("(^|/)((lex|png|j|z|t|D|Q|verdict).*|${VTK_REGEX}|${VTK_REGEX_TXX})$")
533

Brad King's avatar
Brad King committed
534
535
#-----------------------------------------------------------------------------
# Determine the set of language wrappers that should be built.
536
537
538
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)
539
540
OPTION(VTK_WRAP_PYTHON_SIP "Make python wrapped classes available to SIP/PyQt." OFF)
IF(VTK_WRAP_PYTHON_SIP)
541
542
543
  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")
544
ENDIF(VTK_WRAP_PYTHON_SIP)
545
546

# Python requires shared libraries.
Alexander Neundorf's avatar
   
Alexander Neundorf committed
547
IF(VTK_WRAP_PYTHON AND VTK_TARGET_SUPPORTS_SHARED_LIBS AND NOT BUILD_SHARED_LIBS )
Alexander Neundorf's avatar
   
Alexander Neundorf committed
548
549
  MESSAGE(SEND_ERROR "VTK_WRAP_PYTHON requires BUILD_SHARED_LIBS to be ON.")
  SET(VTK_WRAP_PYTHON 0)
Alexander Neundorf's avatar
   
Alexander Neundorf committed
550
ENDIF(VTK_WRAP_PYTHON AND VTK_TARGET_SUPPORTS_SHARED_LIBS AND NOT BUILD_SHARED_LIBS )
551
552

# Java requires shared libraries on Windows.
Alexander Neundorf's avatar
   
Alexander Neundorf committed
553
554
555
556
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)
Brad King's avatar
Brad King committed
557
558
559
560
561
562
563
564
565
566
567
568

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)

569
#-----------------------------------------------------------------------------
570
571
# Configure testing support.
INCLUDE(CTest)
572
MARK_AS_ADVANCED(DART_ROOT TCL_TCLSH CVSCOMMAND CVS_UPDATE_OPTIONS DART_TESTING_TIMEOUT)
573
574
575
IF(BUILD_TESTING)
  ENABLE_TESTING()
ENDIF(BUILD_TESTING)
576
577
578
579
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")
580

581
582
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)
583

584
585
586
587
588
589
590
591
592
#------------------------------------------------------------------------------
# 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)

593
594
595
596
# 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)
597
598
MARK_AS_ADVANCED(VTK_TESTING_USE_FPE)

599
600
601
602
603
604
605
606
607

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)

608
IF(VTK_TESTING_USE_FPE)
609
610
 SET(CMAKE_TESTDRIVER_BEFORE_TESTMAIN "${CMAKE_TESTDRIVER_BEFORE_TESTMAIN}
    vtkFloatingPointExceptions::Enable();\n")
611
612
ENDIF(VTK_TESTING_USE_FPE)

613
614
615
SET(CMAKE_TESTDRIVER_BEFORE_TESTMAIN "${CMAKE_TESTDRIVER_BEFORE_TESTMAIN}
    try {")

616
617
618
619
620
621
622
623
SET(CMAKE_TESTDRIVER_AFTER_TESTMAIN "    }
    catch(vtkstd::exception& e)
      {
      fprintf(stderr, \"Test driver caught exception: [%s]\\n\", e.what());
      result = -1;
      }")

#-----------------------------------------------------------------------------
624
# Select a streams library.
625

626
INCLUDE(vtkSelectStreamsLibrary)
627
VTK_SELECT_STREAMS_LIBRARY(VTK_USE_ANSI_STDLIB ${VTK_SOURCE_DIR})
628
# Check the severity of EOF bugs in the streams library.
Alexander Neundorf's avatar
   
Alexander Neundorf committed
629
# this must be after the test for the long types
630
INCLUDE(vtkTestStreamsLibrary)
631

632
IF(VTK_USE_RENDERING AND WIN32)
Alexander Neundorf's avatar
   
Alexander Neundorf committed
633
  # Check for vfw32 support
634
  INCLUDE(vtkTestVideoForWindows)
635
636
ENDIF(VTK_USE_RENDERING AND WIN32)

637
638
639
#-----------------------------------------------------------------------------
# Configure KWSys to be named "vtksys".
SET(KWSYS_NAMESPACE vtksys)
640
641
SET(KWSYS_USE_Base64 1)
SET(KWSYS_USE_CommandLineArguments 1)
Alexander Neundorf's avatar
   
Alexander Neundorf committed
642
SET(KWSYS_USE_DynamicLoader 1)
643
644
SET(KWSYS_USE_Process 1)
SET(KWSYS_USE_RegularExpression 1)
645
SET(KWSYS_USE_SystemTools 1)
646
647
SET(KWSYS_USE_SystemInformation 1)
SET(KWSYS_USE_FundamentalType 1)
648
SET(KWSYS_USE_MD5 1)
David Gobbi's avatar
David Gobbi committed
649
SET(KWSYS_USE_Glob 1)
650
SET(KWSYS_USE_DateStamp 1)
651
SET(KWSYS_HEADER_ROOT ${VTK_BINARY_DIR}/Utilities)
652
SET(KWSYS_PROPERTIES_CXX ${VTK_LIBRARY_PROPERTIES})
David Partyka's avatar
David Partyka committed
653
SET(KWSYS_INSTALL_EXPORT_NAME ${VTK_INSTALL_EXPORT_NAME})
Alexander Neundorf's avatar
   
Alexander Neundorf committed
654

655
656
657
IF(NOT VTK_USE_ANSI_STDLIB)
  SET(KWSYS_IOS_FORCE_OLD 1)
ENDIF(NOT VTK_USE_ANSI_STDLIB)
Alexander Neundorf's avatar
   
Alexander Neundorf committed
658

659
660
IF(NOT VTK_INSTALL_NO_LIBRARIES)
  SET(KWSYS_LIBRARY_INSTALL_DIR ${VTK_INSTALL_LIB_DIR})
661
662
663
  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)
664
665
ENDIF(NOT VTK_INSTALL_NO_LIBRARIES)
IF(NOT VTK_INSTALL_NO_DEVELOPMENT)
666
667
  SET(KWSYS_INSTALL_INCLUDE_DIR ${VTK_INSTALL_INCLUDE_DIR_CM24})
  SET(KWSYS_INSTALL_COMPONENT_NAME_DEVELOPMENT Development)
668
669
670
671
672
ENDIF(NOT VTK_INSTALL_NO_DEVELOPMENT)

#-----------------------------------------------------------------------------
# Dispatch the build into the proper subdirectories.

673

674
SET(VTK_HAS_EXODUS 1)
675

676
677
678
#-----------------------------------------------------------------------------
# Provide a few configuration options.
OPTION(BUILD_EXAMPLES "Build VTK examples." OFF)
679
680
681
682
683
684
685
686
687

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})

688
689
690
691
692
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)
693
VTK_DEPENDENT_OPTION(VTK_OPENGL_HAS_OSMESA
694
695
                     "The opengl library being used supports off screen Mesa calls." OFF
                     "VTK_USE_RENDERING;UNIX" OFF)
Alexander Neundorf's avatar
   
Alexander Neundorf committed
696

Alexander Neundorf's avatar
   
Alexander Neundorf committed
697
698
699
700
701
702
703
704
705

# 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)


706
SET(VTK_CAN_DO_OFF_SCREEN)
707
IF(VTK_USE_MANGLED_MESA OR VTK_OPENGL_HAS_OSMESA OR WIN32)
708
  SET(VTK_CAN_DO_OFF_SCREEN 1)
709
ENDIF(VTK_USE_MANGLED_MESA OR VTK_OPENGL_HAS_OSMESA OR WIN32)
Alexander Neundorf's avatar
   
Alexander Neundorf committed
710

711
VTK_DEPENDENT_OPTION(VTK_USE_OFFSCREEN
712
                     "Use off screen calls by default." OFF
713
                     "VTK_CAN_DO_OFF_SCREEN" OFF)
714
715
716
717
718
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
719
                     "VTK_USE_RENDERING;WIN32" OFF)
720
VTK_DEPENDENT_OPTION(VTK_USE_GL2PS "Build VTK with gl2ps support." OFF
721
                     "VTK_USE_RENDERING" ON)
722
723
724
VTK_DEPENDENT_OPTION(VTK_USE_PARALLEL_BGL
                     "Use the Parallel Boost Graph Library"
                     OFF
725
                     "VTK_USE_BOOST;VTK_USE_MPI;VTK_USE_PARALLEL;VTK_USE_64BIT_IDS"
726
                     OFF)
727

728
SET(VTK_CAN_USE_TK OFF)
729
SET(VTK_USE_TK_DEFAULT ON)
730
IF(VTK_WRAP_PYTHON OR VTK_WRAP_TCL)
731
  IF(NOT VTK_DISABLE_TK_INIT)
732
733
    SET(VTK_CAN_USE_TK ON)
    IF(APPLE)
734
735
736
737
738
739
740
741
742
743
744
745
746
      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)
747
    ENDIF(APPLE)
748
  ENDIF(NOT VTK_DISABLE_TK_INIT)
749
ENDIF(VTK_WRAP_PYTHON OR VTK_WRAP_TCL)
750
751
VTK_DEPENDENT_OPTION(VTK_USE_TK "Build VTK with Tk support"
                     ${VTK_USE_TK_DEFAULT} "VTK_CAN_USE_TK" OFF)
752

753
MARK_AS_ADVANCED(VTK_OPENGL_HAS_OSMESA
754
755
                 VTK_USE_OFFSCREEN
                 VTK_USE_TK
756
                 VTK_USE_GL2PS
757
758
                 VTK_USE_MANGLED_MESA
                 VTK_USE_MATROX_IMAGING
759
760
                 VTK_USE_MPI
                 VTK_USE_PARALLEL_BGL)
761
762
763
764

#-----------------------------------------------------------------------------
# Provide options to use system versions of third-party libraries.
VTK_THIRD_PARTY_OPTION(ZLIB zlib)
765
766
VTK_THIRD_PARTY_OPTION(HDF5 hdf5)
INCLUDE(vtkHDF5Library)
767
768
769
IF(VTK_USE_GL2PS)
VTK_THIRD_PARTY_OPTION(GL2PS gl2ps)
ENDIF(VTK_USE_GL2PS)
770
771
772
773
VTK_THIRD_PARTY_OPTION(JPEG jpeg)
VTK_THIRD_PARTY_OPTION(PNG  png)
VTK_THIRD_PARTY_OPTION(TIFF tiff)
VTK_THIRD_PARTY_OPTION(EXPAT expat)
774
VTK_THIRD_PARTY_OPTION(FREETYPE freetype)
775
VTK_THIRD_PARTY_OPTION(LIBXML2 libxml2)
776
VTK_THIRD_PARTY_OPTION(LIBPROJ4 proj4)
777
778
779
if(VTK_USE_OGGTHEORA_ENCODER)
  VTK_THIRD_PARTY_OPTION(OGGTHEORA oggtheora)
endif(VTK_USE_OGGTHEORA_ENCODER)
780
781
782
783

#-----------------------------------------------------------------------------
# Configure OpenGL support.
IF(VTK_USE_RENDERING)
784
785
786
787
788
789
  # 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)
790
    FIND_PATH(OPENGL_INCLUDE_DIR GL/gl.h
791
      /usr/X11R6/include)
792
    FIND_PATH(OPENGL_xmesa_INCLUDE_DIR GL/xmesa.h
793
      /usr/X11R6/include)
794
    FIND_LIBRARY(OPENGL_gl_LIBRARY NAMES GL MesaGL
795
      PATHS /usr/lib /usr/local/lib /usr/X11R6/lib)
796
    FIND_LIBRARY(OPENGL_glu_LIBRARY NAMES GLU MesaGLU
797
798
      PATHS ${OPENGL_gl_LIBRARY} /usr/lib /usr/local/lib /usr/X11R6/lib)
  ENDIF(APPLE AND VTK_USE_X)
Alexander Neundorf's avatar
   
Alexander Neundorf committed
799
  FIND_PACKAGE(OpenGL)
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814

  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)
815
       find_package(NVCtrlLib REQUIRED)
816
     endif(VTK_USE_NVCONTROL)
817
818
     mark_as_advanced(VTK_USE_NVCONTROL)
  endif(VTK_USE_X)
819

820
821
ENDIF(VTK_USE_RENDERING)

822
823
VTK_PREPARE_CMAKEDEFINE("" OPENGL_LIBRARY VTK_USE_OPENGL_LIBRARY)

824
825
826
#-----------------------------------------------------------------------------
# Configure Mangled MESA support.
IF(VTK_USE_MANGLED_MESA)
Alexander Neundorf's avatar
   
Alexander Neundorf committed
827
  FIND_PACKAGE(MangledMesa)
828

829
830
831
832
833
834
835
836
  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.
Alexander Neundorf's avatar
   
Alexander Neundorf committed
837
838
839
840
841
# 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)

842
IF(VTK_OPENGL_HAS_OSMESA)
Alexander Neundorf's avatar
   
Alexander Neundorf committed
843
  FIND_PACKAGE(OSMesa)
844
845
ENDIF(VTK_OPENGL_HAS_OSMESA)

846
847
848
#-----------------------------------------------------------------------------
# Configure CG-Shading support.
IF(VTK_USE_CG_SHADERS)
849
  FIND_PACKAGE(Cg)
850
851
852
853
854
855
856
  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.

857
858
859
860
861
862
863
864
865
866
867
868
#-----------------------------------------------------------------------------
# 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)

869
870
871
872
873

IF(VTK_USE_MPI)
  FIND_PACKAGE(MPI)
ENDIF(VTK_USE_MPI)

874
875
#-----------------------------------------------------------------------------
# Configure MPI testing support.
876
877
# FLAGS used and set for MPI testing
# VTK_MPIRUN_EXE - full path to mpirun command
878
# VTK_MPI_PRENUMPROC_FLAGS - flags used directly before the num. of procs flag
879
# VTK_MPI_NUMPROC_FLAG - flag that is used to tell this mpirun how many procs to start
880
# VTK_MPI_PREFLAGS - flags used directly before process to be run by mpirun
881
882
# VTK_MPI_POSTFLAGS - flags used after all other flags by mpirun
# So, tests will be run something like this:
883
# ${VTK_MPIRUN_EXE} ${VTK_MPI_PRENUMPROC_FLAGS} ${VTK_MPI_NUMPROC_FLAG} 2 ${VTK_MPI_PREFLAGS} executable ${VTK_MPI_POSTFLAGS}
884
#
885
IF(VTK_USE_MPI)
886
887

  # Use MPI variables defined in the CMake (2.8) FindMPI module.
Dave Partyka's avatar
Dave Partyka committed
888
  IF(${MPIEXEC})
889
890
    SET(VTK_MPIRUN_EXE ${MPIEXEC})
    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.)")
891
892
893
894
    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.)")
    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.)")
895
    ENDIF(NOT ${MPI_NUMPROC_FLAG})
896
897
898
899
900
    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.)")
    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.)")
    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.)")
  ELSE(${MPIEXEC})
  # set to the default hardcoded values. This else can probably be deleted when VTK requires CMake 2.8+.
901
    FIND_PROGRAM(VTK_MPIRUN_EXE NAMES mpiexec mpirun lamexec PATHS "C:/Program Files/MPICH/mpd/bin")
902
903
904
905
906
907
    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})
908

909
  MARK_AS_ADVANCED(
910
911
    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)
912
913
  SEPARATE_ARGUMENTS(VTK_MPI_PREFLAGS)
  SEPARATE_ARGUMENTS(VTK_MPI_POSTFLAGS)
914
ENDIF(VTK_USE_MPI)
915

916

917
918
#-----------------------------------------------------------------------------
# Create STL header wrappers to block warnings in the STL headers.
919
920
921
922
923
924
FOREACH(header
  algorithm
  deque
  exception
  functional
  iterator
925
  limits
926
927
928
929
930
931
932
933
934
935
936
937
938
  list
  map
  memory
  new
  numeric
  queue
  set
  stack
  stdexcept
  string
  utility
  vector
  )
939
940
941
  SET(VTK_STL_HEADER "${header}")
  CONFIGURE_FILE(${VTK_SOURCE_DIR}/Utilities/vtkstd.h.in
                 ${VTK_BINARY_DIR}/vtkstd/${header} @ONLY IMMEDIATE)
942
  IF(NOT VTK_INSTALL_NO_DEVELOPMENT)
943
944
945
    INSTALL(FILES ${VTK_BINARY_DIR}/vtkstd/${header}
      DESTINATION ${VTK_INSTALL_INCLUDE_DIR_CM24}/vtkstd
      COMPONENT Development)
946
  ENDIF(NOT VTK_INSTALL_NO_DEVELOPMENT)
947
948
ENDFOREACH(header)

Brad King's avatar
Brad King committed
949
950
951
952
953
954
955
956
957
958
959
#-----------------------------------------------------------------------------
# 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)
SET(VTK_PRINT_SELF_CHECK_TCL ${VTK_SOURCE_DIR}/Common/Testing/Tcl/PrintSelfCheck.tcl)
SET(VTK_RT_IMAGE_TEST_TCL ${VTK_SOURCE_DIR}/Common/Testing/Tcl/rtImageTest.tcl)
IF(VTK_USE_PARALLEL)
  SET(VTK_PRT_IMAGE_TEST_TCL ${VTK_SOURCE_DIR}/Common/Testing/Tcl/prtImageTest.tcl)
ENDIF(VTK_USE_PARALLEL)

Alexander Neundorf's avatar
   
Alexander Neundorf committed
960
961
962
963
964
965
966
967
968


#-----------------------------------------------------------------------------
# Configure the python executable for use by testing.
# Python executable is used by some tests whether VTK_WRAP_PYTHON is
# on or not.
# If VTK_WRAP_PYTHON is on, then we need python executable to compile
# scripts.
IF(BUILD_TESTING OR VTK_WRAP_PYTHON)
969
  FIND_PACKAGE(PythonInterp QUIET)
Alexander Neundorf's avatar
   
Alexander Neundorf committed
970
971
972
973
  MARK_AS_ADVANCED(PYTHON_EXECUTABLE)
ENDIF(BUILD_TESTING OR VTK_WRAP_PYTHON)

#-----------------------------------------------------------------------------
974
975
976
977
978
979
# Configure the default VTK_DATA_ROOT for the location of VTKData.  To get
# the VTKData repository from CVS, issue the following commands:
#
# cvs -d :pserver:anonymous@public.kitware.com:/cvsroot/VTKData login
# (respond with password vtk)
# cvs -d :pserver:anonymous@public.kitware.com:/cvsroot/VTKData checkout VTKData
980
981
982
983
FIND_PATH(VTK_DATA_ROOT VTKData.readme
  ${VTK_SOURCE_DIR}/VTKData
  ${VTK_SOURCE_DIR}/../VTKData
  ${VTK_SOURCE_DIR}/../../VTKData
984
  $ENV{VTK_DATA_ROOT}
985
  DOC "The repository for data used for testing.  To obtain from CVS: \"cvs -d :pserver:anoncvs@www.vtk.org:/cvsroot/VTK co VTKData\"")
986
987
988

#-----------------------------------------------------------------------------
# Configure the default VTK__LARGE_DATA_ROOT for the location of VTKLargeData.
989
990
991
992
FIND_PATH(VTK_LARGE_DATA_ROOT VTKLargeData.readme
  ${VTK_SOURCE_DIR}/VTKLargeData
  ${VTK_SOURCE_DIR}/../VTKLargeData
  ${VTK_SOURCE_DIR}/../../VTKLargeData
993
994
995
996
997
998
999
1000
1001
  $ENV{VTK_LARGE_DATA_ROOT}
  DOC "The repository for large data used for testing.  To check out this repository from CVS, first run

cvs -d :pserver:anonymous@public.kitware.com:/cvsroot/VTK login

(respond with password vtk) and then run

cvs -d :pserver:anonymous@public.kitware.com:/cvsroot/VTK checkout VTKLargeData"
  )
Alexander Neundorf's avatar
   
Alexander Neundorf committed
1002
1003
1004
1005

#-----------------------------------------------------------------------------
# FFMPEG
# If the ffmpeg library is available, use it.
1006
OPTION (VTK_USE_FFMPEG_ENCODER "If the FFMPEG library is available, should VTK use it for saving .avi animation files?" FALSE)
1007
MARK_AS_ADVANCED(VTK_USE_FFMPEG_ENCODER)
Alexander Neundorf's avatar
   
Alexander Neundorf committed
1008
IF (VTK_USE_FFMPEG_ENCODER)
1009
  FIND_PACKAGE(FFMPEG)
1010
1011
1012
1013
1014
1015
  MARK_AS_ADVANCED(CLEAR
    FFMPEG_INCLUDE_DIR
    FFMPEG_avformat_LIBRARY
    FFMPEG_avcodec_LIBRARY
    FFMPEG_avutil_LIBRARY
    )
Alexander Neundorf's avatar
   
Alexander Neundorf committed
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
ENDIF (VTK_USE_FFMPEG_ENCODER)

#-----------------------------------------------------------------------------
# MPEG2
#
# Portions of the mpeg2 library are patented. VTK does not enable linking to
# this library by default so VTK can remain "patent free". Users who wish to
# link in mpeg2 functionality must build that library separately and then
# turn on VTK_USE_MPEG2_ENCODER when configuring VTK. After turning on
# VTK_USE_MPEG2_ENCODER, you must also set the CMake variables
# vtkMPEG2Encode_INCLUDE_PATH and vtkMPEG2Encode_LIBRARIES.
#
# To use the patented mpeg2 library, first build it, then set the following
# CMake variables during the VTK configure step:
#   VTK_USE_MPEG2_ENCODER = ON
#   vtkMPEG2Encode_INCLUDE_PATH = /path/to/vtkmpeg2encode;/path/to/vtkmpeg2encode-bin
#   vtkMPEG2Encode_LIBRARIES = /path/to/vtkmpeg2encode-bin/vtkMPEG2Encode.lib
#
# Or using -D args on the cmake/ccmake command line:
#   -DVTK_USE_MPEG2_ENCODER:BOOL=ON
#   "-DvtkMPEG2Encode_INCLUDE_PATH:PATH=/path/to/vtkmpeg2encode;/path/to/vtkmpeg2encode-bin"
#   "-DvtkMPEG2Encode_LIBRARIES:STRING=/path/to/vtkmpeg2encode-bin/vtkMPEG2Encode.lib"
#
# You are solely responsible for any legal issues associated with using
# patented code in your software.
Mathieu Malaterre's avatar
Mathieu Malaterre committed
1041
# Ref: http://www.vtk.org/get-software.php#addons
Alexander Neundorf's avatar
   
Alexander Neundorf committed
1042
1043
1044
1045
#
OPTION (VTK_USE_MPEG2_ENCODER
  "Enable use of the patented mpeg2 library. You are solely responsible for any legal issues associated with using patented code in your software."
  OFF)
1046
MARK_AS_ADVANCED(VTK_USE_MPEG2_ENCODER)
Alexander Neundorf's avatar
   
Alexander Neundorf committed
1047
IF (VTK_USE_MPEG2_ENCODER)
1048
  FIND_PACKAGE(MPEG2)
Alexander Neundorf's avatar
   
Alexander Neundorf committed
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
ENDIF (VTK_USE_MPEG2_ENCODER)

#-----------------------------------------------------------------------------
# Configure files with settings for use by the build.
CONFIGURE_FILE(${VTK_SOURCE_DIR}/vtkConfigure.h.in
               ${VTK_BINARY_DIR}/vtkConfigure.h @ONLY IMMEDIATE)

CONFIGURE_FILE(${VTK_SOURCE_DIR}/UseVTK.cmake.in
               ${VTK_BINARY_DIR}/UseVTK.cmake COPYONLY IMMEDIATE)

CONFIGURE_FILE(${VTK_SOURCE_DIR}/vtkToolkits.h.in
               ${VTK_BINARY_DIR}/vtkToolkits.h @ONLY)

Alexander Neundorf's avatar
   
Alexander Neundorf committed
1062

Alexander Neundorf's avatar
   
Alexander Neundorf committed
1063
1064
1065
#-----------------------------------------------------------------------------

IF(VTK_WRAP_TCL OR VTK_WRAP_PYTHON)
Alexander Neundorf's avatar
   
Alexander Neundorf committed
1066
  IF(VTK_WRAP_TCL)
Alexander Neundorf's avatar
   
Alexander Neundorf committed
1067
    SET(VTK_INCLUDE_NEED_TCL 1)
Alexander Neundorf's avatar
   
Alexander Neundorf committed
1068
  ENDIF(VTK_WRAP_TCL)
Alexander Neundorf's avatar
   
Alexander Neundorf committed
1069
1070
  IF(VTK_USE_RENDERING AND VTK_USE_TK)
    SET(VTK_INCLUDE_NEED_TK 1)
Alexander Neundorf's avatar
   
Alexander Neundorf committed
1071
    SET(VTK_INCLUDE_NEED_TCL 1)
Alexander Neundorf's avatar
   
Alexander Neundorf committed
1072
1073
1074
  ENDIF(VTK_USE_RENDERING AND VTK_USE_TK)
ENDIF(VTK_WRAP_TCL OR VTK_WRAP_PYTHON)

Alexander Neundorf's avatar
   
Alexander Neundorf committed
1075
1076
1077
1078
1079
1080
#-----------------------------------------------------------------------------
# search Python, Tcl and Java

IF(VTK_WRAP_PYTHON)
  # Tell vtkWrapPython.cmake to set VTK_PYTHON_LIBRARIES for us.
  SET(VTK_WRAP_PYTHON_FIND_LIBS 1)
1081
  INCLUDE(vtkWrapPython)
Alexander Neundorf's avatar
   
Alexander Neundorf committed
1082
1083
1084
1085
1086
ENDIF(VTK_WRAP_PYTHON)

IF(VTK_WRAP_TCL OR VTK_INCLUDE_NEED_TK)
  # Tell vtkWrapTcl.cmake to set VTK_TCL_LIBRARIES for us.
  SET(VTK_WRAP_TCL_FIND_LIBS 1)