Skip to content

Commit a94b017

Browse files
committed
COMP: Update examples to the new build system to avoid warnings
Warning that was triggered: CMake Warning (dev) at CMake/UseITK.cmake:28 (message): CMake/UseITK.cmake is deprecated. Please update CMakeLists.txt to use `find_package(ITK)` and link to "${ITK_INTERFACE_LIBRARIES}". Call Stack (most recent call first): Modules/Remote/Montage/examples/CMakeLists.txt:23 (include) This warning is for project developers. Use -Wno-dev to suppress it.
1 parent 9aafc48 commit a94b017

1 file changed

Lines changed: 7 additions & 14 deletions

File tree

examples/CMakeLists.txt

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,32 +13,25 @@ set(ExampleSpecificComponents
1313
ITKTestKernel
1414
)
1515

16-
if(NOT ITK_SOURCE_DIR)
17-
find_package(ITK 5.2 REQUIRED COMPONENTS ITKImageIO ITKTransformIO ${ExampleSpecificComponents})
18-
else()
19-
# when being built as part of ITK, ITKImageIO and ITKTransformIO
20-
# lists of modules are not yet ready, causing a configure error
21-
find_package(ITK REQUIRED COMPONENTS ${ExampleSpecificComponents})
22-
endif()
23-
include(${ITK_USE_FILE})
16+
find_package(ITK 6.0 REQUIRED COMPONENTS ITKImageIO ITKTransformIO ${ExampleSpecificComponents})
2417

2518
add_executable(PhaseCorrelationImageRegistration PhaseCorrelationImageRegistration.cxx)
26-
target_link_libraries(PhaseCorrelationImageRegistration ${ITK_LIBRARIES})
19+
target_link_libraries(PhaseCorrelationImageRegistration ${ITK_INTERFACE_LIBRARIES})
2720

2821
add_executable(CompleteMontage CompleteMontage.cxx)
29-
target_link_libraries(CompleteMontage ${ITK_LIBRARIES})
22+
target_link_libraries(CompleteMontage ${ITK_INTERFACE_LIBRARIES})
3023

3124
add_executable(RefineMontage RefineMontage.cxx)
32-
target_link_libraries(RefineMontage ${ITK_LIBRARIES})
25+
target_link_libraries(RefineMontage ${ITK_INTERFACE_LIBRARIES})
3326

3427
add_executable(ResampleMontage ResampleMontage.cxx)
35-
target_link_libraries(ResampleMontage ${ITK_LIBRARIES})
28+
target_link_libraries(ResampleMontage ${ITK_INTERFACE_LIBRARIES})
3629

3730
add_executable(CompareTileConfigurations CompareTileConfigurations.cxx)
38-
target_link_libraries(CompareTileConfigurations ${ITK_LIBRARIES})
31+
target_link_libraries(CompareTileConfigurations ${ITK_INTERFACE_LIBRARIES})
3932

4033
add_executable(MontageImageCompareCommand MontageImageCompareCommand.cxx)
41-
target_link_libraries(MontageImageCompareCommand ${ITK_LIBRARIES})
34+
target_link_libraries(MontageImageCompareCommand ${ITK_INTERFACE_LIBRARIES})
4235

4336

4437
# add some regression tests

0 commit comments

Comments
 (0)