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

6
7
include(vtkOpenGL)

VTK Developers's avatar
VTK Developers committed
8
# For tests that actually use a vtkRenderWindow
Ben Boeckel's avatar
Ben Boeckel committed
9
vtk_add_test_cxx(${vtk-module}CxxTests render_window_tests
VTK Developers's avatar
VTK Developers committed
10
  LoadOpenGLExtension.cxx
11
12
  TestFBO.cxx,NO_VALID
  TestGPUInfo.cxx,NO_VALID
13
  TestMonitors.cxx,NO_VALID
14
  TestPOVExporter.cxx,NO_VALID
15
  TestScalarsToColorsPainter.cxx
16
  TestSetImageOrientation.cxx
VTK Developers's avatar
VTK Developers committed
17
  TestTDx.cxx
18
19
  TestValuePainter.cxx,NO_VALID
  TestValuePasses.cxx
VTK Developers's avatar
VTK Developers committed
20
  )
Cory Quammen's avatar
Cory Quammen committed
21
22
23
24
25
26
vtk_add_test_cxx(${vtk-module}CxxTests render_window_tests
  TestScalarsToColorsPainterFieldDataCells,TestScalarsToColorsPainterFieldData.cxx -1
  )
vtk_add_test_cxx(${vtk-module}CxxTests render_window_tests
  TestScalarsToColorsPainterFieldDataTuple,TestScalarsToColorsPainterFieldData.cxx 50
  )
27
28
29
30
31
32
vtk_add_test_cxx(${vtk-module}CxxTests render_window_tests
  TestBlurAndSobelPasses.cxx
  #TestGaussianBlurPass.cxx # Missing symbol checking for Mesa bug
  TestLightActor.cxx
  TestSobelGradientMagnitudePass.cxx)
if(NOT APPLE)
33
  vtk_add_test_cxx(${vtk-module}CxxTests render_window_tests
34
35
    TestShadowMapPass.cxx)
endif()
Ken Martin's avatar
Ken Martin committed
36

37
38
39
if(WIN32 AND NOT VTK_USE_X)
  vtk_add_test_cxx(${vtk-module}CxxTests render_window_tests
    TestWin32OpenGLRenderWindow.cxx NO_VALID)
VTK Developers's avatar
VTK Developers committed
40
endif()
41

Ben Boeckel's avatar
Ben Boeckel committed
42
vtk_add_test_cxx(${vtk-module}CxxTests ogl_tests
43
  TestScenePicker.cxx,NO_VALID
Ken Martin's avatar
Ken Martin committed
44
45
46
  TestMultiblockDisplayProperties.cxx
  TestMultiTexturing.cxx
  TestMultiTexturingTransform.cxx)
VTK Developers's avatar
VTK Developers committed
47

48
set(VTK_USE_GLSL_SHADERS FALSE)
VTK Developers's avatar
VTK Developers committed
49
50
if(VTK_USE_GLSL_SHADERS)
  # Tests testing GLSL Shaders.
Ben Boeckel's avatar
Ben Boeckel committed
51
  vtk_add_test_cxx(${vtk-module}CxxTests glsl_tests
VTK Developers's avatar
VTK Developers committed
52
53
54
55
    TestGenericVertexAttributesGLSLCxx.cxx
    TestGenericVertexAttributesGLSLAlphaBlending.cxx
    TestGenericVertexAttributesGLSLDepthPeelingPass.cxx
    )
Ben Boeckel's avatar
Ben Boeckel committed
56
57
  list(APPEND ogl_tests
    ${glsl_tests})
VTK Developers's avatar
VTK Developers committed
58
endif()
59

Ben Boeckel's avatar
Ben Boeckel committed
60
61
62
63
set(all_tests
  ${render_window_tests}
  ${ogl_tests})
vtk_test_cxx_executable(${vtk-module}CxxTests all_tests)
64
65
66
# LoadOpenGLExtension and TestGenericVertexAttributesGLSLDepthPeelingPass
# requires OpenGL
vtk_opengl_link(${vtk-module}CxxTests)
Ken Martin's avatar
Ken Martin committed
67

68
69
if (WIN32 AND NOT VTK_USE_X)
  # This test should not take more than 5 seconds.
Ben Boeckel's avatar
Ben Boeckel committed
70
  set_tests_properties(${vtk-module}Cxx-TestWin32OpenGLRenderWindow
71
72
73
74
    PROPERTIES
      TIMEOUT 5)
endif ()

VTK Developers's avatar
VTK Developers committed
75
set(TEST_FBO_IMPLEMENTATION_EXE
76
  TestFBOImplementation)
VTK Developers's avatar
VTK Developers committed
77
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/TestFBOInclude.h.in
78
  ${CMAKE_CURRENT_BINARY_DIR}/TestFBOInclude.h
79
  @ONLY ESCAPE_QUOTES)
80
81
82
83

# 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
84
vtk_module_test_executable(TestFBOImplementation
85
  TestFBOImplementation.cxx)
86
vtk_opengl_link(TestFBOImplementation)
87
target_link_libraries(TestFBOImplementation LINK_PRIVATE
88
                      vtkRenderingOpenGL)
89

Ken Martin's avatar
Ken Martin committed
90
91

# Add other odd tests or executables
VTK Developers's avatar
VTK Developers committed
92
93
94
95
96
97
foreach(exe
  TimeRenderer
  TimeRenderer2
  VTKBenchMark
  )
  add_executable(${exe} ${exe}.cxx)
98
99
  vtk_opengl_link(${exe})
  target_link_libraries(${exe} LINK_PRIVATE
VTK Developers's avatar
VTK Developers committed
100
101
102
103
    vtkRenderingOpenGL
    vtkInteractionStyle
    vtkImagingSources
    vtkImagingGeneral
104
    vtkFiltersSources
105
106
107
    vtkIOCore)
  if(APPLE AND NOT VTK_USE_OSMESA)
    target_link_libraries(${exe} LINK_PRIVATE "-framework GLUT")
VTK Developers's avatar
VTK Developers committed
108
109
  endif()
endforeach()
110

111
112
113
114
115
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()