Commit cfb98b67 authored by Ben Boeckel's avatar Ben Boeckel

Examples/Modelling: update to the new module system

parent 2819d5ed
...@@ -38,6 +38,7 @@ else () ...@@ -38,6 +38,7 @@ else ()
add_example(ImageProcessing/Cxx) add_example(ImageProcessing/Cxx)
add_example(Infovis/Cxx) add_example(Infovis/Cxx)
add_example(Medical/Cxx) add_example(Medical/Cxx)
add_example(Modelling/Cxx)
endif () endif ()
if (FALSE) if (FALSE)
...@@ -51,7 +52,6 @@ else() ...@@ -51,7 +52,6 @@ else()
else() else()
if (vtkTestingCore_LOADED) if (vtkTestingCore_LOADED)
if (NOT VTK_RENDERING_BACKEND STREQUAL "None") if (NOT VTK_RENDERING_BACKEND STREQUAL "None")
add_subdirectory(Modelling/Cxx)
add_subdirectory(MultiBlock/Cxx) add_subdirectory(MultiBlock/Cxx)
add_subdirectory(VisualizationAlgorithms/Cxx) add_subdirectory(VisualizationAlgorithms/Cxx)
add_subdirectory(Widgets/Cxx) add_subdirectory(Widgets/Cxx)
......
cmake_minimum_required(VERSION 3.3...3.12 FATAL_ERROR) cmake_minimum_required(VERSION 3.3...3.12 FATAL_ERROR)
project(Modelling)
find_package(VTK
PROJECT (Modelling) COMPONENTS
find_package(VTK REQUIRED) CommonCore
vtk_module_config(VTK FiltersGeneral
vtkCommonCore IOXML
vtkCommonDataModel ImagingHybrid
vtkFiltersGeneral RenderingCore
vtkIOXML OPTIONAL_COMPONENTS
vtkImagingHybrid TestingRendering)
vtkInteractionStyle if (NOT VTK_FOUND)
vtkRenderingOpenGL2 message("Skipping example: ${VTK_NOT_FOUND_MESSAGE}")
vtkTestingRendering return ()
) endif ()
include(${VTK_USE_FILE})
add_executable(finance MACOSX_BUNDLE finance.cxx) add_executable(finance MACOSX_BUNDLE finance.cxx)
target_link_libraries(finance ${VTK_LIBRARIES}) target_link_libraries(finance PRIVATE ${vtk_modules})
add_executable(Delaunay3D MACOSX_BUNDLE Delaunay3D.cxx) add_executable(Delaunay3D MACOSX_BUNDLE Delaunay3D.cxx)
target_link_libraries(Delaunay3D ${VTK_LIBRARIES}) target_link_libraries(Delaunay3D PRIVATE ${vtk_modules})
add_executable(Delaunay3DAlpha MACOSX_BUNDLE Delaunay3DAlpha.cxx) add_executable(Delaunay3DAlpha MACOSX_BUNDLE Delaunay3DAlpha.cxx)
target_link_libraries(Delaunay3DAlpha ${VTK_LIBRARIES}) target_link_libraries(Delaunay3DAlpha PRIVATE ${vtk_modules})
vtk_module_autoinit(
TARGETS finance
Delaunay3D
Delaunay3DAlpha
MODULES ${vtk_modules})
if(BUILD_TESTING) if (TARGET VTK::TestingRendering)
if(vtkTestingRendering_LOADED) add_subdirectory(Testing)
######## Regression Testing ######## endif ()
set(vtk-example ModellingExamples)
set(TestFinance_ARGS "DATA{${VTK_TEST_INPUT_DIR}/financial.txt}")
set(TestDelaunay3D_ARGS
"DATA{${VTK_TEST_INPUT_DIR}/cow.vtp}"
${_vtk_build_TEST_OUTPUT_DIRECTORY}/Delaunay3D.vtu
)
set(TestDelaunay3DAlpha_ARGS
.5 "DATA{${VTK_TEST_INPUT_DIR}/cow.vtp}"
${_vtk_build_TEST_OUTPUT_DIRECTORY}/Delaunay3DAlpha.vtu
)
vtk_add_test_cxx(${vtk-example}CxxTests data_tests
TestFinance.cxx
)
vtk_add_test_cxx(${vtk-example}CxxTests tests
NO_DATA NO_VALID NO_OUTPUT
TestDelaunay3D.cxx
TestDelaunay3DAlpha.cxx
)
set(all_tests
${data_tests}
${tests}
)
vtk_test_cxx_executable(${vtk-example}CxxTests all_tests
RENDERING_FACTORY
)
endif()
endif()
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