CMakeLists.txt 29 KB
Newer Older
Philippe Pebay's avatar
Philippe Pebay committed
1
SET(KIT Rendering)
2
SET(UKIT RENDERING)
3
SET(KIT_TCL_LIBS vtkGraphicsTCL vtkImagingTCL ${VTK_TK_LIBRARIES})
4
SET(KIT_PYTHON_LIBS vtkGraphicsPythonD vtkImagingPythonD)
5
SET(KIT_JAVA_LIBS vtkGraphicsJava vtkImagingJava)
Alexander Neundorf's avatar
 
Alexander Neundorf committed
6

7 8 9
IF (JAVA_AWT_LIBRARY)
  SET(KIT_JAVA_LIBS ${KIT_JAVA_LIBS} ${JAVA_AWT_LIBRARY})
ENDIF (JAVA_AWT_LIBRARY)
Alexander Neundorf's avatar
 
Alexander Neundorf committed
10

11
SET(KIT_INTERFACE_LIBRARIES vtkGraphics vtkImaging)
12
SET(KIT_LIBS vtkIO vtkftgl
13
  ${VTK_FREETYPE_LIBRARIES}
14
)
15 16 17 18 19
#INCLUDE(${VTK_CMAKE_DIR}/vtkTestGL.cmake)
#INCLUDE(${VTK_CMAKE_DIR}/vtkTestGLX.cmake)



20

21 22 23 24 25 26
# Fix for bug#1026 moved out of the common section.  This should be
# changed to add the flag only in the right places (CMAKE_CXX_FLAGS?).
IF(APPLE AND VTK_WRAP_JAVA)
  ADD_DEFINITIONS("-ObjC++")
ENDIF(APPLE AND VTK_WRAP_JAVA)

Andy Cedilnik's avatar
Andy Cedilnik committed
27
SET( Kit_SRCS
Alexander Neundorf's avatar
 
Alexander Neundorf committed
28 29 30
  vtkAbstractMapper3D.cxx
  vtkAbstractPicker.cxx
  vtkAbstractPropPicker.cxx
31
  vtkAbstractVolumeMapper.cxx
Alexander Neundorf's avatar
 
Alexander Neundorf committed
32
  vtkActorCollection.cxx
33
  vtkActor.cxx
Alexander Neundorf's avatar
 
Alexander Neundorf committed
34
  vtkAreaPicker.cxx
35
  vtkMapArrayValues.cxx
Alexander Neundorf's avatar
 
Alexander Neundorf committed
36 37 38
  vtkAssembly.cxx
  vtkAxisActor2D.cxx
  vtkCamera.cxx
Francois Bertel's avatar
Francois Bertel committed
39
  vtkCameraActor.cxx
Alexander Neundorf's avatar
 
Alexander Neundorf committed
40 41 42 43 44 45
  vtkCameraInterpolator.cxx
  vtkCellCenterDepthSort.cxx
  vtkCellPicker.cxx
  vtkChooserPainter.cxx
  vtkClipPlanesPainter.cxx
  vtkCoincidentTopologyResolutionPainter.cxx
46
  vtkColorMaterialHelper.cxx
47
  vtkCompositePainter.cxx
48 49
  vtkCompositePolyDataMapper2.cxx
  vtkCompositePolyDataMapper.cxx
Alexander Neundorf's avatar
 
Alexander Neundorf committed
50
  vtkCullerCollection.cxx
51
  vtkCuller.cxx
Alexander Neundorf's avatar
 
Alexander Neundorf committed
52
  vtkDataSetMapper.cxx
53
  vtkDataTransferHelper.cxx
Alexander Neundorf's avatar
 
Alexander Neundorf committed
54 55
  vtkDefaultPainter.cxx
  vtkDisplayListPainter.cxx
56
  vtkDistanceToCamera.cxx
Alexander Neundorf's avatar
 
Alexander Neundorf committed
57
  vtkDynamic2DLabelMapper.cxx
58
  vtkDummyGPUInfoList.cxx
Alexander Neundorf's avatar
 
Alexander Neundorf committed
59 60
  vtkExporter.cxx
  vtkFollower.cxx
61
  vtkFrameBufferObject.cxx
Alexander Neundorf's avatar
 
Alexander Neundorf committed
62 63
  vtkFrustumCoverageCuller.cxx
  vtkGenericRenderWindowInteractor.cxx
64
  vtkGenericVertexAttributeMapping.cxx
65 66
  vtkGPUInfo.cxx
  vtkGPUInfoList.cxx
Alexander Neundorf's avatar
 
Alexander Neundorf committed
67
  vtkGraphicsFactory.cxx
68
  vtkGraphMapper.cxx
69
  vtkGraphToGlyphs.cxx
70 71
  vtkHardwareSelector.cxx
  vtkHardwareSelectionPolyDataPainter.cxx
Alexander Neundorf's avatar
 
Alexander Neundorf committed
72 73 74 75
  vtkHierarchicalPolyDataMapper.cxx
  vtkImageActor.cxx
  vtkImageMapper.cxx
  vtkImageViewer2.cxx
76
  vtkImageViewer.cxx
Alexander Neundorf's avatar
 
Alexander Neundorf committed
77 78 79 80 81 82 83 84 85
  vtkImagingFactory.cxx
  vtkImporter.cxx
  vtkInteractorEventRecorder.cxx
  vtkInteractorObserver.cxx
  vtkInteractorStyle.cxx
  vtkInteractorStyleFlight.cxx
  vtkInteractorStyleImage.cxx
  vtkInteractorStyleJoystickActor.cxx
  vtkInteractorStyleJoystickCamera.cxx
86 87
  vtkInteractorStyleRubberBand2D.cxx
  vtkInteractorStyleRubberBand3D.cxx
Alexander Neundorf's avatar
 
Alexander Neundorf committed
88 89 90 91 92 93
  vtkInteractorStyleRubberBandPick.cxx
  vtkInteractorStyleRubberBandZoom.cxx
  vtkInteractorStyleSwitch.cxx
  vtkInteractorStyleTerrain.cxx
  vtkInteractorStyleTrackballActor.cxx
  vtkInteractorStyleTrackballCamera.cxx
94
  vtkInteractorStyleTrackball.cxx
Alexander Neundorf's avatar
 
Alexander Neundorf committed
95 96
  vtkInteractorStyleUnicam.cxx
  vtkInteractorStyleUser.cxx
97
  vtkIVExporter.cxx
Alexander Neundorf's avatar
 
Alexander Neundorf committed
98
  vtkLabeledDataMapper.cxx
99
  vtkLabeledTreeMapDataMapper.cxx
100 101 102
  vtkLabelHierarchy.cxx
  vtkLabelHierarchyAlgorithm.cxx
  vtkLabelHierarchyIterator.cxx
Jeff Baumes's avatar
Jeff Baumes committed
103
  vtkLabelHierarchyCompositeIterator.cxx
104
  vtkLabelPlacer.cxx
Jeff Baumes's avatar
Jeff Baumes committed
105 106
  vtkLabelPlacementMapper.cxx
  vtkLabelRenderStrategy.cxx
107
  vtkLabelSizeCalculator.cxx
Alexander Neundorf's avatar
 
Alexander Neundorf committed
108
  vtkLeaderActor2D.cxx
Francois Bertel's avatar
Francois Bertel committed
109
  vtkLightActor.cxx
Alexander Neundorf's avatar
 
Alexander Neundorf committed
110
  vtkLightCollection.cxx
111
  vtkLight.cxx
112
  vtkLightingHelper.cxx
Alexander Neundorf's avatar
 
Alexander Neundorf committed
113
  vtkLightingPainter.cxx
114
  vtkLightKit.cxx
115
  vtkLineIntegralConvolution2D.cxx
Alexander Neundorf's avatar
 
Alexander Neundorf committed
116
  vtkLinesPainter.cxx
117 118
  vtkLODActor.cxx
  vtkLODProp3D.cxx
Alexander Neundorf's avatar
 
Alexander Neundorf committed
119
  vtkMapperCollection.cxx
120
  vtkMapper.cxx
Alexander Neundorf's avatar
 
Alexander Neundorf committed
121 122 123 124 125 126 127
  vtkOBJExporter.cxx
  vtkObserverMediator.cxx
  vtkOOGLExporter.cxx
  vtkPainter.cxx
  vtkPainterDeviceAdapter.cxx
  vtkPainterPolyDataMapper.cxx
  vtkParallelCoordinatesActor.cxx
128
  vtkParallelCoordinatesInteractorStyle.cxx
Alexander Neundorf's avatar
 
Alexander Neundorf committed
129
  vtkPicker.cxx
130
  vtkPixelBufferObject.cxx
Alexander Neundorf's avatar
 
Alexander Neundorf committed
131
  vtkPointPicker.cxx
132
  vtkPointSetToLabelHierarchy.cxx
133
  vtkPointsPainter.cxx
134
  vtkPOVExporter.cxx
Alexander Neundorf's avatar
 
Alexander Neundorf committed
135
  vtkPolyDataMapper2D.cxx
136
  vtkPolyDataMapper.cxx
Alexander Neundorf's avatar
 
Alexander Neundorf committed
137 138 139 140
  vtkPolyDataPainter.cxx
  vtkPolygonsPainter.cxx
  vtkPrimitivePainter.cxx
  vtkProp3DCollection.cxx
141
  vtkProp3D.cxx
Alexander Neundorf's avatar
 
Alexander Neundorf committed
142
  vtkProperty.cxx
143
  vtkPropPicker.cxx
144
  vtkQuadricLODActor.cxx
Alexander Neundorf's avatar
 
Alexander Neundorf committed
145 146 147
  vtkQuaternionInterpolator.cxx
  vtkRenderedAreaPicker.cxx
  vtkRendererCollection.cxx
148
  vtkRenderer.cxx
149
  vtkRendererDelegate.cxx
Alexander Neundorf's avatar
 
Alexander Neundorf committed
150
  vtkRendererSource.cxx
151 152
  vtkRenderPass.cxx
  vtkRenderState.cxx
153 154 155
  vtkRenderWindowCollection.cxx
  vtkRenderWindow.cxx
  vtkRenderWindowInteractor.cxx
Alexander Neundorf's avatar
 
Alexander Neundorf committed
156 157 158 159 160 161 162
  vtkRepresentationPainter.cxx
  vtkScalarBarActor.cxx
  vtkScalarsToColorsPainter.cxx
  vtkScaledTextActor.cxx
  vtkScenePicker.cxx
  vtkSelectVisiblePoints.cxx
  vtkShader.cxx
163
  vtkShaderDeviceAdapter.cxx
Alexander Neundorf's avatar
 
Alexander Neundorf committed
164 165
  vtkShaderProgram.cxx
  vtkStandardPolyDataPainter.cxx
166 167
  vtkSurfaceLICDefaultPainter.cxx
  vtkSurfaceLICPainter.cxx
168 169
  vtkTDxInteractorStyle.cxx
  vtkTDxInteractorStyleCamera.cxx
170
  vtkTDxInteractorStyleGeo.cxx
171
  vtkTDxInteractorStyleSettings.cxx
Alexander Neundorf's avatar
 
Alexander Neundorf committed
172
  vtkTesting.cxx
173 174
  vtkTestingInteractor.cxx
  vtkTestingObjectFactory.cxx
Alexander Neundorf's avatar
 
Alexander Neundorf committed
175 176
  # vtkTextActor2D.cxx
  vtkTextActor3D.cxx
177
  vtkTextActor.cxx
Alexander Neundorf's avatar
 
Alexander Neundorf committed
178 179 180
  vtkTextMapper.cxx
  vtkTextProperty.cxx
  vtkTexture.cxx
181
  vtkTexturedActor2D.cxx
182
  vtkTextureObject.cxx
Alexander Neundorf's avatar
 
Alexander Neundorf committed
183 184 185
  vtkTransformInterpolator.cxx
  vtkTStripsPainter.cxx
  vtkTupleInterpolator.cxx
186
  vtkViewTheme.cxx
Alexander Neundorf's avatar
 
Alexander Neundorf committed
187 188
  vtkVisibilitySort.cxx
  vtkVolumeCollection.cxx
189
  vtkVolume.cxx
Alexander Neundorf's avatar
 
Alexander Neundorf committed
190
  vtkVolumeProperty.cxx
191
  vtkVRMLExporter.cxx
Alexander Neundorf's avatar
 
Alexander Neundorf committed
192 193 194
  vtkWindowToImageFilter.cxx
  vtkWorldPointPicker.cxx
  )
Ken Martin's avatar
Ken Martin committed
195

196 197 198 199 200 201 202 203
IF (NOT VTK_LEGACY_REMOVE)
  SET (Kit_Deprecated_SRCS
    vtkVisibleCellSelector.cxx
    vtkIdentColoredPainter.cxx)

  SET (Kit_SRCS ${Kit_SRCS} ${Kit_Deprecated_SRCS})
ENDIF (NOT VTK_LEGACY_REMOVE)

204
IF(VTK_USE_GL2PS)
205
  SET(Kit_SRCS ${Kit_SRCS} vtkGL2PSExporter.cxx)
206 207 208 209 210 211 212
   
  IF(VTK_USE_SYSTEM_GL2PS)
  ELSE(VTK_USE_SYSTEM_GL2PS)
    SET(Kit_GL2PS_SRCS ${VTK_SOURCE_DIR}/Utilities/vtkgl2ps/gl2ps.c)
    ADD_DEFINITIONS(-DGL2PS_HAVE_ZLIB)
    ADD_DEFINITIONS(-DGL2PS_HAVE_LIBPNG)
  ENDIF(VTK_USE_SYSTEM_GL2PS)
213 214
ENDIF(VTK_USE_GL2PS)

215 216 217
IF(VTK_USE_CG_SHADERS)
  SET(Kit_SRCS ${Kit_SRCS} 
    vtkCgShader.cxx
218
    vtkCgShaderDeviceAdapter.cxx
219 220 221 222 223 224 225
    vtkCgShaderProgram.cxx
    )
  INCLUDE_DIRECTORIES(${CG_INCLUDE_PATH})
  SET (KIT_LIBS ${KIT_LIBS} ${CG_LIBRARY} ${CG_GL_LIBRARY})
ENDIF(VTK_USE_CG_SHADERS)


Andy Cedilnik's avatar
Andy Cedilnik committed
226
SET( KitOpenGL_SRCS
227
  vtkCameraPass.cxx
228
  vtkClearZPass.cxx
229 230
  vtkDefaultPass.cxx
  vtkDepthPeelingPass.cxx
231
  vtkGaussianBlurPass.cxx
232
  vtkImageProcessingPass.cxx
233
  vtkLightsPass.cxx
234
  vtkGLSLShaderDeviceAdapter2.cxx
235
  vtkOpaquePass.cxx
Ken Martin's avatar
Ken Martin committed
236 237
  vtkOpenGLActor.cxx
  vtkOpenGLCamera.cxx
238 239 240
  vtkOpenGLClipPlanesPainter.cxx
  vtkOpenGLCoincidentTopologyResolutionPainter.cxx
  vtkOpenGLDisplayListPainter.cxx
241
  vtkOpenGLExtensionManager.cxx
242
  vtkOpenGLHardwareSupport.cxx
Ken Martin's avatar
Ken Martin committed
243 244 245
  vtkOpenGLImageActor.cxx
  vtkOpenGLImageMapper.cxx
  vtkOpenGLLight.cxx
246 247
  vtkOpenGLLightingPainter.cxx
  vtkOpenGLPainterDeviceAdapter.cxx
Ken Martin's avatar
Ken Martin committed
248 249 250 251
  vtkOpenGLPolyDataMapper.cxx
  vtkOpenGLPolyDataMapper2D.cxx
  vtkOpenGLProperty.cxx
  vtkOpenGLRenderWindow.cxx
Brad King's avatar
Brad King committed
252
  vtkOpenGLRenderer.cxx
253 254
  vtkOpenGLRepresentationPainter.cxx
  vtkOpenGLScalarsToColorsPainter.cxx
255
  vtkOpenGLState.cxx
Ken Martin's avatar
Ken Martin committed
256
  vtkOpenGLTexture.cxx
257 258 259
  vtkOverlayPass.cxx
  vtkRenderPassCollection.cxx
  vtkSequencePass.cxx
260 261 262
  vtkShader2.cxx
  vtkShader2Collection.cxx
  vtkShaderProgram2.cxx
Francois Bertel's avatar
Francois Bertel committed
263
  vtkShadowMapPass.cxx
264
  vtkSobelGradientMagnitudePass.cxx
265
  vtkTextureUnitManager.cxx
266
  vtkTranslucentPass.cxx
267
  vtkUniformVariables.cxx
268
  vtkVolumetricPass.cxx
Ken Martin's avatar
Ken Martin committed
269 270
  )

271 272 273
IF(VTK_USE_GLSL_SHADERS)
  SET(KitOpenGL_SRCS ${KitOpenGL_SRCS}
    vtkGLSLShader.cxx
274
    vtkGLSLShaderDeviceAdapter.cxx
275 276 277
    vtkGLSLShaderProgram.cxx
    )
ENDIF(VTK_USE_GLSL_SHADERS)
278

Ken Martin's avatar
Ken Martin committed
279
SET_SOURCE_FILES_PROPERTIES(
Alexander Neundorf's avatar
 
Alexander Neundorf committed
280 281 282 283 284 285
  vtkAbstractMapper3D
  vtkAbstractVolumeMapper
  vtkAbstractPicker
  vtkAbstractPropPicker
  vtkCuller
  vtkExporter
286
  vtkGPUInfoList
287
  vtkImageProcessingPass
Alexander Neundorf's avatar
 
Alexander Neundorf committed
288 289
  vtkImporter
  vtkInteractorObserver
Jeff Baumes's avatar
Jeff Baumes committed
290
  vtkLabelRenderStrategy
Alexander Neundorf's avatar
 
Alexander Neundorf committed
291 292 293 294 295 296
  vtkMapper
  vtkOpenGLRenderWindow
  vtkPainter
  vtkPolyDataPainter
  vtkPrimitivePainter
  vtkProp3D
297
  vtkRendererDelegate
298 299
  vtkRenderPass
  vtkRenderState # not abstract just not using instantiator
Alexander Neundorf's avatar
 
Alexander Neundorf committed
300
  vtkShader
301
  vtkShaderDeviceAdapter
Alexander Neundorf's avatar
 
Alexander Neundorf committed
302
  vtkShaderProgram
303
  vtkTDxInteractorStyle
Alexander Neundorf's avatar
 
Alexander Neundorf committed
304 305 306
  vtkVisibilitySort.cxx
  ABSTRACT
  )
Ken Martin's avatar
Ken Martin committed
307

308
SET_SOURCE_FILES_PROPERTIES(
309
  vtkLightingHelper
310
  vtkRenderState
311
  vtkOpenGLState
312 313 314
  vtkShader2
  vtkShader2Collection
  vtkShaderProgram2
315
  vtkTextureUnitManager
316 317
  vtkTestingInteractor
  vtkTestingObjectFactory
318 319 320
  WRAP_EXCLUDE
  )

Andy Cedilnik's avatar
Andy Cedilnik committed
321 322
# Freetype stuff

Jeff Baumes's avatar
Jeff Baumes committed
323 324 325 326
SET(KitOpenGL_SRCS ${KitOpenGL_SRCS}
  vtkFreeTypeLabelRenderStrategy.cxx
  vtkOpenGLFreeTypeTextMapper.cxx
  )
Alexander Neundorf's avatar
 
Alexander Neundorf committed
327

328 329 330 331
# Get GPU VRAM info
# on Windows
#message("DirectX_FOUND=${DirectX_FOUND}")
if(DirectX_FOUND)
332
 set(Kit_SRCS ${Kit_SRCS} vtkDirectXGPUInfoList.cxx)
333 334 335 336
endif(DirectX_FOUND)

# on Mac
if(ApplicationServices_FOUND)
337
 set(Kit_SRCS ${Kit_SRCS} vtkCoreGraphicsGPUInfoList.cxx)
338
endif()
339 340 341

# on Linux, for Nvidia
if(VTK_USE_X)
342 343
 set(Kit_SRCS ${Kit_SRCS} vtkXGPUInfoList.cxx)
endif()
344

Alexander Neundorf's avatar
 
Alexander Neundorf committed
345
SET(Kit_SRCS ${Kit_SRCS} vtkFreeTypeUtilities.cxx )
346
SET_SOURCE_FILES_PROPERTIES(vtkFreeTypeUtilities WRAP_EXCLUDE)
Alexander Neundorf's avatar
 
Alexander Neundorf committed
347

Andy Cedilnik's avatar
Andy Cedilnik committed
348
SET(Kit_FT_SRCS 
349 350 351 352 353 354 355 356 357 358 359 360 361
  fonts/face_arial.cxx
  fonts/face_arial_bold.cxx
  fonts/face_arial_bold_italic.cxx
  fonts/face_arial_italic.cxx
  fonts/face_courier.cxx
  fonts/face_courier_bold.cxx
  fonts/face_courier_bold_italic.cxx
  fonts/face_courier_italic.cxx
  fonts/face_times.cxx
  fonts/face_times_bold.cxx
  fonts/face_times_bold_italic.cxx
  fonts/face_times_italic.cxx
)
362

Yves Starreveld's avatar
 
Yves Starreveld committed
363
IF(VTK_USE_X)
Alexander Neundorf's avatar
 
Alexander Neundorf committed
364
  SET( Kit_SRCS ${Kit_SRCS} vtkXRenderWindowInteractor.cxx)
Yves Starreveld's avatar
 
Yves Starreveld committed
365
ENDIF(VTK_USE_X)
Ken Martin's avatar
Ken Martin committed
366

367 368 369 370 371 372
# -----------------------------------------------------------------------------
# 3DConnexion device (SpaceNavigator, etc... ) on Unix.
IF(VTK_USE_X)
  OPTION(VTK_USE_TDX "Use 3Dconnexion device" OFF)
  MARK_AS_ADVANCED(VTK_USE_TDX)
  IF(VTK_USE_TDX)
373
   
374 375 376 377
   SET(VTK_TDX_INCLUDE_PATH CACHE PATH "Directory path to xdrvlib.h for 3DConnexion device")
   SET(VTK_TDX_OBJECT_PATH CACHE FILEPATH "File path to xdrvlib.a for 3DConnexion device")
   SET(Kit_SRCS ${Kit_SRCS} vtkTDxDevice.cxx vtkTDxUnixDevice.cxx)
   INCLUDE_DIRECTORIES(${VTK_TDX_INCLUDE_PATH})
378 379
   SET_SOURCE_FILES_PROPERTIES(vtkTDxDevice ABSTRACT)
   SET_SOURCE_FILES_PROPERTIES(vtkTDxUnixDevice WRAP_EXCLUDE)
380 381 382 383
   LIST(APPEND KIT_INTERFACE_LIBRARIES ${VTK_TDX_OBJECT_PATH})
  ENDIF()
ENDIF()
# -----------------------------------------------------------------------------
384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400
# 3DConnexion device (SpaceNavigator, etc... ) on Mac (not X11).
IF(VTK_USE_CARBON OR VTK_USE_COCOA)
  OPTION(VTK_USE_TDX "Use 3Dconnexion device" OFF)
  MARK_AS_ADVANCED(VTK_USE_TDX)
  IF(VTK_USE_TDX)
# framework is in /Library/Frameworks/3DconnexionClient.framework
   find_package(3DconnexionClient)
   if(3DconnexionClient_FOUND)
     set(KIT_LIBS ${KIT_LIBS} ${3DconnexionClient_LIBRARY})
     include_directories(${3DconnexionClient_INCLUDE_DIR})
   endif()
   SET(Kit_SRCS ${Kit_SRCS} vtkTDxDevice.cxx vtkTDxMacDevice.cxx)
   SET_SOURCE_FILES_PROPERTIES(vtkTDxDevice.cxx ABSTRACT)
   LIST(APPEND KIT_INTERFACE_LIBRARIES ${VTK_TDX_OBJECT_PATH})
  ENDIF()
ENDIF()
# -----------------------------------------------------------------------------
401 402
# 3DConnexion device (SpaceNavigator, etc... ) on Windows.
IF(WIN32)
403
  OPTION(VTK_USE_TDX "Use 3Dconnextion device" OFF)
404 405 406 407 408 409 410 411 412 413
  MARK_AS_ADVANCED(VTK_USE_TDX)
  IF(VTK_USE_TDX)
   SET(Kit_SRCS ${Kit_SRCS} vtkTDxDevice.cxx vtkTDxWinDevice.cxx)
   SET_SOURCE_FILES_PROPERTIES(vtkTDxDevice.cxx ABSTRACT)
  ENDIF()
ENDIF()
# -----------------------------------------------------------------------------
CONFIGURE_FILE(${VTK_SOURCE_DIR}/Rendering/vtkTDxConfigure.h.in
               ${VTK_BINARY_DIR}/Rendering/vtkTDxConfigure.h @ONLY IMMEDIATE)

414 415 416 417 418 419
IF(VTK_USE_QT)   
  SET(QT_DONT_USE_QTGUI)
  INCLUDE(${QT_USE_FILE})

  SET( Kit_SRCS ${Kit_SRCS}
    vtkQImageToImageSource.cxx
420
    vtkQtInitialization.cxx
Jeff Baumes's avatar
Jeff Baumes committed
421
    vtkQtLabelRenderStrategy.cxx
422 423
    vtkQtTreeRingLabelMapper.cxx
    )
424 425 426 427 428 429 430 431 432 433 434 435 436
  # On the Mac, make the QT_LIBRARIES KIT_INTERFACE_LIBRARIES. This is a
  # workaround a problem with the Qt binaries from Trolltech. These libraries
  # use install names that are relative. Then when the linker tries to pull them
  # indirectly (through vtkRendering's list of libraries), it fails to find them.
  # This does not happen when Qt is build from source because it uses absolute
  # path in install names. This workaround fixes the problem by forcing all libraries
  # and executables that depend on vtkRendering to also directly link to Qt libraries.
  IF (APPLE)
    LIST (APPEND KIT_INTERFACE_LIBRARIES ${QT_LIBRARIES})
  ELSE (APPLE)
    LIST (APPEND KIT_LIBS ${QT_LIBRARIES})
  ENDIF (APPLE)

437 438
ENDIF(VTK_USE_QT)

439 440
# The set of source files to be encoded.
SET(glsl_files
441
  vtkColorMaterialHelper_vs
442
  vtkDepthPeeling_fs
443
  vtkGaussianBlurPassShader_fs
Francois Bertel's avatar
Francois Bertel committed
444
  vtkLighting_s # s not vs or fs because it can be used in both.
445 446 447 448
  vtkLightingHelper_s # s not vs or fs because it can be used in both.
  vtkLineIntegralConvolution2D_fs
  vtkLineIntegralConvolution2D_fs1
  vtkLineIntegralConvolution2D_fs2
449
  vtkOpenGLRenderer_PeelingFS
450
  vtkOpenGLPropertyDefaultPropFunc_fs
451
  vtkOpenGLPropertyDefaultPropFunc_vs
452 453
  vtkOpenGLPropertyDefaultMain_fs
  vtkOpenGLPropertyDefaultMain_vs
454 455
  vtkSobelGradientMagnitudePassShader1_fs
  vtkSobelGradientMagnitudePassShader2_fs
Francois Bertel's avatar
Francois Bertel committed
456 457
  vtkShadowMapPassShader_fs
  vtkShadowMapPassShader_vs
458 459 460
  vtkSurfaceLICPainter_fs1
  vtkSurfaceLICPainter_fs2
  vtkSurfaceLICPainter_vs1
461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480
  )

# Create custom commands to encode each assembly file into a C string
# literal in a header file.

SET(glsl_h_files)
FOREACH(file ${glsl_files})
  SET(src ${VTK_SOURCE_DIR}/Rendering/${file}.glsl)
  SET(res ${VTK_BINARY_DIR}/Rendering/${file}.cxx)
  SET(resh ${VTK_BINARY_DIR}/Rendering/${file}.h)
  SET(glsl_h_files ${glsl_h_files} "${resh}")
  ADD_CUSTOM_COMMAND(
    OUTPUT ${res} ${resh}
    DEPENDS ${src} vtkEncodeString
    COMMAND ${VTK_ENCODESTRING_EXE}
    ARGS ${res} ${src} ${file} --build-header VTK_RENDERING_EXPORT vtkSystemIncludes.h
    )
  SET(Kit_EXTRA_SRCS ${Kit_EXTRA_SRCS} ${res})
ENDFOREACH(file)

481 482
# OpenGL extensions stuff.

483 484 485 486
IF(VTK_USE_X)
 INCLUDE(${VTK_CMAKE_DIR}/vtkTestGLX.cmake)
ENDIF(VTK_USE_X)

487 488
# Parse the extensions into vtkgl.h/vtkgl.cxx.
ADD_CUSTOM_COMMAND(
489 490
  OUTPUT ${VTK_BINARY_DIR}/Rendering/vtkgl.cxx
  COMMAND ${VTK_PARSEOGLEXT_EXE}
491
  ARGS ${VTK_BINARY_DIR}/Rendering ${VTK_GLEXT_FILE} ${VTK_GLXEXT_FILE} ${VTK_WGLEXT_FILE}
492 493
  DEPENDS ${VTK_GLEXT_FILE} ${VTK_GLXEXT_FILE} ${VTK_WGLEXT_FILE} ${VTK_PARSEOGLEXT_EXE}
  )
494

495 496 497
SET_SOURCE_FILES_PROPERTIES(vtkOpenGLExtensionManager.cxx
  PROPERTIES OBJECT_DEPENDS ${VTK_BINARY_DIR}/Rendering/vtkgl.cxx)

Alexander Neundorf's avatar
 
Alexander Neundorf committed
498 499 500
SET(KitOpenGL_SRCS ${KitOpenGL_SRCS} 
  ${VTK_BINARY_DIR}/Rendering/vtkgl.cxx 
  )
501 502 503 504 505

SET_SOURCE_FILES_PROPERTIES(
  # OK, so it's not abstract, but this stops the instantiator
  # from trying to call vtkRenderingInstantiatorvtkglNew():
  ${VTK_BINARY_DIR}/Rendering/vtkgl.cxx
506
  vtkLabelHierarchyIterator.cxx
507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526
  ABSTRACT
  )

SET_SOURCE_FILES_PROPERTIES(
  ${VTK_BINARY_DIR}/Rendering/vtkgl.cxx
  GENERATED
  )

SET_SOURCE_FILES_PROPERTIES(
  ${VTK_BINARY_DIR}/Rendering/vtkgl.cxx
  WRAP_EXCLUDE
  )

# Configuration for vtkOpenGLExtensionManager
IF (WIN32)
  SET(VTK_USE_WGL_GET_PROC_ADDRESS 1)
ELSE (WIN32)
  IF (APPLE)
    SET(VTK_USE_APPLE_LOADER 1)
  ELSE (APPLE)
Alexander Neundorf's avatar
 
Alexander Neundorf committed
527
    INCLUDE(CheckFunctionExists)
528
    SET(VTK_SAVE_CMAKE_REQUIRED_LIBRARIES "${CMAKE_REQUIRED_LIBRARIES}")
529 530 531 532 533 534
    SET(CMAKE_REQUIRED_LIBRARIES
      ${OPENGL_LIBRARIES}
      ${CMAKE_THREAD_LIBS}
      ${CMAKE_REQUIRED_LIBRARIES}
      -lm
      )
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
    IF(VTK_USE_X)
      CHECK_FUNCTION_EXISTS(glXGetProcAddressARB VTK_USE_GLX_GET_PROC_ADDRESS_ARB)
      IF (VTK_USE_GLX_GET_PROC_ADDRESS_ARB)
        IF (NOT "${VTK_GLX_GET_PROC_ADDRESS_ARB_PROTOTYPE_EXISTS_INCLUDES}" STREQUAL "${OPENGL_INCLUDE_DIR}")
          # The OpenGL includes changed.  Retest glXGetProcAddressARB prototype.
          SET(VTK_GLX_GET_PROC_ADDRESS_ARB_PROTOTYPE_EXISTS_TESTED 0)
        ENDIF (NOT "${VTK_GLX_GET_PROC_ADDRESS_ARB_PROTOTYPE_EXISTS_INCLUDES}" STREQUAL "${OPENGL_INCLUDE_DIR}")
        IF (NOT VTK_GLX_GET_PROC_ADDRESS_ARB_PROTOTYPE_EXISTS_TESTED)
          MESSAGE(STATUS "Looking for glXGetProcAddressARB in GL/glx.h")
          TRY_COMPILE(VTK_GLX_GET_PROC_ADDRESS_ARB_PROTOTYPE_EXISTS
            ${CMAKE_BINARY_DIR}
            ${CMAKE_CURRENT_SOURCE_DIR}/CheckglXGetProcAddressARB.cxx
            CMAKE_FLAGS "-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}"
            "-DINCLUDE_DIRECTORIES:STRING=${OPENGL_INCLUDE_DIR}"
            OUTPUT_VARIABLE OUTPUT)
          MESSAGE(STATUS "Looking for glXGetProcAddressARB in GL/glx.h - ${VTK_GLX_GET_PROC_ADDRESS_ARB_PROTOTYPE_EXISTS}")
          FILE(APPEND ${CMAKE_BINARY_DIR}/CMakeOutput.log
            "Determining if glXGetProcAddressARB exists in GL/glx.h ${VTK_GLX_GET_PROC_ADDRESS_ARB_PROTOTYPE_EXISTS} with the following output:\n"
            "${OUTPUT}\n\n")
          SET(VTK_GLX_GET_PROC_ADDRESS_ARB_PROTOTYPE_EXISTS_TESTED 1
            CACHE INTERNAL "Already set VTK_GLX_GET_PROC_ADDRESS_ARB_PROTOTYPE_EXISTS")
          SET(VTK_GLX_GET_PROC_ADDRESS_ARB_PROTOTYPE_EXISTS_INCLUDES
            "${OPENGL_INCLUDE_DIR}"
            CACHE INTERNAL "OpenGL includes used to test glXGetProcAddressARB prototype.")
        ENDIF (NOT VTK_GLX_GET_PROC_ADDRESS_ARB_PROTOTYPE_EXISTS_TESTED)
        IF (NOT VTK_GLX_GET_PROC_ADDRESS_ARB_PROTOTYPE_EXISTS)
          SET(VTK_DEFINE_GLX_GET_PROC_ADDRESS_PROTOTYPE 1)
        ENDIF (NOT VTK_GLX_GET_PROC_ADDRESS_ARB_PROTOTYPE_EXISTS)
      ELSE (VTK_USE_GLX_GET_PROC_ADDRESS_ARB)
        CHECK_FUNCTION_EXISTS(glXGetProcAddress VTK_USE_GLX_GET_PROC_ADDRESS)
        IF (NOT VTK_USE_GLX_GET_PROC_ADDRESS)
          #         SET(VTK_USE_VTK_DYNAMIC_LOADER 1)
          MESSAGE(STATUS "Could not find extension loader.  Extensions disabled.")
          SET(VTK_NO_EXTENSION_LOADING 1)
        ENDIF (NOT VTK_USE_GLX_GET_PROC_ADDRESS)
      ENDIF (VTK_USE_GLX_GET_PROC_ADDRESS_ARB)
    ELSE(VTK_USE_X)
      SET(VTK_NO_EXTENSION_LOADING 1)
    ENDIF(VTK_USE_X)
574 575 576 577 578 579
    SET(CMAKE_REQUIRED_LIBRARIES "${VTK_SAVE_CMAKE_REQUIRED_LIBRARIES}")
  ENDIF (APPLE)
ENDIF (WIN32)
CONFIGURE_FILE(
  ${VTK_SOURCE_DIR}/Rendering/vtkOpenGLExtensionManagerConfigure.h.in
  ${VTK_BINARY_DIR}/Rendering/vtkOpenGLExtensionManagerConfigure.h)
Andy Cedilnik's avatar
Andy Cedilnik committed
580 581
# Build a list of libraries to link to vtkRendering.

582
IF(VTK_USE_GL2PS)
583 584 585 586 587
  IF(VTK_USE_SYSTEM_GL2PS)
    SET(KIT_LIBS ${KIT_LIBS} ${GL2PS_LIBRARIES} ${VTK_ZLIB_LIBRARIES} ${VTK_PNG_LIBRARIES})
  ELSE(VTK_USE_SYSTEM_GL2PS)
    SET(KIT_LIBS ${KIT_LIBS} ${VTK_ZLIB_LIBRARIES} ${VTK_PNG_LIBRARIES})
  ENDIF(VTK_USE_SYSTEM_GL2PS)
588
ENDIF(VTK_USE_GL2PS)
589

590 591 592 593
IF(OPENGL_gl_LIBRARY)
  SET(KitOpenGL_SRCS ${KitOpenGL_SRCS} vtkGenericOpenGLRenderWindow.cxx)
ENDIF(OPENGL_gl_LIBRARY)

Ken Martin's avatar
Ken Martin committed
594
IF (WIN32)
595
  IF(VTK_USE_X)
596
    IF (OPENGL_gl_LIBRARY)
Alexander Neundorf's avatar
 
Alexander Neundorf committed
597 598
      SET(KitOpenGL_SRCS ${KitOpenGL_SRCS} vtkXOpenGLRenderWindow.cxx)
      SET(KIT_LIBS ${KIT_LIBS} ${OPENGL_gl_LIBRARY} )
599
    ENDIF (OPENGL_gl_LIBRARY)    
600
  ELSE(VTK_USE_X)
Andy Cedilnik's avatar
Andy Cedilnik committed
601
    SET(KitOpenGL_SRCS ${KitOpenGL_SRCS}
602 603
                 vtkWin32OpenGLRenderWindow.cxx
                 vtkWin32RenderWindowInteractor.cxx)
604
    SET (KIT_LIBS ${KIT_LIBS} ${OPENGL_gl_LIBRARY} )
605
  ENDIF(VTK_USE_X)
Ken Martin's avatar
Ken Martin committed
606
ELSE (WIN32)
Yves Starreveld's avatar
 
Yves Starreveld committed
607
  IF (APPLE)
608
    IF(VTK_USE_COCOA)
Andy Cedilnik's avatar
Andy Cedilnik committed
609
      SET(KitOpenGL_SRCS ${KitOpenGL_SRCS}
610 611 612
                   vtkCocoaRenderWindowInteractor.mm
                   vtkCocoaRenderWindow.mm
                   vtkCocoaGLView.mm)
613 614 615 616 617 618 619 620 621 622 623 624
       
      # The objective-c++ classes might need their own flags.
      # Set them if specified.
      IF(VTK_REQUIRED_OBJCXX_FLAGS)

        SET_SOURCE_FILES_PROPERTIES(vtkCocoaRenderWindowInteractor.mm 
                                    vtkCocoaRenderWindow.mm 
                                    vtkCocoaGLView.mm
                                    PROPERTIES COMPILE_FLAGS "${VTK_REQUIRED_OBJCXX_FLAGS}")

      ENDIF(VTK_REQUIRED_OBJCXX_FLAGS)

625
      SET_SOURCE_FILES_PROPERTIES(vtkCocoaGLView WRAP_EXCLUDE)
626
      SET (KIT_LIBS ${KIT_LIBS} ${OPENGL_gl_LIBRARY} "-framework Cocoa")
627 628 629 630 631 632
      # This is to resolve a linker error that happens on older (?) OS X builds.
      # If an executable links against vtkRendering, it would get the following
      # error unless we add the objc to its link interface:
      # ld: /usr/lib/crt1.o illegal reference to symbol: __objcInit defined in indirectly
      # referenced dynamic library /usr/lib/libobjc.A.dylib
      LIST(APPEND KIT_INTERFACE_LIBRARIES objc)
633 634
    ENDIF(VTK_USE_COCOA)
    IF(VTK_USE_CARBON)
Andy Cedilnik's avatar
Andy Cedilnik committed
635
      SET(KitOpenGL_SRCS ${KitOpenGL_SRCS}
636 637
                   vtkCarbonRenderWindowInteractor.cxx
                   vtkCarbonRenderWindow.cxx)
638
      SET (KIT_LIBS ${KIT_LIBS} ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY} "-framework Carbon")
639
    ENDIF(VTK_USE_CARBON)
Alexander Neundorf's avatar
 
Alexander Neundorf committed
640 641 642
    IF(VTK_USE_X  AND  OPENGL_gl_LIBRARY)
      SET(KitOpenGL_SRCS ${KitOpenGL_SRCS} vtkXOpenGLRenderWindow.cxx)
    ENDIF(VTK_USE_X  AND  OPENGL_gl_LIBRARY)
Yves Starreveld's avatar
 
Yves Starreveld committed
643
  ELSE (APPLE)
644
    IF (VTK_USE_X AND OPENGL_gl_LIBRARY)
Alexander Neundorf's avatar
 
Alexander Neundorf committed
645
      SET(KitOpenGL_SRCS ${KitOpenGL_SRCS} vtkXOpenGLRenderWindow.cxx)
646
      SET (KIT_LIBS ${KIT_LIBS} ${OPENGL_gl_LIBRARY} )
647 648 649 650 651 652
    ELSE (VTK_USE_X AND OPENGL_gl_LIBRARY)
      IF (VTK_OPENGL_HAS_OSMESA  AND  OSMESA_LIBRARY)
        SET(KitOpenGL_SRCS ${KitOpenGL_SRCS} vtkOSOpenGLRenderWindow.cxx)
        SET (KIT_LIBS ${KIT_LIBS} ${OSMESA_LIBRARY} )
      ENDIF (VTK_OPENGL_HAS_OSMESA  AND  OSMESA_LIBRARY)
    ENDIF (VTK_USE_X AND OPENGL_gl_LIBRARY)
Yves Starreveld's avatar
 
Yves Starreveld committed
653
  ENDIF (APPLE)
Ken Martin's avatar
Ken Martin committed
654
ENDIF (WIN32)
Alexander Neundorf's avatar
 
Alexander Neundorf committed
655

Andy Cedilnik's avatar
Andy Cedilnik committed
656 657 658
IF(VTK_USE_CG_SHADERS)
  SET(KIT_LIBS ${KIT_LIBS} ${OPENGL_glu_LIBRARY})
ENDIF(VTK_USE_CG_SHADERS)
Ken Martin's avatar
Ken Martin committed
659

660 661 662 663 664 665 666 667 668
if(DirectX_FOUND)
 # d3d9.lib for symbol Direct3DCreate9
 # symbol CLSID_WbemLocator IID_IWbemLocator: wbemuuid.lib 
 # wbemuuid.lib is *NOT A FILE* (you cannot find it), it is probably an
 # embedded library added by the linker itself.
 set(KIT_LIBS ${KIT_LIBS} ${DirectX_LIBRARY} wbemuuid)
 include_directories(${DirectX_INCLUDE_DIR})
endif(DirectX_FOUND)

669 670 671 672 673 674 675 676 677 678 679 680
if(VTK_USE_CORE_GRAPHICS)
 set(KIT_LIBS ${KIT_LIBS} ${ApplicationServices_LIBRARY} ${IOKit_LIBRARY})
 include_directories(${ApplicationServices_INCLUDE_DIR} ${IOKit_INCLUDE_DIR})
endif(VTK_USE_CORE_GRAPHICS)

if(VTK_USE_NVCONTROL)
 # NVCONTROL depends on X11. We solve that by making KIT_LIBS depending on
 # vtkRendering, as vtkRendering depends on X11 on Unix.
 set(KIT_LIBS ${KIT_LIBS} ${NVCtrlLib_LIBRARY} vtkRendering)
 include_directories(${NVCtrlLib_INCLUDE_DIR})
endif(VTK_USE_NVCONTROL)

681 682
IF (VTK_USE_MANGLED_MESA)
  IF (MANGLED_MESA_LIBRARY)
Andy Cedilnik's avatar
Andy Cedilnik committed
683
    SET ( KitOpenGL_SRCS ${KitOpenGL_SRCS}
684 685
                 vtkMesaActor.cxx
                 vtkMesaCamera.cxx
Utkarsh Ayachit's avatar
Utkarsh Ayachit committed
686 687 688
                 vtkMesaClipPlanesPainter.cxx
                 vtkMesaCoincidentTopologyResolutionPainter.cxx
                 vtkMesaDisplayListPainter.cxx
689 690 691
                 vtkMesaImageActor.cxx
                 vtkMesaImageMapper.cxx
                 vtkMesaLight.cxx
Utkarsh Ayachit's avatar
Utkarsh Ayachit committed
692 693
                 vtkMesaLightingPainter.cxx
                 vtkMesaPainterDeviceAdapter.cxx
694 695 696
                 vtkMesaPolyDataMapper.cxx
                 vtkMesaPolyDataMapper2D.cxx
                 vtkMesaProperty.cxx
Brad King's avatar
Brad King committed
697
                 vtkMesaRenderWindow.cxx
698
                 vtkMesaRenderer.cxx
Utkarsh Ayachit's avatar
Utkarsh Ayachit committed
699 700
                 vtkMesaRepresentationPainter.cxx
                 vtkMesaScalarsToColorsPainter.cxx
701 702
                 vtkMesaTexture.cxx
                 vtkXMesaRenderWindow.cxx
Berk Geveci's avatar
Berk Geveci committed
703
                )
Andy Cedilnik's avatar
Andy Cedilnik committed
704
    SET(KitOpenGL_SRCS ${KitOpenGL_SRCS}
705 706
      vtkMesaFreeTypeTextMapper.cxx
    )
Ken Martin's avatar
Ken Martin committed
707
    SET_SOURCE_FILES_PROPERTIES(vtkMesaRenderWindow ABSTRACT)
708
    SET (KIT_LIBS ${KIT_LIBS} ${MANGLED_MESA_LIBRARY})
709
    IF(MANGLED_OSMESA_LIBRARY)
710
      SET( KIT_LIBS ${KIT_LIBS} ${MANGLED_OSMESA_LIBRARY} )
711 712 713
    ENDIF(MANGLED_OSMESA_LIBRARY)
  ENDIF (MANGLED_MESA_LIBRARY)
ELSE (VTK_USE_MANGLED_MESA)
Alexander Neundorf's avatar
 
Alexander Neundorf committed
714 715 716
  IF(VTK_OPENGL_HAS_OSMESA  AND  OSMESA_LIBRARY)
    SET(KIT_LIBS ${KIT_LIBS} ${OSMESA_LIBRARY})
  ENDIF(VTK_OPENGL_HAS_OSMESA  AND  OSMESA_LIBRARY)
717
ENDIF(VTK_USE_MANGLED_MESA)
Andy Cedilnik's avatar
Andy Cedilnik committed
718
SET(Kit_SRCS ${Kit_SRCS} ${KitOpenGL_SRCS})
719
SET(Kit_EXTRA_SRCS ${Kit_EXTRA_SRCS} ${Kit_FT_SRCS})
720 721

IF(VTK_USE_GL2PS)
Alexander Neundorf's avatar
 
Alexander Neundorf committed
722
  SET(Kit_EXTRA_SRCS ${Kit_EXTRA_SRCS} ${Kit_GL2PS_SRCS})
723 724
ENDIF(VTK_USE_GL2PS)

Andy Cedilnik's avatar
Andy Cedilnik committed
725 726 727 728 729
SET(Kit_EXTRA_CMDS)
SET(Kit_TCL_EXTRA_SRCS)
SET(Kit_PYTHON_EXTRA_SRCS)
SET(Kit_JAVA_EXTRA_SRCS)
SET(Kit_TCL_EXTRA_CMDS)
730 731 732
SET(KIT_TCL_DEPS)
SET(KIT_PYTHON_DEPS)
SET(KIT_JAVA_DEPS)
Ken Martin's avatar
Ken Martin committed
733

Alexander Neundorf's avatar
 
Alexander Neundorf committed
734
IF (TK_FOUND AND VTK_USE_TK)
735
  SET(VTK_GENERATE_TK_INTERNALS 1)
Alexander Neundorf's avatar
 
Alexander Neundorf committed
736 737
ENDIF (TK_FOUND AND VTK_USE_TK)

738
IF(VTK_GENERATE_TK_INTERNALS)
739 740 741 742 743
  SET (HAVE_LIMITS_H ${CMAKE_HAVE_LIMITS_H})
  SET (HAVE_UNISTD_H ${CMAKE_HAVE_UNISTD_H})
  CONFIGURE_FILE(
    ${CMAKE_CURRENT_SOURCE_DIR}/vtkTkInternals.h.in
    ${CMAKE_CURRENT_BINARY_DIR}/vtkTkInternals.h)
744
  IF(NOT VTK_INSTALL_NO_DEVELOPMENT)
745 746 747 748 749
    INSTALL(FILES
      ${CMAKE_CURRENT_BINARY_DIR}/vtkTkInternals.h
      DESTINATION ${VTK_INSTALL_INCLUDE_DIR_CM24}
      COMPONENT Development
      )
750
  ENDIF(NOT VTK_INSTALL_NO_DEVELOPMENT)
751
  INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR})
752
ENDIF (VTK_GENERATE_TK_INTERNALS)
753

Alexander Neundorf's avatar
 
Alexander Neundorf committed
754 755 756 757
IF (VTK_WRAP_TCL AND VTK_USE_TK)
  SET(KitTCL_SRCS
    vtkTkRenderWidget.cxx
    vtkTkImageViewerWidget.cxx)
758 759 760 761
  IF (VTK_USE_COCOA)
    SET(KitTCL_SRCS ${KitTCL_SRCS}
      vtkCocoaTkUtilities.mm)
    SET_SOURCE_FILES_PROPERTIES(vtkCocoaTkUtilities WRAP_EXCLUDE)
762 763 764 765
    IF(VTK_REQUIRED_OBJCXX_FLAGS)
      SET_SOURCE_FILES_PROPERTIES(vtkCocoaTkUtilities
        PROPERTIES COMPILE_FLAGS "${VTK_REQUIRED_OBJCXX_FLAGS}")
    ENDIF(VTK_REQUIRED_OBJCXX_FLAGS)
766
  ENDIF(VTK_USE_COCOA)
Ken Martin's avatar
updates  
Ken Martin committed
767

Alexander Neundorf's avatar
 
Alexander Neundorf committed
768 769
  # Use special interactor for X and Tk.
  IF(VTK_USE_X)
Alexander Neundorf's avatar
 
Alexander Neundorf committed
770
    SET(KitTCL_SRCS ${KitTCL_SRCS} vtkXRenderWindowTclInteractor.cxx)
771
    SET(KIT_TCL_LIBS ${KIT_TCL_LIBS} ${X11_LIBRARIES})
Alexander Neundorf's avatar
 
Alexander Neundorf committed
772
  ENDIF(VTK_USE_X)
773 774 775
  IF(VTK_USE_CARBON)
    SET(KIT_TCL_LIBS ${KIT_TCL_LIBS} "-framework Carbon")
  ENDIF(VTK_USE_CARBON)
Alexander Neundorf's avatar
 
Alexander Neundorf committed
776 777 778 779
  SET(Kit_TCL_EXTRA_CMDS 
    vtkTkRenderWidget 
    vtkTkImageViewerWidget)
ENDIF (VTK_WRAP_TCL AND VTK_USE_TK)
Yves Starreveld's avatar
 
Yves Starreveld committed
780

781 782
#-----------------------------------------------------------------------------
# Include CMake code common to all kits.
783
INCLUDE(${VTK_CMAKE_DIR}/KitCommonBlock.cmake)
784
#-----------------------------------------------------------------------------
Alexander Neundorf's avatar
 
Alexander Neundorf committed
785 786 787 788 789 790

# when crosscompiling vtkParseOGLExt is imported, don't add a dependency to it
# this should be handled by cmake so it doesn't have to be done here
IF(NOT CMAKE_CROSSCOMPILING)
  # Add target dependency to ensure the vtkParseOGLExt is built before
  # Rendering is.
Alexander Neundorf's avatar
 
Alexander Neundorf committed
791
  ADD_DEPENDENCIES(vtk${KIT} vtkParseOGLExt)
Alexander Neundorf's avatar
 
Alexander Neundorf committed
792
ENDIF(NOT CMAKE_CROSSCOMPILING)
793

794
IF(NOT VTK_INSTALL_NO_DEVELOPMENT)
795 796
  INSTALL(FILES
    ${CMAKE_CURRENT_SOURCE_DIR}/vtkOpenGL.h
797
    ${CMAKE_CURRENT_BINARY_DIR}/vtkgl.h
798 799
    DESTINATION ${VTK_INSTALL_INCLUDE_DIR_CM24}
    COMPONENT Development
800 801
    )
ENDIF(NOT VTK_INSTALL_NO_DEVELOPMENT)
802

Alexander Neundorf's avatar
 
Alexander Neundorf committed
803 804 805 806 807 808
IF (VTK_WRAP_PYTHON AND VTK_USE_TK AND TK_FOUND)
  SET(RenderingPythonTkWidgets_SRCS
    vtkTkWidgetsInit.cxx
    vtkTkRenderWidgetPython.cxx
    vtkTkImageViewerWidgetPython.cxx
    )
809 810 811 812 813
  IF (VTK_USE_COCOA)
    SET(RenderingPythonTkWidgets_SRCS ${RenderingPythonTkWidgets_SRCS}
        vtkCocoaTkUtilities.mm)
  ENDIF (VTK_USE_COCOA)

Alexander Neundorf's avatar
 
Alexander Neundorf committed
814 815
  ADD_LIBRARY(vtkRenderingPythonTkWidgets SHARED
              ${RenderingPythonTkWidgets_SRCS})
816 817 818 819
  SET(VTK_PYTHONTK_LIBRARIES ${VTK_TK_LIBRARIES})
  IF(VTK_USE_X)
    SET(VTK_PYTHONTK_LIBRARIES ${VTK_PYTHONTK_LIBRARIES} ${X11_LIBRARIES})
  ENDIF(VTK_USE_X)
820
  IF(VTK_USE_CARBON)
821
    SET(VTK_PYTHONTK_LIBRARIES ${VTK_PYTHONTK_LIBRARIES} "-framework Carbon")
822
  ENDIF(VTK_USE_CARBON)
823 824 825 826
 
  TARGET_LINK_LIBRARIES (vtkRenderingPythonTkWidgets
                        vtk${KIT}
                        ${VTK_PYTHONTK_LIBRARIES})
Alexander Neundorf's avatar
 
Alexander Neundorf committed
827 828 829 830 831 832 833 834 835 836 837 838 839 840

  # Apply user-defined properties to the library target.
  IF(VTK_LIBRARY_PROPERTIES)
    SET_TARGET_PROPERTIES(vtkRenderingPythonTkWidgets PROPERTIES
      ${VTK_LIBRARY_PROPERTIES})
  ENDIF(VTK_LIBRARY_PROPERTIES)

  IF(NOT VTK_INSTALL_NO_LIBRARIES)
    INSTALL(TARGETS vtkRenderingPythonTkWidgets
      RUNTIME DESTINATION ${VTK_INSTALL_BIN_DIR_CM24} COMPONENT RuntimeLibraries
      LIBRARY DESTINATION ${VTK_INSTALL_LIB_DIR_CM24} COMPONENT RuntimeLibraries
      ARCHIVE DESTINATION ${VTK_INSTALL_LIB_DIR_CM24} COMPONENT Development)
  ENDIF(NOT VTK_INSTALL_NO_LIBRARIES)
ENDIF (VTK_WRAP_PYTHON AND VTK_USE_TK AND TK_FOUND)
Andy Cedilnik's avatar
Andy Cedilnik committed
841

Yves Starreveld's avatar
 
Yves Starreveld committed
842
IF(VTK_USE_X)
Sebastien Barre's avatar
Sebastien Barre committed
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
  SET(X11_LIB_SEARCH_PATH
    /usr/X11R6/lib
    /usr/local/lib 
    /usr/openwin/lib 
    /usr/lib 
    )
  FIND_LIBRARY(X11_Xt_LIB Xt ${X11_LIB_SEARCH_PATH})
  MARK_AS_ADVANCED(X11_Xt_LIB)
  IF (X11_Xt_LIB)
    TARGET_LINK_LIBRARIES(vtk${KIT} ${X11_Xt_LIB})
  ENDIF (X11_Xt_LIB)
  TARGET_LINK_LIBRARIES(vtk${KIT} ${X11_LIBRARIES})
  IF (VTK_USE_TK)
    # Definitely needed in case we are linking against a Tcl/Tk 8.5 static,
    # which by default seems to be missing Xss and Xft. It can not just be
    # attached to the vtk interpreter because sub-projects may need the
    # very same fix.
    FIND_LIBRARY(X11_Xscreensaver_LIB Xss ${X11_LIB_SEARCH_PATH})
    MARK_AS_ADVANCED(X11_Xscreensaver_LIB)
    IF(X11_Xscreensaver_LIB)
      TARGET_LINK_LIBRARIES(vtk${KIT} ${X11_Xscreensaver_LIB})
    ENDIF(X11_Xscreensaver_LIB)
    FIND_LIBRARY(X11_Xft_LIB Xft ${X11_LIB_SEARCH_PATH})
    MARK_AS_ADVANCED(X11_Xft_LIB)
    IF(X11_Xft_LIB)
      TARGET_LINK_LIBRARIES(vtk${KIT} ${X11_Xft_LIB})
    ENDIF(X11_Xft_LIB)
870 871 872 873 874 875 876
    IF(APPLE)
      FIND_LIBRARY(X11_fontconfig_LIB fontconfig ${X11_LIB_SEARCH_PATH})
      MARK_AS_ADVANCED(X11_fontconfig_LIB)
      IF(X11_fontconfig_LIB)
        TARGET_LINK_LIBRARIES(vtk${KIT} ${X11_fontconfig_LIB})
      ENDIF(X11_fontconfig_LIB)
    ENDIF(APPLE)
Sebastien Barre's avatar
Sebastien Barre committed
877
  ENDIF(VTK_USE_TK)
Yves Starreveld's avatar
 
Yves Starreveld committed
878
ENDIF(VTK_USE_X)
879

880
IF(NOT VTK_INSTALL_NO_DEVELOPMENT)
881
  SET(__inst_files
882
    ${VTK_SOURCE_DIR}/${KIT}/Testing/Cxx/vtkRegressionTestImage.h
883 884 885
    ${VTK_BINARY_DIR}/Rendering/vtkTDxConfigure.h
    ${VTK_SOURCE_DIR}/${KIT}/vtkTDxMotionEventInfo.h
    )
886
  INSTALL(FILES ${__inst_files}
887
    DESTINATION ${VTK_INSTALL_INCLUDE_DIR_CM24}
888
    COMPONENT Development)
889
ENDIF(NOT VTK_INSTALL_NO_DEVELOPMENT)
890 891 892 893 894 895

IF(NOT CMAKE_CROSSCOMPILING)
  # Add target dependency to ensure the vtkEncodeString is built before
  # Rendering is.
  ADD_DEPENDENCIES(vtk${KIT} vtkEncodeString)
ENDIF(NOT CMAKE_CROSSCOMPILING)