CMakeLists.txt 21.2 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_LIBS vtkGraphics vtkImaging vtkIO
12
  vtkftgl
13
  ${VTK_FREETYPE_LIBRARIES}
14
15
)

16
17
18
19
20
21
# 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
22
SET( Kit_SRCS
Alexander Neundorf's avatar
 
Alexander Neundorf committed
23
24
25
  vtkAbstractMapper3D.cxx
  vtkAbstractPicker.cxx
  vtkAbstractPropPicker.cxx
26
  vtkAbstractVolumeMapper.cxx
Alexander Neundorf's avatar
 
Alexander Neundorf committed
27
  vtkActorCollection.cxx
28
  vtkActor.cxx
Alexander Neundorf's avatar
 
Alexander Neundorf committed
29
30
31
32
33
34
35
36
37
38
  vtkAreaPicker.cxx
  vtkAssembly.cxx
  vtkAxisActor2D.cxx
  vtkCamera.cxx
  vtkCameraInterpolator.cxx
  vtkCellCenterDepthSort.cxx
  vtkCellPicker.cxx
  vtkChooserPainter.cxx
  vtkClipPlanesPainter.cxx
  vtkCoincidentTopologyResolutionPainter.cxx
39
  vtkCompositePainter.cxx
40
41
  vtkCompositePolyDataMapper2.cxx
  vtkCompositePolyDataMapper.cxx
Alexander Neundorf's avatar
 
Alexander Neundorf committed
42
  vtkCullerCollection.cxx
43
  vtkCuller.cxx
Alexander Neundorf's avatar
 
Alexander Neundorf committed
44
45
46
47
48
49
  vtkDataSetMapper.cxx
  vtkDefaultPainter.cxx
  vtkDisplayListPainter.cxx
  vtkDynamic2DLabelMapper.cxx
  vtkExporter.cxx
  vtkFollower.cxx
50
  vtkFrameBufferObject.cxx
Alexander Neundorf's avatar
 
Alexander Neundorf committed
51
52
  vtkFrustumCoverageCuller.cxx
  vtkGenericRenderWindowInteractor.cxx
53
  vtkGenericVertexAttributeMapping.cxx
Alexander Neundorf's avatar
 
Alexander Neundorf committed
54
  vtkGraphicsFactory.cxx
55
56
  vtkHardwareSelector.cxx
  vtkHardwareSelectionPolyDataPainter.cxx
Alexander Neundorf's avatar
 
Alexander Neundorf committed
57
58
59
60
  vtkHierarchicalPolyDataMapper.cxx
  vtkImageActor.cxx
  vtkImageMapper.cxx
  vtkImageViewer2.cxx
61
  vtkImageViewer.cxx
Alexander Neundorf's avatar
 
Alexander Neundorf committed
62
63
64
65
66
67
68
69
70
  vtkImagingFactory.cxx
  vtkImporter.cxx
  vtkInteractorEventRecorder.cxx
  vtkInteractorObserver.cxx
  vtkInteractorStyle.cxx
  vtkInteractorStyleFlight.cxx
  vtkInteractorStyleImage.cxx
  vtkInteractorStyleJoystickActor.cxx
  vtkInteractorStyleJoystickCamera.cxx
71
72
  vtkInteractorStyleRubberBand2D.cxx
  vtkInteractorStyleRubberBand3D.cxx
Alexander Neundorf's avatar
 
Alexander Neundorf committed
73
74
75
76
77
78
  vtkInteractorStyleRubberBandPick.cxx
  vtkInteractorStyleRubberBandZoom.cxx
  vtkInteractorStyleSwitch.cxx
  vtkInteractorStyleTerrain.cxx
  vtkInteractorStyleTrackballActor.cxx
  vtkInteractorStyleTrackballCamera.cxx
79
  vtkInteractorStyleTrackball.cxx
Alexander Neundorf's avatar
 
Alexander Neundorf committed
80
81
  vtkInteractorStyleUnicam.cxx
  vtkInteractorStyleUser.cxx
82
  vtkIVExporter.cxx
Alexander Neundorf's avatar
 
Alexander Neundorf committed
83
  vtkLabeledDataMapper.cxx
84
85
86
87
88
  vtkLabelHierarchy.cxx
  vtkLabelHierarchyAlgorithm.cxx
  vtkLabelHierarchyIterator.cxx
  vtkLabelPlacer.cxx
  vtkLabelSizeCalculator.cxx
Alexander Neundorf's avatar
 
Alexander Neundorf committed
89
90
  vtkLeaderActor2D.cxx
  vtkLightCollection.cxx
91
  vtkLight.cxx
Alexander Neundorf's avatar
 
Alexander Neundorf committed
92
  vtkLightingPainter.cxx
93
  vtkLightKit.cxx
Alexander Neundorf's avatar
 
Alexander Neundorf committed
94
  vtkLinesPainter.cxx
95
96
  vtkLODActor.cxx
  vtkLODProp3D.cxx
Alexander Neundorf's avatar
 
Alexander Neundorf committed
97
  vtkMapperCollection.cxx
98
  vtkMapper.cxx
Alexander Neundorf's avatar
 
Alexander Neundorf committed
99
100
101
102
103
104
105
106
  vtkOBJExporter.cxx
  vtkObserverMediator.cxx
  vtkOOGLExporter.cxx
  vtkPainter.cxx
  vtkPainterDeviceAdapter.cxx
  vtkPainterPolyDataMapper.cxx
  vtkParallelCoordinatesActor.cxx
  vtkPicker.cxx
107
  vtkPixelBufferObject.cxx
Alexander Neundorf's avatar
 
Alexander Neundorf committed
108
  vtkPointPicker.cxx
109
  vtkPointSetToLabelHierarchy.cxx
110
  vtkPointsPainter.cxx
111
  vtkPOVExporter.cxx
Alexander Neundorf's avatar
 
Alexander Neundorf committed
112
  vtkPolyDataMapper2D.cxx
113
  vtkPolyDataMapper.cxx
Alexander Neundorf's avatar
 
Alexander Neundorf committed
114
115
116
117
  vtkPolyDataPainter.cxx
  vtkPolygonsPainter.cxx
  vtkPrimitivePainter.cxx
  vtkProp3DCollection.cxx
118
  vtkProp3D.cxx
Alexander Neundorf's avatar
 
Alexander Neundorf committed
119
  vtkProperty.cxx
120
  vtkPropPicker.cxx
121
  vtkQuadricLODActor.cxx
Alexander Neundorf's avatar
 
Alexander Neundorf committed
122
123
124
  vtkQuaternionInterpolator.cxx
  vtkRenderedAreaPicker.cxx
  vtkRendererCollection.cxx
125
  vtkRenderer.cxx
126
  vtkRendererDelegate.cxx
Alexander Neundorf's avatar
 
Alexander Neundorf committed
127
  vtkRendererSource.cxx
128
129
  vtkRenderPass.cxx
  vtkRenderState.cxx
130
131
132
  vtkRenderWindowCollection.cxx
  vtkRenderWindow.cxx
  vtkRenderWindowInteractor.cxx
Alexander Neundorf's avatar
 
Alexander Neundorf committed
133
134
135
136
137
138
139
  vtkRepresentationPainter.cxx
  vtkScalarBarActor.cxx
  vtkScalarsToColorsPainter.cxx
  vtkScaledTextActor.cxx
  vtkScenePicker.cxx
  vtkSelectVisiblePoints.cxx
  vtkShader.cxx
140
  vtkShaderDeviceAdapter.cxx
Alexander Neundorf's avatar
 
Alexander Neundorf committed
141
142
143
144
145
  vtkShaderProgram.cxx
  vtkStandardPolyDataPainter.cxx
  vtkTesting.cxx
  # vtkTextActor2D.cxx
  vtkTextActor3D.cxx
146
  vtkTextActor.cxx
Alexander Neundorf's avatar
 
Alexander Neundorf committed
147
148
149
  vtkTextMapper.cxx
  vtkTextProperty.cxx
  vtkTexture.cxx
150
  vtkTexturedActor2D.cxx
151
  vtkTextureObject.cxx
Alexander Neundorf's avatar
 
Alexander Neundorf committed
152
153
154
155
156
  vtkTransformInterpolator.cxx
  vtkTStripsPainter.cxx
  vtkTupleInterpolator.cxx
  vtkVisibilitySort.cxx
  vtkVolumeCollection.cxx
157
  vtkVolume.cxx
Alexander Neundorf's avatar
 
Alexander Neundorf committed
158
  vtkVolumeProperty.cxx
159
  vtkVRMLExporter.cxx
Alexander Neundorf's avatar
 
Alexander Neundorf committed
160
161
162
  vtkWindowToImageFilter.cxx
  vtkWorldPointPicker.cxx
  )
Ken Martin's avatar
Ken Martin committed
163

164
165
166
167
168
169
170
171
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)

172
IF(VTK_USE_GL2PS)
173
174
175
  SET(Kit_SRCS ${Kit_SRCS} vtkGL2PSExporter.cxx)
  SET(Kit_GL2PS_SRCS ${VTK_SOURCE_DIR}/Utilities/gl2ps/gl2ps.c)
  ADD_DEFINITIONS(-DGL2PS_HAVE_ZLIB)
176
  ADD_DEFINITIONS(-DGL2PS_HAVE_LIBPNG)
177
178
ENDIF(VTK_USE_GL2PS)

179
180
181
IF(VTK_USE_CG_SHADERS)
  SET(Kit_SRCS ${Kit_SRCS} 
    vtkCgShader.cxx
182
    vtkCgShaderDeviceAdapter.cxx
183
184
185
186
187
188
189
    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
190
SET( KitOpenGL_SRCS
191
192
193
194
195
  vtkCameraPass.cxx
  vtkDefaultPass.cxx
  vtkDepthPeelingPass.cxx
  vtkLightsPass.cxx
  vtkOpaquePass.cxx
Ken Martin's avatar
Ken Martin committed
196
197
  vtkOpenGLActor.cxx
  vtkOpenGLCamera.cxx
198
199
200
  vtkOpenGLClipPlanesPainter.cxx
  vtkOpenGLCoincidentTopologyResolutionPainter.cxx
  vtkOpenGLDisplayListPainter.cxx
201
  vtkOpenGLExtensionManager.cxx
202
  vtkOpenGLHardwareSupport.cxx
Ken Martin's avatar
Ken Martin committed
203
204
205
  vtkOpenGLImageActor.cxx
  vtkOpenGLImageMapper.cxx
  vtkOpenGLLight.cxx
206
207
  vtkOpenGLLightingPainter.cxx
  vtkOpenGLPainterDeviceAdapter.cxx
Ken Martin's avatar
Ken Martin committed
208
209
210
211
  vtkOpenGLPolyDataMapper.cxx
  vtkOpenGLPolyDataMapper2D.cxx
  vtkOpenGLProperty.cxx
  vtkOpenGLRenderWindow.cxx
Brad King's avatar
Brad King committed
212
  vtkOpenGLRenderer.cxx
213
214
  vtkOpenGLRepresentationPainter.cxx
  vtkOpenGLScalarsToColorsPainter.cxx
Ken Martin's avatar
Ken Martin committed
215
  vtkOpenGLTexture.cxx
216
217
218
  vtkOverlayPass.cxx
  vtkRenderPassCollection.cxx
  vtkSequencePass.cxx
219
220
221
  vtkShader2.cxx
  vtkShader2Collection.cxx
  vtkShaderProgram2.cxx
222
  vtkTranslucentPass.cxx
223
  vtkUniformVariables.cxx
224
  vtkVolumetricPass.cxx
Ken Martin's avatar
Ken Martin committed
225
226
  )

227
228
229
IF(VTK_USE_GLSL_SHADERS)
  SET(KitOpenGL_SRCS ${KitOpenGL_SRCS}
    vtkGLSLShader.cxx
230
    vtkGLSLShaderDeviceAdapter.cxx
231
232
233
    vtkGLSLShaderProgram.cxx
    )
ENDIF(VTK_USE_GLSL_SHADERS)
234

Ken Martin's avatar
Ken Martin committed
235
SET_SOURCE_FILES_PROPERTIES(
Alexander Neundorf's avatar
 
Alexander Neundorf committed
236
237
238
239
240
241
242
243
244
245
246
247
248
249
  vtkAbstractMapper3D
  vtkAbstractVolumeMapper
  vtkAbstractPicker
  vtkAbstractPropPicker
  vtkCuller
  vtkExporter
  vtkImporter
  vtkInteractorObserver
  vtkMapper
  vtkOpenGLRenderWindow
  vtkPainter
  vtkPolyDataPainter
  vtkPrimitivePainter
  vtkProp3D
250
  vtkRendererDelegate
251
252
  vtkRenderPass
  vtkRenderState # not abstract just not using instantiator
Alexander Neundorf's avatar
 
Alexander Neundorf committed
253
  vtkShader
254
  vtkShaderDeviceAdapter
Alexander Neundorf's avatar
 
Alexander Neundorf committed
255
256
257
258
  vtkShaderProgram
  vtkVisibilitySort.cxx
  ABSTRACT
  )
Ken Martin's avatar
Ken Martin committed
259

260
SET_SOURCE_FILES_PROPERTIES(
261
262
263
264
265
  vtkCameraPass
  vtkDefaultPass
  vtkDepthPeelingPass
  vtkLightsPass
  vtkOpaquePass
266
267
  vtkRenderPass
  vtkRenderState
268
269
270
  vtkOverlayPass
  vtkRenderPassCollection
  vtkSequencePass
271
272
273
  vtkShader2
  vtkShader2Collection
  vtkShaderProgram2
274
275
  vtkTranslucentPass
  vtkVolumetricPass
276
277
278
  WRAP_EXCLUDE
  )

Andy Cedilnik's avatar
Andy Cedilnik committed
279
280
# Freetype stuff

Alexander Neundorf's avatar
 
Alexander Neundorf committed
281
282
283
SET(KitOpenGL_SRCS ${KitOpenGL_SRCS} vtkOpenGLFreeTypeTextMapper.cxx)

SET(Kit_SRCS ${Kit_SRCS} vtkFreeTypeUtilities.cxx )
284
SET_SOURCE_FILES_PROPERTIES(vtkFreeTypeUtilities WRAP_EXCLUDE)
Alexander Neundorf's avatar
 
Alexander Neundorf committed
285

Andy Cedilnik's avatar
Andy Cedilnik committed
286
SET(Kit_FT_SRCS 
287
288
289
290
291
292
293
294
295
296
297
298
299
  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
)
300

Yves Starreveld's avatar
 
Yves Starreveld committed
301
IF(VTK_USE_X)
Alexander Neundorf's avatar
 
Alexander Neundorf committed
302
  SET( Kit_SRCS ${Kit_SRCS} vtkXRenderWindowInteractor.cxx)
Yves Starreveld's avatar
 
Yves Starreveld committed
303
ENDIF(VTK_USE_X)
Ken Martin's avatar
Ken Martin committed
304

305
306
# The set of source files to be encoded.
SET(glsl_files
307
  vtkDepthPeeling_fs
308
  vtkOpenGLRenderer_PeelingFS
309
310
311
  vtkOpenGLPropertyDefaultPropFunc_fs
  vtkOpenGLPropertyDefaultMain_fs
  vtkOpenGLPropertyDefaultMain_vs
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
  )

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

332
333
334
335
# OpenGL extensions stuff.

# Parse the extensions into vtkgl.h/vtkgl.cxx.
ADD_CUSTOM_COMMAND(
336
337
  OUTPUT ${VTK_BINARY_DIR}/Rendering/vtkgl.cxx
  COMMAND ${VTK_PARSEOGLEXT_EXE}
338
  ARGS ${VTK_BINARY_DIR}/Rendering ${VTK_GLEXT_FILE} ${VTK_GLXEXT_FILE} ${VTK_WGLEXT_FILE}
339
340
  DEPENDS ${VTK_GLEXT_FILE} ${VTK_GLXEXT_FILE} ${VTK_WGLEXT_FILE} ${VTK_PARSEOGLEXT_EXE}
  )
341

342
343
344
SET_SOURCE_FILES_PROPERTIES(vtkOpenGLExtensionManager.cxx
  PROPERTIES OBJECT_DEPENDS ${VTK_BINARY_DIR}/Rendering/vtkgl.cxx)

Alexander Neundorf's avatar
 
Alexander Neundorf committed
345
346
347
SET(KitOpenGL_SRCS ${KitOpenGL_SRCS} 
  ${VTK_BINARY_DIR}/Rendering/vtkgl.cxx 
  )
348
349
350
351
352

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
353
  vtkLabelHierarchyIterator.cxx
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
  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
374
    INCLUDE(CheckFunctionExists)
375
    SET(VTK_SAVE_CMAKE_REQUIRED_LIBRARIES "${CMAKE_REQUIRED_LIBRARIES}")
376
377
378
379
380
381
    SET(CMAKE_REQUIRED_LIBRARIES
      ${OPENGL_LIBRARIES}
      ${CMAKE_THREAD_LIBS}
      ${CMAKE_REQUIRED_LIBRARIES}
      -lm
      )
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
    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)
421
422
423
424
425
426
427
    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
428
429
# Build a list of libraries to link to vtkRendering.

430
IF(VTK_USE_GL2PS)
431
  SET(KIT_LIBS ${KIT_LIBS} ${VTK_ZLIB_LIBRARIES} ${VTK_PNG_LIBRARIES})
432
ENDIF(VTK_USE_GL2PS)
433

Ken Martin's avatar
Ken Martin committed
434
IF (WIN32)
435
  IF(VTK_USE_X)
436
    IF (OPENGL_gl_LIBRARY)
Alexander Neundorf's avatar
 
Alexander Neundorf committed
437
438
      SET(KitOpenGL_SRCS ${KitOpenGL_SRCS} vtkXOpenGLRenderWindow.cxx)
      SET(KIT_LIBS ${KIT_LIBS} ${OPENGL_gl_LIBRARY} )
439
    ENDIF (OPENGL_gl_LIBRARY)    
440
  ELSE(VTK_USE_X)
Andy Cedilnik's avatar
Andy Cedilnik committed
441
    SET(KitOpenGL_SRCS ${KitOpenGL_SRCS}
442
443
                 vtkWin32OpenGLRenderWindow.cxx
                 vtkWin32RenderWindowInteractor.cxx)
444
    SET (KIT_LIBS ${KIT_LIBS} ${OPENGL_gl_LIBRARY} )
445
  ENDIF(VTK_USE_X)
Ken Martin's avatar
Ken Martin committed
446
ELSE (WIN32)
Yves Starreveld's avatar
 
Yves Starreveld committed
447
  IF (APPLE)
448
    IF(VTK_USE_COCOA)
Andy Cedilnik's avatar
Andy Cedilnik committed
449
      SET(KitOpenGL_SRCS ${KitOpenGL_SRCS}
450
451
452
                   vtkCocoaRenderWindowInteractor.mm
                   vtkCocoaRenderWindow.mm
                   vtkCocoaGLView.mm)
453
454
455
456
457
458
459
460
461
462
463
464
       
      # 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)

465
      SET_SOURCE_FILES_PROPERTIES(vtkCocoaGLView WRAP_EXCLUDE)
466
      SET (KIT_LIBS ${KIT_LIBS} ${OPENGL_gl_LIBRARY} "-framework Cocoa")
467
468
    ENDIF(VTK_USE_COCOA)
    IF(VTK_USE_CARBON)
Andy Cedilnik's avatar
Andy Cedilnik committed
469
      SET(KitOpenGL_SRCS ${KitOpenGL_SRCS}
470
471
                   vtkCarbonRenderWindowInteractor.cxx
                   vtkCarbonRenderWindow.cxx)
472
      SET (KIT_LIBS ${KIT_LIBS} ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY} "-framework Carbon")
473
    ENDIF(VTK_USE_CARBON)
Alexander Neundorf's avatar
 
Alexander Neundorf committed
474
475
476
    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
477
  ELSE (APPLE)
478
    IF (VTK_USE_X AND OPENGL_gl_LIBRARY)
Alexander Neundorf's avatar
 
Alexander Neundorf committed
479
      SET(KitOpenGL_SRCS ${KitOpenGL_SRCS} vtkXOpenGLRenderWindow.cxx)
480
      SET (KIT_LIBS ${KIT_LIBS} ${OPENGL_gl_LIBRARY} )
481
482
483
484
485
486
    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
487
  ENDIF (APPLE)
Ken Martin's avatar
Ken Martin committed
488
ENDIF (WIN32)
Alexander Neundorf's avatar
 
Alexander Neundorf committed
489

Andy Cedilnik's avatar
Andy Cedilnik committed
490
491
492
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
493

494
495
IF (VTK_USE_MANGLED_MESA)
  IF (MANGLED_MESA_LIBRARY)
Andy Cedilnik's avatar
Andy Cedilnik committed
496
    SET ( KitOpenGL_SRCS ${KitOpenGL_SRCS}
497
498
                 vtkMesaActor.cxx
                 vtkMesaCamera.cxx
Utkarsh Ayachit's avatar
Utkarsh Ayachit committed
499
500
501
                 vtkMesaClipPlanesPainter.cxx
                 vtkMesaCoincidentTopologyResolutionPainter.cxx
                 vtkMesaDisplayListPainter.cxx
502
503
504
                 vtkMesaImageActor.cxx
                 vtkMesaImageMapper.cxx
                 vtkMesaLight.cxx
Utkarsh Ayachit's avatar
Utkarsh Ayachit committed
505
506
                 vtkMesaLightingPainter.cxx
                 vtkMesaPainterDeviceAdapter.cxx
507
508
509
                 vtkMesaPolyDataMapper.cxx
                 vtkMesaPolyDataMapper2D.cxx
                 vtkMesaProperty.cxx
Brad King's avatar
Brad King committed
510
                 vtkMesaRenderWindow.cxx
511
                 vtkMesaRenderer.cxx
Utkarsh Ayachit's avatar
Utkarsh Ayachit committed
512
513
                 vtkMesaRepresentationPainter.cxx
                 vtkMesaScalarsToColorsPainter.cxx
514
515
                 vtkMesaTexture.cxx
                 vtkXMesaRenderWindow.cxx
Berk Geveci's avatar
Berk Geveci committed
516
                )
Andy Cedilnik's avatar
Andy Cedilnik committed
517
    SET(KitOpenGL_SRCS ${KitOpenGL_SRCS}
518
519
      vtkMesaFreeTypeTextMapper.cxx
    )
Ken Martin's avatar
Ken Martin committed
520
    SET_SOURCE_FILES_PROPERTIES(vtkMesaRenderWindow ABSTRACT)
521
    SET (KIT_LIBS ${KIT_LIBS} ${MANGLED_MESA_LIBRARY})
522
    IF(MANGLED_OSMESA_LIBRARY)
523
      SET( KIT_LIBS ${KIT_LIBS} ${MANGLED_OSMESA_LIBRARY} )
524
525
526
    ENDIF(MANGLED_OSMESA_LIBRARY)
  ENDIF (MANGLED_MESA_LIBRARY)
ELSE (VTK_USE_MANGLED_MESA)
Alexander Neundorf's avatar
 
Alexander Neundorf committed
527
528
529
  IF(VTK_OPENGL_HAS_OSMESA  AND  OSMESA_LIBRARY)
    SET(KIT_LIBS ${KIT_LIBS} ${OSMESA_LIBRARY})
  ENDIF(VTK_OPENGL_HAS_OSMESA  AND  OSMESA_LIBRARY)
530
ENDIF(VTK_USE_MANGLED_MESA)
Andy Cedilnik's avatar
Andy Cedilnik committed
531
SET(Kit_SRCS ${Kit_SRCS} ${KitOpenGL_SRCS})
532
SET(Kit_EXTRA_SRCS ${Kit_EXTRA_SRCS} ${Kit_FT_SRCS})
533
534

IF(VTK_USE_GL2PS)
Alexander Neundorf's avatar
 
Alexander Neundorf committed
535
  SET(Kit_EXTRA_SRCS ${Kit_EXTRA_SRCS} ${Kit_GL2PS_SRCS})
536
537
ENDIF(VTK_USE_GL2PS)

Andy Cedilnik's avatar
Andy Cedilnik committed
538
539
540
541
542
SET(Kit_EXTRA_CMDS)
SET(Kit_TCL_EXTRA_SRCS)
SET(Kit_PYTHON_EXTRA_SRCS)
SET(Kit_JAVA_EXTRA_SRCS)
SET(Kit_TCL_EXTRA_CMDS)
543
544
545
SET(KIT_TCL_DEPS)
SET(KIT_PYTHON_DEPS)
SET(KIT_JAVA_DEPS)
Ken Martin's avatar
Ken Martin committed
546

Alexander Neundorf's avatar
 
Alexander Neundorf committed
547
IF (TK_FOUND AND VTK_USE_TK)
548
  SET(VTK_GENERATE_TK_INTERNALS 1)
Alexander Neundorf's avatar
 
Alexander Neundorf committed
549
550
ENDIF (TK_FOUND AND VTK_USE_TK)

551
IF(VTK_GENERATE_TK_INTERNALS)
552
553
554
555
556
  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)
557
  IF(NOT VTK_INSTALL_NO_DEVELOPMENT)
558
559
560
561
562
    INSTALL(FILES
      ${CMAKE_CURRENT_BINARY_DIR}/vtkTkInternals.h
      DESTINATION ${VTK_INSTALL_INCLUDE_DIR_CM24}
      COMPONENT Development
      )
563
  ENDIF(NOT VTK_INSTALL_NO_DEVELOPMENT)
564
  INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR})
565
ENDIF (VTK_GENERATE_TK_INTERNALS)
566

Alexander Neundorf's avatar
 
Alexander Neundorf committed
567
568
569
570
IF (VTK_WRAP_TCL AND VTK_USE_TK)
  SET(KitTCL_SRCS
    vtkTkRenderWidget.cxx
    vtkTkImageViewerWidget.cxx)
Ken Martin's avatar
updates  
Ken Martin committed
571

Alexander Neundorf's avatar
 
Alexander Neundorf committed
572
573
  # Use special interactor for X and Tk.
  IF(VTK_USE_X)
Alexander Neundorf's avatar
 
Alexander Neundorf committed
574
    SET(KitTCL_SRCS ${KitTCL_SRCS} vtkXRenderWindowTclInteractor.cxx)
Alexander Neundorf's avatar
 
Alexander Neundorf committed
575
576
577
578
579
  ENDIF(VTK_USE_X)
  SET(Kit_TCL_EXTRA_CMDS 
    vtkTkRenderWidget 
    vtkTkImageViewerWidget)
ENDIF (VTK_WRAP_TCL AND VTK_USE_TK)
Yves Starreveld's avatar
 
Yves Starreveld committed
580

581
582
#-----------------------------------------------------------------------------
# Include CMake code common to all kits.
583
INCLUDE(${VTK_CMAKE_DIR}/KitCommonBlock.cmake)
584
#-----------------------------------------------------------------------------
Alexander Neundorf's avatar
 
Alexander Neundorf committed
585
586
587
588
589
590

# 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
591
  ADD_DEPENDENCIES(vtk${KIT} vtkParseOGLExt)
Alexander Neundorf's avatar
 
Alexander Neundorf committed
592
ENDIF(NOT CMAKE_CROSSCOMPILING)
593

594
IF(NOT VTK_INSTALL_NO_DEVELOPMENT)
595
596
  INSTALL(FILES
    ${CMAKE_CURRENT_SOURCE_DIR}/vtkOpenGL.h
597
    ${CMAKE_CURRENT_BINARY_DIR}/vtkgl.h
598
599
    DESTINATION ${VTK_INSTALL_INCLUDE_DIR_CM24}
    COMPONENT Development
600
601
    )
ENDIF(NOT VTK_INSTALL_NO_DEVELOPMENT)
602

Alexander Neundorf's avatar
 
Alexander Neundorf committed
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
IF (VTK_WRAP_PYTHON AND VTK_USE_TK AND TK_FOUND)
  SET(RenderingPythonTkWidgets_SRCS
    vtkTkWidgetsInit.cxx
    vtkTkRenderWidgetPython.cxx
    vtkTkImageViewerWidgetPython.cxx
    )
  ADD_LIBRARY(vtkRenderingPythonTkWidgets SHARED
              ${RenderingPythonTkWidgets_SRCS})
  TARGET_LINK_LIBRARIES (vtkRenderingPythonTkWidgets
                        vtk${KIT}
                        ${VTK_TK_LIBRARIES})

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

Yves Starreveld's avatar
 
Yves Starreveld committed
629
IF(VTK_USE_X)
Sebastien Barre's avatar
Sebastien Barre committed
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
  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)
657
658
659
660
661
662
663
    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
664
  ENDIF(VTK_USE_TK)
Yves Starreveld's avatar
 
Yves Starreveld committed
665
ENDIF(VTK_USE_X)
666

667
IF(NOT VTK_INSTALL_NO_DEVELOPMENT)
668
669
670
671
672
  INSTALL(FILES
    ${VTK_SOURCE_DIR}/${KIT}/Testing/Cxx/vtkRegressionTestImage.h
    DESTINATION ${VTK_INSTALL_INCLUDE_DIR_CM24}
    COMPONENT Development
    )
673
ENDIF(NOT VTK_INSTALL_NO_DEVELOPMENT)
674
675
676
677
678
679

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)