Commit 03294a75 authored by Utkarsh Ayachit's avatar Utkarsh Ayachit Committed by Ben Boeckel

vtkRenderingGL2PSOpenGL2: update to the new module system

parent 405e0521
# Find the GhostScript executable for GL2PS tests.
find_program(VTK_GHOSTSCRIPT_EXECUTABLE gs gswin32c gsos2)
mark_as_advanced(VTK_GHOSTSCRIPT_EXECUTABLE)
# Find the GhostScript executable for GL2PS tests.
find_program(VTK_GHOSTSCRIPT_EXECUTABLE gs gswin32c gsos2)
mark_as_advanced(VTK_GHOSTSCRIPT_EXECUTABLE)
# vtk_add_gl2ps_test_cxx([pdf] <test> [<another test> <yet another test> ...])
#
# Takes a list of test source files as arguments and adds additional tests
......@@ -25,7 +29,7 @@ function(vtk_add_gl2ps_test_cxx)
get_filename_component(TName ${testsrc} NAME_WE)
# Convert ps to png
add_test(NAME ${vtk-module}Cxx-${TName}-RasterizePNG
add_test(NAME ${_vtk_build_test}Cxx-${TName}-RasterizePNG
COMMAND ${CMAKE_COMMAND}
"-DPSFILE=${_vtk_build_TEST_OUTPUT_DIRECTORY}/${TName}.ps"
"-DPNGFILE=${_vtk_build_TEST_OUTPUT_DIRECTORY}/${TName}-raster.png"
......@@ -35,12 +39,12 @@ function(vtk_add_gl2ps_test_cxx)
-DRASTERIZE_PDF=${RASTERIZE_PDF}
-P "${vtkTestingGL2PS_SOURCE_DIR}/RasterizePostScript.cmake"
)
set_tests_properties("${vtk-module}Cxx-${TName}-RasterizePNG"
set_tests_properties("${_vtk_build_test}Cxx-${TName}-RasterizePNG"
PROPERTIES
DEPENDS "${vtk-module}Cxx-${TName}"
DEPENDS "${_vtk_build_test}Cxx-${TName}"
REQUIRED_FILES
"${_vtk_build_TEST_OUTPUT_DIRECTORY}/${TName}.ps"
LABELS "${${vtk-module}_TEST_LABELS}"
LABELS "${_vtk_build_test_labels}"
)
get_filename_component(TName ${test} NAME_WE)
......@@ -52,7 +56,7 @@ function(vtk_add_gl2ps_test_cxx)
# Image diff rasterized png produced from a PS with baseline
ExternalData_add_test(VTKData
NAME ${vtk-module}Cxx-${TName}-VerifyRasterizedPNG
NAME ${_vtk_build_test}Cxx-${TName}-VerifyRasterizedPNG
COMMAND "vtkRenderingGL2PSOpenGL2CxxTests" PNGCompare
-D "${_vtk_build_TEST_DATA_DIRECTORY}"
-T "${_vtk_build_TEST_OUTPUT_DIRECTORY}"
......@@ -60,16 +64,16 @@ function(vtk_add_gl2ps_test_cxx)
-V "DATA{../Data/Baseline/${TName}-rasterRef.png,:}"
--test-file "${_vtk_build_TEST_OUTPUT_DIRECTORY}/${TName}-raster.png"
)
set_tests_properties("${vtk-module}Cxx-${TName}-VerifyRasterizedPNG"
set_tests_properties("${_vtk_build_test}Cxx-${TName}-VerifyRasterizedPNG"
PROPERTIES
DEPENDS "${vtk-module}Cxx-${TName}-RasterizePNG"
DEPENDS "${_vtk_build_test}Cxx-${TName}-RasterizePNG"
REQUIRED_FILES
"${_vtk_build_TEST_OUTPUT_DIRECTORY}/${TName}-raster.png"
LABELS "${${vtk-module}_TEST_LABELS}"
LABELS "${_vtk_build_test_labels}"
)
if(${RASTERIZE_PDF})
ExternalData_add_test(VTKData
NAME ${vtk-module}Cxx-${TName}-VerifyRasterizedPDFPNG
NAME ${_vtk_build_test}Cxx-${TName}-VerifyRasterizedPDFPNG
COMMAND "vtkRenderingGL2PSOpenGL2CxxTests" PNGCompare
-D "${_vtk_build_TEST_DATA_DIRECTORY}"
-T "${_vtk_build_TEST_OUTPUT_DIRECTORY}"
......@@ -77,12 +81,12 @@ function(vtk_add_gl2ps_test_cxx)
-V "DATA{../Data/Baseline/${TName}-rasterRef.png,:}"
--test-file "${_vtk_build_TEST_OUTPUT_DIRECTORY}/${TName}-raster-pdf.png"
)
set_tests_properties("${vtk-module}Cxx-${TName}-VerifyRasterizedPDFPNG"
set_tests_properties("${_vtk_build_test}Cxx-${TName}-VerifyRasterizedPDFPNG"
PROPERTIES
DEPENDS "${vtk-module}Cxx-${TName}-RasterizePNG"
DEPENDS "${_vtk_build_test}Cxx-${TName}-RasterizePNG"
REQUIRED_FILES
"${_vtk_build_TEST_OUTPUT_DIRECTORY}/${TName}-raster-pdf.png"
LABELS "${${vtk-module}_TEST_LABELS}"
LABELS "${_vtk_build_test_labels}"
)
endif()
endforeach()
......
include(vtkObjectFactory)
vtk_add_override(vtkOpenGLGL2PSHelper vtkOpenGLGL2PSHelperImpl)
vtk_object_factory_configure("${vtk_module_overrides}")
vtk_object_factory_declare(
BASE vtkOpenGLGL2PSHelper
OVERRIDE vtkOpenGLGL2PSHelperImpl)
vtk_object_factory_configure(
SOURCE_FILE vtk_object_factory_source
HEADER_FILE vtk_object_factory_header
EXPORT_MACRO "VTKRENDERINGGL2PSOPENGL2_EXPORT")
set(Module_SRCS
vtkOpenGLGL2PSHelperImpl.cxx
${CMAKE_CURRENT_BINARY_DIR}/${vtk-module}ObjectFactory.cxx
)
set(classes
vtkOpenGLGL2PSHelperImpl)
vtk_module_library(${vtk-module} ${Module_SRCS})
include(vtkOpenGL)
vtk_opengl_link(${vtk-module})
vtk_module_add_module(VTK::RenderingGL2PSOpenGL2
CLASSES ${classes}
SOURCES ${vtk_object_factory_source}
PRIVATE_HEADERS ${vtk_object_factory_header})
include(vtkGhostscript)
include(vtkTestingGL2PS)
include(vtkOpenGL)
include(../../../../CMake/vtkTestingGL2PS.cmake)
set(GL2PSTests)
if(VTK_GHOSTSCRIPT_EXECUTABLE)
......@@ -19,4 +17,3 @@ vtk_add_gl2ps_test_cxx(${GL2PSTests})
list(APPEND tests PNGCompare)
vtk_test_cxx_executable(vtkRenderingGL2PSOpenGL2CxxTests tests RENDERING_FACTORY)
vtk_opengl_link(vtkRenderingGL2PSOpenGL2CxxTests)
if(ANDROID OR APPLE_IOS) # No GL2PS on mobile
return()
endif()
vtk_module(vtkRenderingGL2PSOpenGL2
IMPLEMENTS
vtkRenderingOpenGL2
BACKEND
OpenGL2
TEST_DEPENDS
vtkTestingRendering
vtkInteractionStyle
DEPENDS
vtkRenderingOpenGL2
PRIVATE_DEPENDS
vtkCommonCore
vtkCommonDataModel
vtkCommonMath
vtkRenderingCore
vtkRenderingOpenGL2
vtkgl2ps
)
NAME
VTK::RenderingGL2PSOpenGL2
LIBRARY_NAME
vtkRenderingGL2PSOpenGL2
CONDITION
NOT ANDROID AND NOT APPLE_IOS
IMPLEMENTS
VTK::RenderingOpenGL2
DEPENDS
VTK::RenderingOpenGL2
PRIVATE_DEPENDS
VTK::CommonCore
VTK::CommonDataModel
VTK::CommonMath
VTK::RenderingCore
VTK::RenderingOpenGL2
VTK::gl2ps
VTK::opengl
TEST_DEPENDS
VTK::InteractionStyle
VTK::TestingRendering
VTK::gl2ps
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment