CMakeLists.txt 3.07 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
vtk_add_test_cxx(${vtk-module}CxxTests render_window_tests
VTK Developers's avatar
VTK Developers committed
8
  LoadOpenGLExtension.cxx
9
10
  TestFBO.cxx,NO_VALID
  TestGPUInfo.cxx,NO_VALID
11
  TestMonitors.cxx,NO_VALID
12
  TestPOVExporter.cxx,NO_VALID
13
  TestScalarsToColorsPainter.cxx
14
  TestSetImageOrientation.cxx
VTK Developers's avatar
VTK Developers committed
15
16
  TestTDx.cxx
  )
17
18
19
20
21
22
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)
23
  vtk_add_test_cxx(${vtk-module}CxxTests render_window_tests
24
25
    TestShadowMapPass.cxx)
endif()
Ken Martin's avatar
Ken Martin committed
26

27
28
29
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
30
endif()
31

32
33
include_directories(${OPENGL_INCLUDE_DIR})

Ben Boeckel's avatar
Ben Boeckel committed
34
vtk_add_test_cxx(${vtk-module}CxxTests ogl_tests
35
  TestScenePicker.cxx,NO_VALID
Ken Martin's avatar
Ken Martin committed
36
37
38
  TestMultiblockDisplayProperties.cxx
  TestMultiTexturing.cxx
  TestMultiTexturingTransform.cxx)
VTK Developers's avatar
VTK Developers committed
39

40
set(VTK_USE_GLSL_SHADERS FALSE)
VTK Developers's avatar
VTK Developers committed
41
42
if(VTK_USE_GLSL_SHADERS)
  # Tests testing GLSL Shaders.
Ben Boeckel's avatar
Ben Boeckel committed
43
  vtk_add_test_cxx(${vtk-module}CxxTests glsl_tests
VTK Developers's avatar
VTK Developers committed
44
45
46
47
    TestGenericVertexAttributesGLSLCxx.cxx
    TestGenericVertexAttributesGLSLAlphaBlending.cxx
    TestGenericVertexAttributesGLSLDepthPeelingPass.cxx
    )
Ben Boeckel's avatar
Ben Boeckel committed
48
49
  list(APPEND ogl_tests
    ${glsl_tests})
VTK Developers's avatar
VTK Developers committed
50
endif()
51

Ben Boeckel's avatar
Ben Boeckel committed
52
53
54
55
set(all_tests
  ${render_window_tests}
  ${ogl_tests})
vtk_test_cxx_executable(${vtk-module}CxxTests all_tests)
Ken Martin's avatar
Ken Martin committed
56

VTK Developers's avatar
VTK Developers committed
57
set(TEST_FBO_IMPLEMENTATION_EXE
58
  TestFBOImplementation)
VTK Developers's avatar
VTK Developers committed
59
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/TestFBOInclude.h.in
60
  ${CMAKE_CURRENT_BINARY_DIR}/TestFBOInclude.h
61
  @ONLY ESCAPE_QUOTES)
62
63
64
65

# 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
66
vtk_module_test_executable(TestFBOImplementation
67
  TestFBOImplementation.cxx)
68
target_link_libraries(TestFBOImplementation LINK_PRIVATE
VTK Developers's avatar
VTK Developers committed
69
  vtkRenderingOpenGL ${OPENGL_gl_LIBRARY})
70

VTK Developers's avatar
VTK Developers committed
71
if(VTK_OPENGL_HAS_OSMESA AND OSMESA_LIBRARY)
72
73
  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
74
endif()
Ken Martin's avatar
Ken Martin committed
75
76

# Add other odd tests or executables
VTK Developers's avatar
VTK Developers committed
77
78
79
80
81
82
83
84
foreach(exe
  TimeRenderer
  TimeRenderer2
  VTKBenchMark
  )
  add_executable(${exe} ${exe}.cxx)
  target_link_libraries(${exe}
    vtkRenderingOpenGL
85
    vtkRenderingFreeTypeOpenGL
VTK Developers's avatar
VTK Developers committed
86
87
88
    vtkInteractionStyle
    vtkImagingSources
    vtkImagingGeneral
89
    vtkFiltersSources
VTK Developers's avatar
VTK Developers committed
90
91
92
93
94
95
96
97
98
    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()
99

100
101
102
103
104
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()