Skip to content

Commit 14665e6

Browse files
committed
ENH: Add deprecation warning to UseITK usage.
1 parent 93df383 commit 14665e6

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

CMake/UseITK.cmake

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,16 @@
1414
# included directly, but rather through the ITK_USE_FILE setting
1515
# obtained from ITKConfig.cmake.
1616

17+
set(
18+
_use_itk_msg
19+
"CMake/UseITK.cmake is deprecated. "
20+
"Please update CMakeLists.txt to use `find_package(ITK)` and link to `${ITK_INTERFACE_LIBRARIES}`."
21+
)
22+
message(AUTHOR_WARNING "${_use_itk_msg}")
23+
if(${ITK_FUTURE_LEGACY_REMOVE})
24+
message(FATAL_ERROR "${_use_itk_msg}")
25+
endif()
26+
1727
# Add compiler flags needed to use ITK.
1828
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${ITK_REQUIRED_C_FLAGS}")
1929
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${ITK_REQUIRED_CXX_FLAGS}")

0 commit comments

Comments
 (0)