CMakeLists.txt 5.47 KB
Newer Older
1
2
3
4
5
INCLUDE_DIRECTORIES(
  ${CMAKE_CURRENT_BINARY_DIR}
  ${CMAKE_CURRENT_SOURCE_DIR}
)

VTK Developers's avatar
VTK Developers committed
6
# For tests that actually use a vtkRenderWindow
Ben Boeckel's avatar
Ben Boeckel committed
7
8
vtk_add_test_cxx(${vtk-module}CxxTests render_window_tests
  otherCoordinate.cxx,NO_DATA,NO_VALID
VTK Developers's avatar
VTK Developers committed
9
10
11
12
13
  LoadOpenGLExtension.cxx
  TestActorLightingFlag.cxx
  TestAnimationScene.cxx
  TestBackfaceCulling.cxx
  TestBlurAndSobelPasses.cxx
14
  TestCellPickerImage.cxx
15
  TestDynamic2DLabelMapper.cxx
16
  TestFBO.cxx,NO_VALID
VTK Developers's avatar
VTK Developers committed
17
18
19
20
21
22
  TestFollowerPicking.cxx
  TestGaussianBlurPass.cxx
  TestGlyph3DMapper.cxx
  TestGlyph3DMapperMasking.cxx
  TestGlyph3DMapperOrientationArray.cxx
  TestGlyph3DMapperPicking.cxx
23
  TestGPUInfo.cxx,NO_VALID
VTK Developers's avatar
VTK Developers committed
24
25
  TestGradientBackground.cxx
  TestHomogeneousTransformOfActor.cxx
26
27
28
29
30
31
  TestImageResliceMapperAlpha.cxx
  TestImageResliceMapperBackground.cxx
  TestImageResliceMapperInterpolation.cxx
  TestImageResliceMapperOffAxis.cxx
  TestImageResliceMapperOrient3D.cxx
  TestImageResliceMapperSlab.cxx
VTK Developers's avatar
VTK Developers committed
32
33
34
35
36
  TestImageSliceMapperAlpha.cxx
  TestImageSliceMapperBackground.cxx
  TestImageSliceMapperOrient2D.cxx
  TestImageSliceMapperOrient3D.cxx
  TestImageSliceMapperInterpolation.cxx
37
  TestImageStack.cxx
38
39
  TestInteractorStyleImageProperty.cxx,NO_VALID
  TestInteractorTimers.cxx,NO_VALID
40
41
42
43
44
  TestLabelPlacer.cxx
  TestLabelPlacer2D.cxx
  TestLabelPlacerCoincidentPoints.cxx
  TestLabelPlacementMapper2D.cxx
  TestLabelPlacementMapperCoincidentPoints.cxx
VTK Developers's avatar
VTK Developers committed
45
  TestLightActor.cxx
46
47
  TestLODActor.cxx,NO_VALID
  TestManyActors.cxx,NO_VALID
48
  TestMonitors.cxx,NO_VALID
VTK Developers's avatar
VTK Developers committed
49
50
51
52
  TestOffAxisStereo.cxx
  TestOrderedTriangulator.cxx
  TestOpacity.cxx
  TestOSConeCxx.cxx
53
  TestPolygonSelection.cxx
54
  TestPOVExporter.cxx,NO_VALID
VTK Developers's avatar
VTK Developers committed
55
56
  TestResetCameraVerticalAspectRatio.cxx
  TestResetCameraVerticalAspectRatioParallel.cxx
57
  TestSetImageOrientation.cxx
VTK Developers's avatar
VTK Developers committed
58
59
60
61
62
63
  TestSobelGradientMagnitudePass.cxx
  TestTextActorAlphaBlending.cxx
  TestTextActorDepthPeeling.cxx
  TestTextActor3DAlphaBlending.cxx
  TestTextActor3DDepthPeeling.cxx
  TestTexturedBackground.cxx
64
  TestTextureSize.cxx,NO_VALID
VTK Developers's avatar
VTK Developers committed
65
  TestTDx.cxx
66
  TestTilingCxx.cxx
VTK Developers's avatar
VTK Developers committed
67
68
69
70
71
72
73
  TestTransformCoordinateUseDouble.cxx
  TestTranslucentLUTAlphaBlending.cxx
  TestTranslucentLUTDepthPeeling.cxx
  TestTranslucentLUTDepthPeelingPass.cxx
  TestTranslucentLUTTextureAlphaBlending.cxx
  TestTranslucentLUTTextureDepthPeeling.cxx
  )
Brad King's avatar
Brad King committed
74
if(NOT APPLE)
Ben Boeckel's avatar
Ben Boeckel committed
75
76
77
78
  vtk_add_test_cxx(${vtk-module}CxxTests no_apple_tests
    TestShadowMapPass.cxx)
  list(APPEND render_window_tests
    ${no_apple_tests})
79
80
endif()

VTK Developers's avatar
VTK Developers committed
81
if(WIN32 AND NOT VTK_USE_X)
Ben Boeckel's avatar
Ben Boeckel committed
82
83
84
85
86
  vtk_add_test_cxx(${vtk-module}CxxTests win32_tests
    NO_VALID
    TestWin32OpenGLRenderWindow.cxx)
  list(APPEND render_window_tests
    ${win32_tests})
VTK Developers's avatar
VTK Developers committed
87
endif()
88

89
90
include_directories(${OPENGL_INCLUDE_DIR})

Ben Boeckel's avatar
Ben Boeckel committed
91
vtk_add_test_cxx(${vtk-module}CxxTests ogl_tests
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
  TestAreaSelections.cxx
  TestGlyph3DMapperArrow.cxx
  TestMultiblockDisplayProperties.cxx
  TestMultiTexturing.cxx
  TestMultiTexturingTransform.cxx
  TestImageSliceMapperBorder.cxx
  TestImageResliceMapperBorder.cxx
  TestScalarBar.cxx
  TestScenePicker.cxx,NO_VALID
  TestTextureRGBA.cxx
  TestTextureRGBADepthPeeling.cxx
  TestTranslucentImageActorAlphaBlending.cxx
  TestTranslucentImageActorDepthPeeling.cxx
  TestTStripsColorsTCoords.cxx
  TestTStripsNormalsColorsTCoords.cxx
  TestTStripsNormalsTCoords.cxx
  TestTStripsTCoords.cxx
109
110
111
  RenderNonFinite.cxx
  SurfacePlusEdges.cxx
  TestLabelPlacementMapper.cxx
112
  )
VTK Developers's avatar
VTK Developers committed
113

114
set(VTK_USE_GLSL_SHADERS FALSE)
VTK Developers's avatar
VTK Developers committed
115
116
if(VTK_USE_GLSL_SHADERS)
  # Tests testing GLSL Shaders.
Ben Boeckel's avatar
Ben Boeckel committed
117
  vtk_add_test_cxx(${vtk-module}CxxTests glsl_tests
VTK Developers's avatar
VTK Developers committed
118
119
120
121
    TestGenericVertexAttributesGLSLCxx.cxx
    TestGenericVertexAttributesGLSLAlphaBlending.cxx
    TestGenericVertexAttributesGLSLDepthPeelingPass.cxx
    )
Ben Boeckel's avatar
Ben Boeckel committed
122
123
  list(APPEND ogl_tests
    ${glsl_tests})
VTK Developers's avatar
VTK Developers committed
124
endif()
125

Ben Boeckel's avatar
Ben Boeckel committed
126
127
128
129
set(all_tests
  ${render_window_tests}
  ${ogl_tests})
vtk_test_cxx_executable(${vtk-module}CxxTests all_tests)
Ken Martin's avatar
Ken Martin committed
130

VTK Developers's avatar
VTK Developers committed
131
set(TEST_FBO_IMPLEMENTATION_EXE
132
  TestFBOImplementation)
VTK Developers's avatar
VTK Developers committed
133
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/TestFBOInclude.h.in
134
  ${CMAKE_CURRENT_BINARY_DIR}/TestFBOInclude.h
135
  @ONLY ESCAPE_QUOTES)
136
137
138
139

# This is used by TestFBO. Using a separate processes makes is possible to
# avoid issues to OpenGL implementations segfaulting etc. from affecting the
# test.
VTK Developers's avatar
VTK Developers committed
140
vtk_module_test_executable(TestFBOImplementation
141
  TestFBOImplementation.cxx)
142
target_link_libraries(TestFBOImplementation LINK_PRIVATE
VTK Developers's avatar
VTK Developers committed
143
  vtkRenderingOpenGL ${OPENGL_gl_LIBRARY})
144

VTK Developers's avatar
VTK Developers committed
145
if(VTK_OPENGL_HAS_OSMESA AND OSMESA_LIBRARY)
146
  target_link_libraries(TestFBOImplementation LINK_PRIVATE ${OSMESA_LIBRARY})
VTK Developers's avatar
VTK Developers committed
147
endif()
148

VTK Developers's avatar
VTK Developers committed
149
if(VTK_OPENGL_HAS_OSMESA AND OSMESA_LIBRARY)
150
  target_link_libraries(${vtk-module}CxxTests LINK_PRIVATE ${OSMESA_LIBRARY})
VTK Developers's avatar
VTK Developers committed
151
endif()
Ken Martin's avatar
Ken Martin committed
152
153

# Add other odd tests or executables
VTK Developers's avatar
VTK Developers committed
154
155
156
157
158
159
160
161
foreach(exe
  TimeRenderer
  TimeRenderer2
  VTKBenchMark
  )
  add_executable(${exe} ${exe}.cxx)
  target_link_libraries(${exe}
    vtkRenderingOpenGL
162
    vtkRenderingFreeTypeOpenGL
VTK Developers's avatar
VTK Developers committed
163
164
165
    vtkInteractionStyle
    vtkImagingSources
    vtkImagingGeneral
166
    vtkFiltersSources
VTK Developers's avatar
VTK Developers committed
167
168
169
170
171
172
173
174
175
    vtkIOCore
    ${OPENGL_gl_LIBRARY})
  if(APPLE)
    target_link_libraries(${exe} "-framework GLUT")
  endif()
  if(VTK_OPENGL_HAS_OSMESA AND OSMESA_LIBRARY)
    target_link_libraries(${exe} ${OSMESA_LIBRARY})
  endif()
endforeach()
176

177
178
179
180
181
if(VTK_USE_GLSL_SHADERS)
  set_tests_properties(
    ${vtk-module}Cxx-TestGenericVertexAttributesGLSLDepthPeelingPass
    PROPERTIES FAIL_REGULAR_EXPRESSION "ERROR:.*vtkOpenGLProperty.*Couldn't build the shader program. At this point , it can be an error in a shader or a driver bug.")
endif()
182
183
184
185

set_tests_properties(${vtk-module}Cxx-TestOpacity
  PROPERTIES TIMEOUT 70)
set_tests_properties(${vtk-module}Cxx-TestTextureSize
Utkarsh Ayachit's avatar
Utkarsh Ayachit committed
186
  PROPERTIES TIMEOUT 300)