Commit 70ec3748 authored by Ben Boeckel's avatar Ben Boeckel

Examples/ImageProcessing: update to the new module system

parent d2ce944d
...@@ -35,6 +35,7 @@ else () ...@@ -35,6 +35,7 @@ else ()
add_example(GUI/Qt/ImageViewer) add_example(GUI/Qt/ImageViewer)
add_example(GUI/Qt/SimpleView) add_example(GUI/Qt/SimpleView)
add_example(IO/Cxx) add_example(IO/Cxx)
add_example(ImageProcessing/Cxx)
endif () endif ()
if (FALSE) if (FALSE)
...@@ -48,7 +49,6 @@ else() ...@@ -48,7 +49,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(ImageProcessing/Cxx)
add_subdirectory(Medical/Cxx) add_subdirectory(Medical/Cxx)
add_subdirectory(Modelling/Cxx) add_subdirectory(Modelling/Cxx)
add_subdirectory(MultiBlock/Cxx) add_subdirectory(MultiBlock/Cxx)
......
cmake_minimum_required(VERSION 3.3...3.12 FATAL_ERROR) cmake_minimum_required(VERSION 3.3...3.12 FATAL_ERROR)
project(ImageProcessing)
find_package(VTK
OPTIONAL_COMPONENTS
TestingCore
TestingRendering)
find_package(VTK
COMPONENTS
CommonSystem
IOImage
ImagingFourier
ImagingGeneral
ImagingSources
ImagingStatistics
ImagingStencil
InteractionStyle
RenderingCore)
if (NOT VTK_FOUND)
message("Skipping example: ${VTK_NOT_FOUND_MESSAGE}")
return ()
endif ()
PROJECT(ImageProcessing) add_executable(ImageSlicing MACOSX_BUNDLE
find_package(VTK REQUIRED) ImageSlicing.cxx)
vtk_module_config(VTK target_link_libraries(ImageSlicing
vtkCommonCore PRIVATE
vtkFiltersCore ${VTK_LIBRARIES})
vtkFiltersModeling
vtkFiltersSources
vtkIOImage
vtkImagingCore
vtkImagingGeneral
vtkImagingStatistics
vtkImagingStencil
vtkInteractionStyle
vtkRenderingOpenGL2
vtkRenderingCore
vtkTestingCore
vtkTestingRendering
)
include(${VTK_USE_FILE})
add_executable(ImageSlicing MACOSX_BUNDLE ImageSlicing.cxx) add_executable(ImageBenchmark
target_link_libraries(ImageSlicing ${VTK_LIBRARIES}) ImageBenchmark.cxx)
target_link_libraries(ImageBenchmark
PRIVATE
${VTK_LIBRARIES})
add_executable(ImageBenchmark ImageBenchmark.cxx) add_executable(ImageBenchmarkDriver
target_link_libraries(ImageBenchmark ${VTK_LIBRARIES}) ImageBenchmarkDriver.cxx)
target_link_libraries(ImageBenchmarkDriver
PRIVATE
${VTK_LIBRARIES})
add_executable(ImageBenchmarkDriver ImageBenchmarkDriver.cxx) vtk_module_autoinit(
target_link_libraries(ImageBenchmarkDriver ${VTK_LIBRARIES}) TARGETS ImageSlicing
ImageBenchmark
ImageBenchmarkDriver
MODULES ${VTK_LIBRARIES})
if(BUILD_TESTING) if (BUILD_TESTING)
if(vtkTestingRendering_LOADED) if (TARGET VTK::TestingRendering)
######## Regression Testing ######## ######## Regression Testing ########
set(vtk-example ImageProcessingExamples) set(_vtk_test_module ImageProcessingExamples)
set(TestImageSlicing_ARGS ${_vtk_build_TEST_DATA_DIRECTORY}/Data/headsq/quarter) vtk_module_test_data(
set(TestImageBenchmark_ARGS Data/headsq/quarter/,REGEX:.*)
"--threads" "2" "--filter" "resize:kernelsize=4") set(TestImageSlicing_ARGS ${_vtk_build_TEST_DATA_DIRECTORY}/Data/headsq/quarter)
vtk_add_test_cxx(${vtk-example}CxxTests tests set(TestImageBenchmark_ARGS
TestImageBenchmark.cxx,NO_VALID,NO_DATA,NO_OUTPUT "--threads" "2" "--filter" "resize:kernelsize=4")
TestImageSlicing.cxx vtk_add_test_cxx(ImageProcessingExamplesCxxTests tests
) TestImageBenchmark.cxx,NO_VALID,NO_DATA,NO_OUTPUT
vtk_test_cxx_executable(${vtk-example}CxxTests tests TestImageSlicing.cxx
RENDERING_FACTORY )
) vtk_test_cxx_executable(ImageProcessingExamplesCxxTests tests
endif() RENDERING_FACTORY
endif() )
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