Commit 58dc2ad1 authored by Utkarsh Ayachit's avatar Utkarsh Ayachit Committed by Ben Boeckel

vtkRenderingOSPRay: update to the new module system

parent 1a1d6066
find_package(OSPRay REQUIRED)
set(classes
vtkOSPRayActorNode
vtkOSPRayAMRVolumeMapperNode
vtkOSPRayCameraNode
vtkOSPRayCompositePolyDataMapper2Node
vtkOSPRayLightNode
vtkOSPRayMaterialHelpers
vtkOSPRayMaterialLibrary
vtkOSPRayPass
vtkOSPRayPolyDataMapperNode
vtkOSPRayVolumeCache
vtkOSPRayRendererNode
vtkOSPRayTetrahedraMapperNode
vtkOSPRayViewNodeFactory
vtkOSPRayVolumeMapper
vtkOSPRayVolumeMapperNode
vtkOSPRayVolumeNode
vtkOSPRayWindowNode)
set(Module_SRCS
vtkOSPRayActorNode.cxx
vtkOSPRayAMRVolumeMapperNode.cxx
vtkOSPRayVolumeNode.cxx
vtkOSPRayCameraNode.cxx
vtkOSPRayCompositePolyDataMapper2Node.cxx
vtkOSPRayLightNode.cxx
vtkOSPRayMaterialHelpers.cxx
vtkOSPRayMaterialLibrary.cxx
vtkOSPRayPass.cxx
vtkOSPRayPolyDataMapperNode.cxx
vtkOSPRayVolumeCache.cxx
vtkOSPRayVolumeMapper.cxx
vtkOSPRayVolumeMapperNode.cxx
vtkOSPRayTetrahedraMapperNode.cxx
vtkOSPRayRendererNode.cxx
vtkOSPRayViewNodeFactory.cxx
vtkOSPRayWindowNode.cxx
)
vtk_object_factory_declare(
BASE vtkOSPRayVolumeInterface
OVERRIDE vtkOSPRayVolumeMapper)
include(vtkObjectFactory)
vtk_add_override(vtkOSPRayVolumeInterface vtkOSPRayVolumeMapper)
vtk_object_factory_configure("${vtk_module_overrides}")
list(APPEND Module_SRCS
${CMAKE_CURRENT_BINARY_DIR}/${vtk-module}ObjectFactory.cxx)
vtk_object_factory_configure(
SOURCE_FILE vtk_object_factory_source
HEADER_FILE vtk_object_factory_header
EXPORT_MACRO "VTKRENDERINGOSPRAY_EXPORT")
vtk_module_library(vtkRenderingOSPRay ${Module_SRCS})
vtk_module_add_module(VTK::RenderingOSPRay
CLASSES ${classes}
SOURCES ${vtk_object_factory_source}
PRIVATE_HEADERS ${vtk_object_factory_header})
target_link_libraries(${vtk-module} LINK_PUBLIC ${OSPRAY_LIBRARIES})
target_include_directories(${vtk-module} PUBLIC ${OSPRAY_INCLUDE_DIRS})
# TODO: Send patches upstream to export targets from ospray.
find_package(ospray REQUIRED)
vtk_module_link(VTK::RenderingOSPRay
PUBLIC
${OSPRAY_LIBRARIES})
vtk_module_include(VTK::RenderingOSPRay
PUBLIC
${OSPRAY_INCLUDE_DIRS})
# TODO: FindOSPRay should do this.
# OSPRay_Core uses MMTime which is in it's own special library.
if(WIN32)
target_link_libraries(${vtk-module} LINK_PRIVATE Winmm)
endif()
include(vtkOpenGL)
vtk_opengl_link(${vtk-module})
if (WIN32)
vtk_module_link(VTK::RenderingOSPRay
PRIVATE
Winmm)
endif ()
vtk_module_test_data(
Data/bunny.ply
Data/dragon.ply
Data/ironProt.vtk
Data/many_blocks/many_blocks.vtm
Data/many_blocks/many_blocks/,REGEX:.*
Data/ospray_mats.json
Data/ospray_mats.mtl
Data/vase_1comp.vti
Data/wintersun.jpg)
add_subdirectory(Cxx)
find_package(OSPRay REQUIRED)
include_directories(${OSPRAY_INCLUDE_DIRS})
vtk_add_test_cxx(vtkRenderingOSPRayCxxTests tests
# Surface rendering tests
TestOSPRayAmbient.cxx
......@@ -53,30 +50,19 @@ vtk_test_cxx_executable(vtkRenderingOSPRayCxxTests tests RENDERING_FACTORY
vtkOSPRayTestInteractor.cxx
)
# Do we have MPI and parallel support
if (${Module_vtkRenderingParallel} AND ${Module_vtkParallelMPI})
vtk_module_dep_includes(vtkRenderingParallel)
vtk_module_dep_includes(vtkParallelMPI)
include_directories(
${vtkRenderingParallel_INCLUDE_DIRS}
${vtkRenderingParallel_DEPENDS_INCLUDE_DIRS}
${vtkParallelMPI_INCLUDE_DIRS}
${vtkParallelMPI_DEPENDS_INCLUDE_DIRS}
)
include(vtkMPI)
if (TARGET vtkRenderingParallel AND TARGET vtkParallelMPI)
set(vtkRenderingOSPRayCxx-MPI_NUMPROCS 2)
vtk_add_test_mpi(vtkRenderingOSPRayCxx-MPI tests
TESTING_DATA
TestOSPRayComposite.cxx
)
vtk_test_mpi_executable(vtkRenderingOSPRayCxx-MPI tests RENDERING_FACTORY
vtk_test_cxx_executable(vtkRenderingOSPRayCxx-MPI tests RENDERING_FACTORY
vtkOSPRayTestInteractor.cxx
)
target_link_libraries(vtkRenderingOSPRayCxx-MPI PRIVATE
${vtkRenderingParallel_LIBRARIES}
${vtkParallelMPI_LIBRARIES}
)
endif()
target_link_libraries(vtkRenderingOSPRayCxx-MPI
PRIVATE
vtkRenderingParallel
vtkParallelMPI)
endif ()
set(optional_test_depends)
if("${Module_vtkRenderingParallel}" AND "${Module_vtkParallelMPI}")
set(optional_test_depends "vtkRenderingParallel;vtkParallelMPI")
endif()
vtk_module(vtkRenderingOSPRay
IMPLEMENTS
vtkRenderingVolume
TEST_DEPENDS
vtkFiltersTexture
vtkInteractionStyle
vtkIOGeometry
vtkIOPLY
vtkRenderingAnnotation
vtkTestingCore
vtkTestingRendering
${optional_test_depends}
# Dependencies for volume rendering tests
vtkRenderingVolume
vtkRenderingVolumeOpenGL2
vtkFiltersAMR
vtkFiltersCore
vtkFiltersHybrid
vtkFiltersModeling
vtkImagingSources
vtkImagingGeneral
vtkImagingHybrid
vtkInteractionStyle
vtkIOLegacy
vtkRenderingFreeType
EXCLUDE_FROM_ALL
DEPENDS
vtkCommonDataModel
vtkRenderingOpenGL2
vtkRenderingCore
vtkRenderingSceneGraph
PRIVATE_DEPENDS
vtkRenderingVolumeAMR
vtkCommonCore
vtkIOImage
vtkIOLegacy
vtkIOXML
vtkjsoncpp
vtksys
)
NAME
VTK::RenderingOSPRay
LIBRARY_NAME
vtkRenderingOSPRay
IMPLEMENTS
VTK::RenderingVolume
DEPENDS
VTK::CommonDataModel
VTK::RenderingCore
VTK::RenderingOpenGL2
VTK::RenderingSceneGraph
VTK::RenderingVolume
PRIVATE_DEPENDS
VTK::CommonCore
VTK::IOImage
VTK::IOLegacy
VTK::IOXML
VTK::RenderingVolumeAMR
VTK::jsoncpp
VTK::vtksys
TEST_DEPENDS
VTK::CommonColor
VTK::CommonSystem
VTK::FiltersAMR
VTK::FiltersCore
VTK::FiltersExtraction
VTK::FiltersHybrid
VTK::FiltersModeling
VTK::FiltersSources
VTK::FiltersTexture
VTK::IOGeometry
VTK::IOImage
VTK::IOLegacy
VTK::IOPLY
VTK::IOXML
VTK::ImagingGeneral
VTK::ImagingHybrid
VTK::ImagingSources
VTK::InteractionStyle
VTK::InteractionStyle
#VTK::ParallelMPI
VTK::RenderingAnnotation
VTK::RenderingFreeType
#VTK::RenderingParallel
VTK::RenderingVolume
VTK::RenderingVolumeAMR
VTK::RenderingVolumeOpenGL2
VTK::TestingCore
VTK::TestingRendering
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