CMakeLists.txt 1.58 KB
Newer Older
1
cmake_minimum_required(VERSION 3.3...3.12 FATAL_ERROR)
2
project(ImageProcessing)
3

4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
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 ()
23

24 25 26 27 28
add_executable(ImageSlicing MACOSX_BUNDLE
  ImageSlicing.cxx)
target_link_libraries(ImageSlicing
  PRIVATE
    ${VTK_LIBRARIES})
29

30 31 32 33 34
add_executable(ImageBenchmark
  ImageBenchmark.cxx)
target_link_libraries(ImageBenchmark
  PRIVATE
    ${VTK_LIBRARIES})
35

36 37 38 39 40
add_executable(ImageBenchmarkDriver
  ImageBenchmarkDriver.cxx)
target_link_libraries(ImageBenchmarkDriver
  PRIVATE
    ${VTK_LIBRARIES})
41

42 43 44 45 46
vtk_module_autoinit(
  TARGETS ImageSlicing
          ImageBenchmark
          ImageBenchmarkDriver
  MODULES ${VTK_LIBRARIES})
47

48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
if (BUILD_TESTING)
  if (TARGET VTK::TestingRendering)
    ######## Regression Testing ########
    set(_vtk_test_module ImageProcessingExamples)
    vtk_module_test_data(
      Data/headsq/quarter/,REGEX:.*)
    set(TestImageSlicing_ARGS ${_vtk_build_TEST_DATA_DIRECTORY}/Data/headsq/quarter)
    set(TestImageBenchmark_ARGS
      "--threads" "2" "--filter" "resize:kernelsize=4")
    vtk_add_test_cxx(ImageProcessingExamplesCxxTests tests
      TestImageBenchmark.cxx,NO_VALID,NO_DATA,NO_OUTPUT
      TestImageSlicing.cxx
      )
    vtk_test_cxx_executable(ImageProcessingExamplesCxxTests tests
      RENDERING_FACTORY
      )
  endif ()
endif ()