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 ()
add_example(ImageProcessing/Cxx)
add_example(Infovis/Cxx)
add_example(Medical/Cxx)
add_example(Modelling/Cxx)
endif ()
if (FALSE)
......@@ -51,7 +52,6 @@ else()
else()
if (vtkTestingCore_LOADED)
if (NOT VTK_RENDERING_BACKEND STREQUAL "None")
add_subdirectory(Modelling/Cxx)
add_subdirectory(MultiBlock/Cxx)
add_subdirectory(VisualizationAlgorithms/Cxx)
add_subdirectory(Widgets/Cxx)
......
cmake_minimum_required(VERSION 3.3...3.12 FATAL_ERROR)
project(Modelling)
PROJECT (Modelling)
find_package(VTK REQUIRED)
vtk_module_config(VTK
vtkCommonCore
vtkCommonDataModel
vtkFiltersGeneral
vtkIOXML
vtkImagingHybrid
vtkInteractionStyle
vtkRenderingOpenGL2
vtkTestingRendering
)
include(${VTK_USE_FILE})
find_package(VTK
COMPONENTS
CommonCore
FiltersGeneral
IOXML
ImagingHybrid
RenderingCore
OPTIONAL_COMPONENTS
TestingRendering)
if (NOT VTK_FOUND)
message("Skipping example: ${VTK_NOT_FOUND_MESSAGE}")
return ()
endif ()
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)
target_link_libraries(Delaunay3D ${VTK_LIBRARIES})
target_link_libraries(Delaunay3D PRIVATE ${vtk_modules})
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(vtkTestingRendering_LOADED)
######## Regression Testing ########
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()
if (TARGET VTK::TestingRendering)
add_subdirectory(Testing)
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