Commit 2819d5ed authored by Ben Boeckel's avatar Ben Boeckel

Examples/Medical: update to the new module system

parent bbefde33
......@@ -37,6 +37,7 @@ else ()
add_example(IO/Cxx)
add_example(ImageProcessing/Cxx)
add_example(Infovis/Cxx)
add_example(Medical/Cxx)
endif ()
if (FALSE)
......@@ -50,7 +51,6 @@ else()
else()
if (vtkTestingCore_LOADED)
if (NOT VTK_RENDERING_BACKEND STREQUAL "None")
add_subdirectory(Medical/Cxx)
add_subdirectory(Modelling/Cxx)
add_subdirectory(MultiBlock/Cxx)
add_subdirectory(VisualizationAlgorithms/Cxx)
......
cmake_minimum_required(VERSION 3.3...3.12 FATAL_ERROR)
project(Medical)
PROJECT (Medical)
find_package(VTK COMPONENTS
vtkFiltersGeometry
vtkFiltersModeling
vtkIOImage
vtkIOXML
vtkImagingStatistics
vtkInteractionStyle
vtkRenderingVolumeOpenGL2
vtkTestingRendering
vtksys
)
include(${VTK_USE_FILE})
find_package(VTK
COMPONENTS
FiltersGeometry
FiltersModeling
IOImage
IOXML
ImagingStatistics
ImagingCore
RenderingCore
RenderingVolume
OPTIONAL_COMPONENTS
TestingRendering)
if (NOT VTK_FOUND)
message("Skipping example: ${VTK_NOT_FOUND_MESSAGE}")
return ()
endif ()
add_executable(Medical1 MACOSX_BUNDLE Medical1.cxx)
add_executable(Medical2 MACOSX_BUNDLE Medical2.cxx)
add_executable(Medical3 MACOSX_BUNDLE Medical3.cxx)
add_executable(Medical4 MACOSX_BUNDLE Medical4.cxx)
target_link_libraries(Medical1 ${VTK_LIBRARIES})
target_link_libraries(Medical2 ${VTK_LIBRARIES})
target_link_libraries(Medical3 ${VTK_LIBRARIES})
target_link_libraries(Medical4 ${VTK_LIBRARIES})
target_link_libraries(Medical1 PRIVATE ${VTK_LIBRARIES})
target_link_libraries(Medical2 PRIVATE ${VTK_LIBRARIES})
target_link_libraries(Medical3 PRIVATE ${VTK_LIBRARIES})
target_link_libraries(Medical4 PRIVATE ${VTK_LIBRARIES})
add_executable(GenerateModelsFromLabels MACOSX_BUNDLE GenerateModelsFromLabels.cxx)
add_executable(GenerateCubesFromLabels MACOSX_BUNDLE GenerateCubesFromLabels.cxx)
target_link_libraries(GenerateModelsFromLabels ${VTK_LIBRARIES})
target_link_libraries(GenerateCubesFromLabels ${VTK_LIBRARIES})
target_link_libraries(GenerateModelsFromLabels PRIVATE ${VTK_LIBRARIES})
target_link_libraries(GenerateCubesFromLabels PRIVATE ${VTK_LIBRARIES})
vtk_module_autoinit(
TARGETS Medical1
Medical2
Medical3
Medical4
GenerateModelsFromLabels
GenerateCubesFromLabels
MODULES ${vtk_modules})
include(CTest)
if(BUILD_TESTING)
if(vtkTestingRendering_LOADED)
######## Regression Testing ########
set(vtk-example MedicalExamples)
set(TestMedical1_ARGS ${_vtk_build_TEST_DATA_DIRECTORY}/Data/headsq/quarter)
set(TestMedical2_ARGS ${_vtk_build_TEST_DATA_DIRECTORY}/Data/headsq/quarter)
set(TestMedical3_ARGS ${_vtk_build_TEST_DATA_DIRECTORY}/Data/headsq/quarter)
set(TestMedical4_ARGS ${_vtk_build_TEST_DATA_DIRECTORY}/Data/headsq/quarter)
vtk_add_test_cxx(${vtk-example}CxxTests tests
TestMedical1.cxx
TestMedical2.cxx
TestMedical3.cxx
TestMedical4.cxx
)
vtk_test_cxx_executable(${vtk-example}CxxTests tests
RENDERING_FACTORY
)
endif()
endif()
if (TARGET VTK::TestingRendering)
add_subdirectory(Testing)
endif ()
set(_vtk_build_test Medical)
set(_vtk_build_TEST_DATA_DIRECTORY
"${CMAKE_CURRENT_SOURCE_DIR}")
set(_vtk_build_TEST_OUTPUT_DIRECTORY
"${CMAKE_BINARY_DIR}/Testing/Temporary")
set_property(GLOBAL
PROPERTY
"_vtk_module_${_vtk_build_test}_test_depends"
${VTK_LIBRARIES})
add_subdirectory(Cxx)
######## Regression Testing ########
set(TestMedical1_ARGS ${_vtk_build_TEST_DATA_DIRECTORY}/Data/headsq/quarter)
set(TestMedical2_ARGS ${_vtk_build_TEST_DATA_DIRECTORY}/Data/headsq/quarter)
set(TestMedical3_ARGS ${_vtk_build_TEST_DATA_DIRECTORY}/Data/headsq/quarter)
set(TestMedical4_ARGS ${_vtk_build_TEST_DATA_DIRECTORY}/Data/headsq/quarter)
vtk_add_test_cxx(MedicalCxxTests tests
TestMedical1.cxx
TestMedical2.cxx
TestMedical3.cxx
TestMedical4.cxx
)
vtk_test_cxx_executable(MedicalCxxTests tests
RENDERING_FACTORY
)
target_include_directories(MedicalCxxTests
PRIVATE
"${CMAKE_SOURCE_DIR}")
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