CMakeLists.txt 14.8 KB
Newer Older
Alexander Neundorf's avatar
   
Alexander Neundorf committed
1
# this file is used directly from VTK/CMakeLists.txt, not from VTK/Wrapping/CMakeLists.txt
2

3
4
5
IF(VTK_USE_CARBON)
  FIND_PROGRAM(VTK_APPLE_RESOURCE Rez /Developer/Tools)
ENDIF(VTK_USE_CARBON)
6

7
8
9
10
11
12
13
IF(UNIX)
  FIND_LIBRARY(PYTHON_UTIL_LIBRARY
    NAMES util
    DOC "Utility library needed for vtkpython"
    )
  MARK_AS_ADVANCED(PYTHON_UTIL_LIBRARY)
ENDIF(UNIX)
Andy Cedilnik's avatar
Andy Cedilnik committed
14

Alexander Neundorf's avatar
   
Alexander Neundorf committed
15
16
17
18
19
20
IF(UNIX)
  SET(PYTHON_MODULE_PREFIX "lib")
ELSE(UNIX)
  SET(PYTHON_MODULE_PREFIX "")
ENDIF(UNIX)

Alexander Neundorf's avatar
   
Alexander Neundorf committed
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
PYTHON_WRITE_MODULES_HEADER("${CMAKE_CURRENT_BINARY_DIR}/vtkpythonmodules.h")
INCLUDE_DIRECTORIES("${CMAKE_CURRENT_BINARY_DIR}")

# create the VTK/Python  executable
CONFIGURE_FILE(${VTK_SOURCE_DIR}/Wrapping/Python/vtkPythonAppInitConfigure.h.in
               ${VTK_BINARY_DIR}/Wrapping/Python/vtkPythonAppInitConfigure.h)

ADD_EXECUTABLE(vtkpython vtkPythonAppInit.cxx)

SET(VTKPYTHON_LINK_FLAGS)
SET(VTKPYTHON_LINK_LIBS)

IF(CMAKE_SYSTEM_NAME MATCHES "AIX")
  GET_FILENAME_COMPONENT(CMAKE_PYTHON_LIB_PREFIX "${PYTHON_LIBRARY}" PATH)
  FIND_FILE(CMAKE_PYTHON_LIBRARY_EXPORT python.exp "${CMAKE_PYTHON_LIB_PREFIX}")
  IF(CMAKE_PYTHON_LIBRARY_EXPORT)
    SET(VTKPYTHON_LINK_FLAGS "-Wl,-bE:${CMAKE_PYTHON_LIBRARY_EXPORT}")
  ENDIF(CMAKE_PYTHON_LIBRARY_EXPORT)
ENDIF(CMAKE_SYSTEM_NAME MATCHES "AIX")

41
IF (APPLE)
Alexander Neundorf's avatar
   
Alexander Neundorf committed
42
43
44
45
46
47
48
49
  IF(VTK_USE_CARBON AND VTK_APPLE_RESOURCE)
    ADD_CUSTOM_COMMAND(
      TARGET vtkpython POST_BUILD
      COMMAND ${VTK_APPLE_RESOURCE} Carbon.r -o ${VTK_EXECUTABLE_DIR}/vtkpython
      )
  ENDIF(VTK_USE_CARBON AND VTK_APPLE_RESOURCE)

  SET(VTKPYTHON_LINK_FLAGS "-flat_namespace -undefined suppress -u _PyMac_Error")
Andy Cedilnik's avatar
Andy Cedilnik committed
50
ENDIF (APPLE)
51

52
# Link against all the kit wrappers.
Alexander Neundorf's avatar
   
Alexander Neundorf committed
53
SET(VTKPYTHON_LINK_LIBS 
54
  ${VTK_PYTHON_LIBRARIES} 
55
  vtksys
Andy Cedilnik's avatar
Andy Cedilnik committed
56
57
58
59
  vtkCommon 
  vtkFiltering
  vtkIO
  vtkGraphics
Alexander Neundorf's avatar
   
Alexander Neundorf committed
60
61
  vtkImaging )

62
63
64
65
66
67
68
69
SET (vtkpython_pyc_depends
    vtkCommonPython
    vtkFilteringPython
    vtkIOPython
    vtkGraphicsPython
    vtkImagingPython
    )

70
IF(BORLAND)
71
  SET(KITS Common Filtering Graphics IO Imaging)
72
73
74
  IF (VTK_USE_PARALLEL)
    SET(KITS ${KITS} Parallel)
  ENDIF(VTK_USE_PARALLEL)
75
76
77
  IF (VTK_USE_INFOVIS)
    SET(KITS ${KITS} Infovis)
  ENDIF(VTK_USE_INFOVIS)
78
79
80
  IF (VTK_USE_VIEWS)
    SET(KITS ${KITS} Views)
  ENDIF(VTK_USE_VIEWS)
81
  IF (VTK_USE_RENDERING)
82
83
84
    SET(KITS ${KITS} Widgets)
    SET(KITS ${KITS} Hybrid)
    SET(KITS ${KITS} VolumeRendering)
85
86
87
88
89
90
91
92
    SET(KITS ${KITS} Rendering)
  ENDIF(VTK_USE_RENDERING)
  FOREACH(KIT ${KITS})
    WRITE_FILE(${LIBRARY_OUTPUT_PATH}/vtk${KIT}Python.def
               "EXPORTS\ninitvtk${KIT}Python=_initvtk${KIT}Python\n")
  ENDFOREACH(KIT)
ENDIF(BORLAND)

Alexander Neundorf's avatar
   
Alexander Neundorf committed
93
94
95
IF(PYTHON_UTIL_LIBRARY)
  SET(VTKPYTHON_LINK_LIBS ${VTKPYTHON_LINK_LIBS}  ${PYTHON_UTIL_LIBRARY})
ENDIF(PYTHON_UTIL_LIBRARY)
96

Andy Cedilnik's avatar
Andy Cedilnik committed
97
IF (VTK_USE_RENDERING)
Alexander Neundorf's avatar
   
Alexander Neundorf committed
98
99
100
101
102
  SET(VTKPYTHON_LINK_LIBS ${VTKPYTHON_LINK_LIBS} 
                          vtkRendering 
                          vtkVolumeRendering 
                          vtkHybrid 
                          vtkWidgets )
103
104
105
106
107
108
109
  SET (vtkpython_pyc_depends
      ${vtkpython_pyc_depends}
      vtkRenderingPython
      vtkVolumeRenderingPython
      vtkHybridPython
      vtkWidgetsPython
      )
110
ENDIF (VTK_USE_RENDERING)
111

Andy Cedilnik's avatar
Andy Cedilnik committed
112
IF (VTK_USE_PARALLEL)
Alexander Neundorf's avatar
   
Alexander Neundorf committed
113
  SET(VTKPYTHON_LINK_LIBS ${VTKPYTHON_LINK_LIBS} vtkParallel)
114
115
116
117
  SET(vtkpython_pyc_depends
      ${vtkpython_pyc_depends}
      vtkParallelPython
      )
Andy Cedilnik's avatar
Andy Cedilnik committed
118
ENDIF (VTK_USE_PARALLEL)
Brad King's avatar
Brad King committed
119

120
IF (VTK_USE_INFOVIS)
Alexander Neundorf's avatar
   
Alexander Neundorf committed
121
  SET(VTKPYTHON_LINK_LIBS ${VTKPYTHON_LINK_LIBS} vtkInfovis)
122
123
124
125
126
127
  SET(vtkpython_pyc_depends
      ${vtkpython_pyc_depends}
      vtkInfovisPython
      )
ENDIF (VTK_USE_INFOVIS)

128
129
130
131
132
133
134
135
IF (VTK_USE_VIEWS)
  SET(VTKPYTHON_LINK_LIBS ${VTKPYTHON_LINK_LIBS} vtkViews)
  SET(vtkpython_pyc_depends
      ${vtkpython_pyc_depends}
      vtkViewsPython
      )
ENDIF (VTK_USE_VIEWS)

Alexander Neundorf's avatar
   
Alexander Neundorf committed
136
137
138
139
IF(PY_STATIC_MODULES_LIST)
  SET(VTKPYTHON_LINK_LIBS ${VTKPYTHON_LINK_LIBS} ${PY_STATIC_MODULES_LIST})
ENDIF(PY_STATIC_MODULES_LIST)

140
# Link to rt to prevent undefined symbol 'fdatasync'
Alexander Neundorf's avatar
   
Alexander Neundorf committed
141
142
143
144
145
146
IF(CMAKE_SYSTEM MATCHES "SunOS.*" AND NOT CMAKE_COMPILER_IS_GNUCXX)
  FIND_LIBRARY(VTK_SUNCC_RT_LIBRARY rt)
  IF(VTK_SUNCC_RT_LIBRARY)
    SET(VTKPYTHON_LINK_LIBS ${VTKPYTHON_LINK_LIBS} ${VTK_SUNCC_RT_LIBRARY})
  ENDIF(VTK_SUNCC_RT_LIBRARY)
ENDIF(CMAKE_SYSTEM MATCHES "SunOS.*" AND NOT CMAKE_COMPILER_IS_GNUCXX)
147

Alexander Neundorf's avatar
   
Alexander Neundorf committed
148
149
150
IF(VTK_WRAP_TCL)
  TARGET_LINK_LIBRARIES(vtkpython ${VTK_TK_LIBRARIES})
ENDIF(VTK_WRAP_TCL)
151

Alexander Neundorf's avatar
   
Alexander Neundorf committed
152
153
154
155
156
TARGET_LINK_LIBRARIES(vtkpython ${VTKPYTHON_LINK_LIBS})

SET_TARGET_PROPERTIES(vtkpython PROPERTIES LINK_FLAGS "${VTKPYTHON_LINK_FLAGS}")

SET(PVTKPYTHON_EXECUTABLE)
157
# Create the pvtkpython Python wrapper executable with MPI support.
Alexander Neundorf's avatar
   
Alexander Neundorf committed
158
159
160
161
162
163
164
165
166
167
168
169
170
171
IF (VTK_USE_PARALLEL AND VTK_USE_MPI)
  # Needed for mpich 2
  ADD_DEFINITIONS("-DMPICH_IGNORE_CXX_SEEK")

  SET(PVTKPYTHON_EXECUTABLE pvtkpython)
  ADD_EXECUTABLE(pvtkpython vtkParaPythonAppInit.cxx)
  TARGET_LINK_LIBRARIES(pvtkpython ${VTKPYTHON_LINK_LIBS})
  SET_TARGET_PROPERTIES(pvtkpython PROPERTIES LINK_FLAGS "${VTKPYTHON_LINK_FLAGS}")

  IF(VTK_USE_CARBON AND VTK_APPLE_RESOURCE)
      ADD_CUSTOM_COMMAND( TARGET pvtkpython POST_BUILD
                          COMMAND ${VTK_APPLE_RESOURCE} Carbon.r -o ${VTK_EXECUTABLE_DIR}/pvtkpython )
  ENDIF(VTK_USE_CARBON AND VTK_APPLE_RESOURCE)
ENDIF (VTK_USE_PARALLEL AND VTK_USE_MPI)
172

173
IF(NOT VTK_INSTALL_NO_RUNTIME)
Alexander Neundorf's avatar
   
Alexander Neundorf committed
174
  INSTALL(TARGETS vtkpython ${PVTKPYTHON_EXECUTABLE}
175
176
177
178
    RUNTIME DESTINATION ${VTK_INSTALL_BIN_DIR_CM24} COMPONENT RuntimeExecutables # .exe, .dll
    LIBRARY DESTINATION ${VTK_INSTALL_LIB_DIR_CM24} COMPONENT RuntimeLibraries # .so, mod.dll
    ARCHIVE DESTINATION ${VTK_INSTALL_LIB_DIR_CM24} COMPONENT Development      # .a, .lib
    )
179
ENDIF(NOT VTK_INSTALL_NO_RUNTIME)
Andy Cedilnik's avatar
Andy Cedilnik committed
180

181
182
183
184
185
186
187
188
# Handle out-of-source builds correctly.
#
#  1. Create a list of Python files to be installed/copied.
#  2. Copy them to VTK_BINARY_DIR if it is different from VTK_SOURCE_DIR.
#  3. Use Python's compileall to compile the copied files.
#
# *** Step 1 has to be done carefully to avoid missing out files ***

189
IF(PYTHON_EXECUTABLE)
190
# Make the necessary directories.
Alexander Neundorf's avatar
   
Alexander Neundorf committed
191
192
193
194
195
196
197
    FILE(MAKE_DIRECTORY  ${VTK_BINARY_DIR}/Wrapping/Python/vtk/gtk
                         ${VTK_BINARY_DIR}/Wrapping/Python/vtk/qt
                         ${VTK_BINARY_DIR}/Wrapping/Python/vtk/qt4
                         ${VTK_BINARY_DIR}/Wrapping/Python/vtk/tk
                         ${VTK_BINARY_DIR}/Wrapping/Python/vtk/util
                         ${VTK_BINARY_DIR}/Wrapping/Python/vtk/wx
                         ${VTK_BINARY_DIR}/Wrapping/Python/vtk/test )
198

199
200
201
202
# Now create a list of Python files.

# Wrapping/Python/vtk/*.py
  SET(VTK_PYTHON_FILES 
203
204
205
206
    vtk/__helper
    vtk/__init__
    vtk/common
    vtk/filtering
207
    vtk/genericfiltering
208
209
210
211
    vtk/graphics
    vtk/hybrid
    vtk/imaging
    vtk/io
Berk Geveci's avatar
Berk Geveci committed
212
    vtk/infovis
213
214
215
    vtk/parallel
    vtk/rendering
    vtk/required
216
    vtk/views
217
    vtk/volumerendering
218
    vtk/widgets
219
220
221
222
223
    )

# vtk.util package
  SET(VTK_PYTHON_FILES 
    ${VTK_PYTHON_FILES}
224
225
226
227
228
229
230
    vtk/util/__init__
    vtk/util/vtkMethodParser
    vtk/util/misc
    vtk/util/vtkConstants
    vtk/util/vtkImageExportToArray
    vtk/util/vtkImageImportFromArray
    vtk/util/colors
231
    vtk/util/numpy_support
232
233
234
235
236
    )

# vtk.test package
  SET(VTK_PYTHON_FILES 
    ${VTK_PYTHON_FILES}
237
238
239
    vtk/test/BlackBox
    vtk/test/Testing
    vtk/test/__init__
240
241
    )

242
243
244
245
246
247
248
249
250
251
252
# Tk related files
  SET(VTK_PYTHON_FILES 
    ${VTK_PYTHON_FILES}
    vtk/tk/__init__
    vtk/tk/vtkLoadPythonTkWidgets
    vtk/tk/vtkTkImageViewerWidget
    vtk/tk/vtkTkRenderWidget
    vtk/tk/vtkTkRenderWindowInteractor
    vtk/tk/vtkTkPhotoImage
    )

253
# PyQt v3 related files
254
  SET(VTK_PYTHON_FILES 
255
    ${VTK_PYTHON_FILES}
256
257
258
    vtk/qt/QVTKRenderWidget
    vtk/qt/__init__
    vtk/qt/QVTKRenderWindowInteractor
259
    )
260

261
262
263
264
265
266
267
# PyQt v4 related files
  SET(VTK_PYTHON_FILES 
    ${VTK_PYTHON_FILES}
    vtk/qt4/__init__
    vtk/qt4/QVTKRenderWindowInteractor
    )

268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
# wxPython related files
  SET(VTK_PYTHON_FILES 
    ${VTK_PYTHON_FILES}
    vtk/wx/__init__
    vtk/wx/wxVTKRenderWindow
    vtk/wx/wxVTKRenderWindowInteractor
    )

# pyGTK related files
  SET(VTK_PYTHON_FILES 
    ${VTK_PYTHON_FILES}
    vtk/gtk/GtkVTKRenderWindow
    vtk/gtk/__init__
    vtk/gtk/GtkVTKRenderWindowInteractor
    )

# Done listing of files.

# Now copy these files if necessary.
Andy Cedilnik's avatar
Andy Cedilnik committed
287
288
289
290
291
292
293
  SET(VTK_PYTHON_SOURCE_FILES)
  SET(VTK_PYTHON_OUTPUT_FILES)
  FOREACH(file ${VTK_PYTHON_FILES})
    SET(src "${VTK_BINARY_DIR}/Wrapping/Python/${file}.py")
    SET(VTK_PYTHON_SOURCE_FILES ${VTK_PYTHON_SOURCE_FILES} ${src})
  ENDFOREACH(file)

Alexander Neundorf's avatar
   
Alexander Neundorf committed
294
  IF (NOT "${VTK_BINARY_DIR}" MATCHES "^${VTK_SOURCE_DIR}$")
295
296
297
    FOREACH(file ${VTK_PYTHON_FILES})
      SET(src "${VTK_SOURCE_DIR}/Wrapping/Python/${file}.py")
      SET(tgt "${VTK_BINARY_DIR}/Wrapping/Python/${file}.py")
298
      ADD_CUSTOM_COMMAND(DEPENDS ${src}
Alexander Neundorf's avatar
   
Alexander Neundorf committed
299
                         COMMAND ${CMAKE_COMMAND} -E copy ${src} ${tgt}
300
                         OUTPUT ${tgt}
301
                         COMMENT "source copy")
302
    ENDFOREACH(file)
Alexander Neundorf's avatar
   
Alexander Neundorf committed
303
  ENDIF (NOT "${VTK_BINARY_DIR}" MATCHES "^${VTK_SOURCE_DIR}$")
304

305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
  # handle the different configuration types (each will have identical files)
  SET(VTK_PYTHON_CONFIGURATION_TYPES ${CMAKE_CONFIGURATION_TYPES})
  IF(VTK_PYTHON_CONFIGURATION_TYPES)
    FOREACH(config ${VTK_PYTHON_CONFIGURATION_TYPES})
      FOREACH(file ${VTK_PYTHON_FILES})
        SET(src "${VTK_SOURCE_DIR}/Wrapping/Python/${file}.py")
        SET(tgt "${VTK_BINARY_DIR}/Wrapping/Python/${config}/${file}.py")
        ADD_CUSTOM_COMMAND(DEPENDS ${src}
                           COMMAND ${CMAKE_COMMAND}
                           ARGS -E copy ${src} ${tgt}
                           OUTPUT ${tgt}
                           COMMENT "source copy")
      ENDFOREACH(file)
    ENDFOREACH(config)
  ENDIF(VTK_PYTHON_CONFIGURATION_TYPES)

321
322
323
324
  # Byte compile the Python files.
  CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/compile_all_vtk.py.in
                 ${CMAKE_CURRENT_BINARY_DIR}/compile_all_vtk.py
                 @ONLY IMMEDIATE)
325
  ADD_CUSTOM_COMMAND(
Alexander Neundorf's avatar
   
Alexander Neundorf committed
326
    COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/compile_all_vtk.py
327
    DEPENDS ${VTK_PYTHON_SOURCE_FILES} ${CMAKE_CURRENT_BINARY_DIR}/compile_all_vtk.py
328
    OUTPUT "${VTK_BINARY_DIR}/Wrapping/Python/vtk_compile_complete"
329
    )
330

331
332
333
  # Create a target on which custom commands can depend.  When this
  # is up-to-date, it is safe to run VTK python code.  Therefore
  # this should also depend on the vtkpython executable.
334
335
  ADD_CUSTOM_TARGET(vtkpython_pyc ALL echo "..."
    DEPENDS "${VTK_BINARY_DIR}/Wrapping/Python/vtk_compile_complete")
336
337
338
  ADD_DEPENDENCIES(vtkpython_pyc 
      vtkpython
      ${vtkpython_pyc_depends})
339

340
341
342
343
344
  # If no runtime is to be installed then do not install python modules.
  IF(VTK_INSTALL_NO_RUNTIME)
    SET(VTK_INSTALL_NO_PYTHON 1)
  ENDIF(VTK_INSTALL_NO_RUNTIME)

345
346
347
  # Add a rule to use python distutils to install the python wrappers.
  IF(NOT VTK_INSTALL_NO_PYTHON)
    SET(DOLLAR "$")
348
 
349
    # Create default python setup arguments if they are not set.
Alexander Neundorf's avatar
   
Alexander Neundorf committed
350
    IF(NOT DEFINED VTK_PYTHON_SETUP_ARGS)
351
352
      SET(VTK_PYTHON_SETUP_ARGS "--prefix=\"${DOLLAR}{CMAKE_INSTALL_PREFIX}\""
        CACHE STRING "Arguments passed to \"python setup.py install ...\" during installation.")
Alexander Neundorf's avatar
   
Alexander Neundorf committed
353
    ENDIF(NOT DEFINED VTK_PYTHON_SETUP_ARGS)
354

355
356
    # Change dollar sign to DOLLARSIGN
    STRING(REGEX REPLACE "\\${DOLLAR}" "DOLLARSIGN"
357
      PYTHON_SETUP_ARGS "${VTK_PYTHON_SETUP_ARGS}")
358
359
360
361
362
363
364
365
366
367
368
369
370

    # Get the install path for python modules
    EXEC_PROGRAM("${PYTHON_EXECUTABLE}" "${VTK_SOURCE_DIR}/Wrapping/Python"
      ARGS "setup_install_paths.py" "purelib" ${PYTHON_SETUP_ARGS}
      OUTPUT_VARIABLE PYTHON_MODULE_INSTALL_DIR)

    # Get the install path for binary python modules
    EXEC_PROGRAM("${PYTHON_EXECUTABLE}" "${VTK_SOURCE_DIR}/Wrapping/Python"
      ARGS "setup_install_paths.py" "platlib" ${PYTHON_SETUP_ARGS}
      OUTPUT_VARIABLE PYTHON_MODULE_PLATFORM_INSTALL_DIR)

    # Change DOLLARSIGN to dollar sign
    STRING(REGEX REPLACE "DOLLARSIGN" "${DOLLAR}"
371
      PYTHON_MODULE_INSTALL_DIR "${PYTHON_MODULE_INSTALL_DIR}")
372
    STRING(REGEX REPLACE "DOLLARSIGN" "${DOLLAR}"
373
374
      PYTHON_MODULE_PLATFORM_INSTALL_DIR
      "${PYTHON_MODULE_PLATFORM_INSTALL_DIR}")
375

376
377
378
    # Replace backslashes with forward slashes
    IF (WIN32)
      STRING(REGEX REPLACE "\\\\" "/" PYTHON_MODULE_INSTALL_DIR
379
        "${PYTHON_MODULE_INSTALL_DIR}")
380
      STRING(REGEX REPLACE "\\\\" "/" PYTHON_MODULE_PLATFORM_INSTALL_DIR
381
        "${PYTHON_MODULE_PLATFORM_INSTALL_DIR}")
382
383
    ENDIF (WIN32)

384
    SET(VTK_PYTHON_MODULE_INSTALL_DIR "${PYTHON_MODULE_INSTALL_DIR}"
385
386
387
      CACHE INTERNAL "Install directory for Python .py and .pyc files")

    SET(VTK_PYTHON_MODULE_PLATFORM_INSTALL_DIR
388
      "${PYTHON_MODULE_PLATFORM_INSTALL_DIR}"
389
390
      CACHE INTERNAL "Install directory for Python binary modules")

391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
    # If there are multiple configurations then add a BUILD_TYPE=...
    # argument to the python setup.py call.  The build type to use is set
    # in the CMake variable BUILD_TYPE while running the install script.
    IF(CMAKE_CONFIGURATION_TYPES)
      SET(VTK_PYTHON_SETUP_BUILD_TYPE "BUILD_TYPE=${DOLLAR}{BUILD_TYPE}")
    ELSE(CMAKE_CONFIGURATION_TYPES)
      SET(VTK_PYTHON_SETUP_BUILD_TYPE)
    ENDIF(CMAKE_CONFIGURATION_TYPES)

    # Configure the post-install script to run python on setup.py.
    CONFIGURE_FILE(${VTK_SOURCE_DIR}/Wrapping/Python/PythonInstall.cmake.in
                   ${VTK_BINARY_DIR}/Wrapping/Python/PythonInstall.cmake
                   @ONLY IMMEDIATE)
    SET_TARGET_PROPERTIES(vtkpython_pyc PROPERTIES POST_INSTALL_SCRIPT
      ${VTK_BINARY_DIR}/Wrapping/Python/PythonInstall.cmake
      )
  ENDIF(NOT VTK_INSTALL_NO_PYTHON)
408
ENDIF(PYTHON_EXECUTABLE)
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
# Create the setup.py file.
IF(CMAKE_CONFIGURATION_TYPES)
  # The build has multiple configuration types.  If CMAKE_BUILD_TYPE
  # is set use it as the default BUILD_TYPE for setup.py to install.
  SET(VTK_PYTHON_HAS_CONFIG_TYPES 1)
  IF(CMAKE_BUILD_TYPE)
    SET(VTK_PYTHON_BUILD_TYPE "\"${CMAKE_BUILD_TYPE}\"")
  ELSE(CMAKE_BUILD_TYPE)
    SET(VTK_PYTHON_BUILD_TYPE "[]")
  ENDIF(CMAKE_BUILD_TYPE)
ELSE(CMAKE_CONFIGURATION_TYPES)
  # The build has one configuration type.  The build type does not
  # affect installation.
  SET(VTK_PYTHON_HAS_CONFIG_TYPES 0)
  SET(VTK_PYTHON_BUILD_TYPE "[]")
ENDIF(CMAKE_CONFIGURATION_TYPES)
IF(VTK_USE_RENDERING)
  SET(VTK_PYTHON_USE_RENDERING 1)
ELSE(VTK_USE_RENDERING)
  SET(VTK_PYTHON_USE_RENDERING 0)
ENDIF(VTK_USE_RENDERING)
IF(VTK_USE_PARALLEL)
  SET(VTK_PYTHON_USE_PARALLEL 1)
ELSE(VTK_USE_PARALLEL)
  SET(VTK_PYTHON_USE_PARALLEL 0)
ENDIF(VTK_USE_PARALLEL)
436
437
438
439
440
IF(VTK_USE_INFOVIS)
  SET(VTK_PYTHON_USE_INFOVIS 1)
ELSE(VTK_USE_INFOVIS)
  SET(VTK_PYTHON_USE_INFOVIS 0)
ENDIF(VTK_USE_INFOVIS)
441
442
443
444
445
IF(VTK_USE_VIEWS)
  SET(VTK_PYTHON_USE_VIEWS 1)
ELSE(VTK_USE_VIEWS)
  SET(VTK_PYTHON_USE_VIEWS 0)
ENDIF(VTK_USE_VIEWS)
446
447
448
449
450
451
452
453
IF(VTK_USE_MPI)
  SET(VTK_PYTHON_USE_MPI 1)
ELSE(VTK_USE_MPI)
  SET(VTK_PYTHON_USE_MPI 0)
ENDIF(VTK_USE_MPI)
CONFIGURE_FILE(${VTK_SOURCE_DIR}/Wrapping/Python/setup.py.in
               ${VTK_BINARY_DIR}/Wrapping/Python/setup.py @ONLY IMMEDIATE)

Andy Cedilnik's avatar
Andy Cedilnik committed
454
455
# Allow the user to customize their build with some local options
#
Brad King's avatar
Brad King committed
456
457
INCLUDE (${VTK_BINARY_DIR}/Wrapping/Tcl/LocalUserOptions.cmake OPTIONAL)
INCLUDE (${VTK_SOURCE_DIR}/Wrapping/Tcl/LocalUserOptions.cmake OPTIONAL)