CMakeLists.txt 4.59 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
  LoadOpenGLExtension.cxx
10
11
  TestFBO.cxx,NO_VALID
  TestGPUInfo.cxx,NO_VALID
VTK Developers's avatar
VTK Developers committed
12
13
  TestGradientBackground.cxx
  TestHomogeneousTransformOfActor.cxx
14
15
16
17
  TestInteractorStyleImageProperty.cxx,NO_VALID
  TestInteractorTimers.cxx,NO_VALID
  TestLODActor.cxx,NO_VALID
  TestManyActors.cxx,NO_VALID
18
  TestMonitors.cxx,NO_VALID
VTK Developers's avatar
VTK Developers committed
19
20
21
22
  TestOffAxisStereo.cxx
  TestOrderedTriangulator.cxx
  TestOpacity.cxx
  TestOSConeCxx.cxx
23
  TestPolygonSelection.cxx
24
  TestPOVExporter.cxx,NO_VALID
VTK Developers's avatar
VTK Developers committed
25
26
  TestResetCameraVerticalAspectRatio.cxx
  TestResetCameraVerticalAspectRatioParallel.cxx
27
  TestSetImageOrientation.cxx
VTK Developers's avatar
VTK Developers committed
28
29
30
31
32
  TestTextActorAlphaBlending.cxx
  TestTextActorDepthPeeling.cxx
  TestTextActor3DAlphaBlending.cxx
  TestTextActor3DDepthPeeling.cxx
  TestTexturedBackground.cxx
33
  TestTextureSize.cxx,NO_VALID
VTK Developers's avatar
VTK Developers committed
34
  TestTDx.cxx
35
  TestTilingCxx.cxx
VTK Developers's avatar
VTK Developers committed
36
37
38
39
40
41
  TestTransformCoordinateUseDouble.cxx
  TestTranslucentLUTAlphaBlending.cxx
  TestTranslucentLUTDepthPeeling.cxx
  TestTranslucentLUTTextureAlphaBlending.cxx
  TestTranslucentLUTTextureDepthPeeling.cxx
  )
Ken Martin's avatar
Ken Martin committed
42
if(NOT VTK_REPLACE_OPENGL_OVERRIDES)
43
44
45
46
47
48
  vtk_add_test_cxx(${vtk-module}CxxTests render_window_tests
    TestBlurAndSobelPasses.cxx
    TestGaussianBlurPass.cxx
    TestLightActor.cxx
    TestSobelGradientMagnitudePass.cxx
    TestTranslucentLUTDepthPeelingPass.cxx)
Ken Martin's avatar
Ken Martin committed
49
  if(NOT APPLE)
50
51
    vtk_add_test_cxx(${vtk-module}CxxTests render_window_tests
      TestShadowMapPass.cxx)
Ken Martin's avatar
Ken Martin committed
52
53
54
  endif()

  if(WIN32 AND NOT VTK_USE_X)
55
56
    vtk_add_test_cxx(${vtk-module}CxxTests render_window_tests
      TestWin32OpenGLRenderWindow.cxx NO_VALID)
Ken Martin's avatar
Ken Martin committed
57
  endif()
VTK Developers's avatar
VTK Developers committed
58
endif()
59

60
61
include_directories(${OPENGL_INCLUDE_DIR})

Ben Boeckel's avatar
Ben Boeckel committed
62
vtk_add_test_cxx(${vtk-module}CxxTests ogl_tests
63
64
65
66
67
68
69
70
71
72
73
74
75
  TestGlyph3DMapperArrow.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
76
  TestLabelPlacementMapper.cxx
77
  )
Ken Martin's avatar
Ken Martin committed
78
79
80
81
82
83
if(NOT VTK_REPLACE_OPENGL_OVERRIDES)
  vtk_add_test_cxx(
  TestMultiblockDisplayProperties.cxx
  TestMultiTexturing.cxx
  TestMultiTexturingTransform.cxx)
endif()
VTK Developers's avatar
VTK Developers committed
84

85
set(VTK_USE_GLSL_SHADERS FALSE)
VTK Developers's avatar
VTK Developers committed
86
87
if(VTK_USE_GLSL_SHADERS)
  # Tests testing GLSL Shaders.
Ben Boeckel's avatar
Ben Boeckel committed
88
  vtk_add_test_cxx(${vtk-module}CxxTests glsl_tests
VTK Developers's avatar
VTK Developers committed
89
90
91
92
    TestGenericVertexAttributesGLSLCxx.cxx
    TestGenericVertexAttributesGLSLAlphaBlending.cxx
    TestGenericVertexAttributesGLSLDepthPeelingPass.cxx
    )
Ben Boeckel's avatar
Ben Boeckel committed
93
94
  list(APPEND ogl_tests
    ${glsl_tests})
VTK Developers's avatar
VTK Developers committed
95
endif()
96

Ben Boeckel's avatar
Ben Boeckel committed
97
98
99
100
set(all_tests
  ${render_window_tests}
  ${ogl_tests})
vtk_test_cxx_executable(${vtk-module}CxxTests all_tests)
Ken Martin's avatar
Ken Martin committed
101

VTK Developers's avatar
VTK Developers committed
102
set(TEST_FBO_IMPLEMENTATION_EXE
103
  TestFBOImplementation)
VTK Developers's avatar
VTK Developers committed
104
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/TestFBOInclude.h.in
105
  ${CMAKE_CURRENT_BINARY_DIR}/TestFBOInclude.h
106
  @ONLY ESCAPE_QUOTES)
107
108
109
110

# 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
111
vtk_module_test_executable(TestFBOImplementation
112
  TestFBOImplementation.cxx)
113
target_link_libraries(TestFBOImplementation LINK_PRIVATE
VTK Developers's avatar
VTK Developers committed
114
  vtkRenderingOpenGL ${OPENGL_gl_LIBRARY})
115

VTK Developers's avatar
VTK Developers committed
116
if(VTK_OPENGL_HAS_OSMESA AND OSMESA_LIBRARY)
117
118
  target_link_libraries(TestFBOImplementation LINK_PRIVATE ${OSMESA_LIBRARY})
  target_link_libraries(${vtk-module}CxxTests LINK_PRIVATE ${OSMESA_LIBRARY})
VTK Developers's avatar
VTK Developers committed
119
endif()
Ken Martin's avatar
Ken Martin committed
120
121

# Add other odd tests or executables
VTK Developers's avatar
VTK Developers committed
122
123
124
125
126
127
128
129
foreach(exe
  TimeRenderer
  TimeRenderer2
  VTKBenchMark
  )
  add_executable(${exe} ${exe}.cxx)
  target_link_libraries(${exe}
    vtkRenderingOpenGL
130
    vtkRenderingFreeTypeOpenGL
VTK Developers's avatar
VTK Developers committed
131
132
133
    vtkInteractionStyle
    vtkImagingSources
    vtkImagingGeneral
134
    vtkFiltersSources
VTK Developers's avatar
VTK Developers committed
135
136
137
138
139
140
141
142
143
    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()
144

145
146
147
148
149
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()
150
151
152
153

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