Skip to content

Commit 2f1c288

Browse files
committed
ENH: Specify minimum ITK version in CMake find_package commands
1 parent 4486245 commit 2f1c288

4 files changed

Lines changed: 10 additions & 6 deletions

File tree

ITKSoftwareGuide.cmake

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ set(CMAKE_MODULE_PATH
1111
)
1212

1313
#-----------------------------------------------------------------------------
14-
find_package(ITK REQUIRED)
14+
set(MINIMUM_ITK_VERSION 5)
15+
find_package(ITK ${MINIMUM_ITK_VERSION} REQUIRED)
1516
if(Slicer_BUILD_${PROJECT_NAME})
1617
set(ITK_NO_IO_FACTORY_REGISTER_MANAGER 1) # Incorporate with Slicer nicely
1718
endif()

SoftwareGuide/Cover/Source/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ cmake_policy(VERSION 3.10.2)
33

44
project( VWSegmentation )
55

6-
find_package( ITK REQUIRED )
6+
find_package( ITK 5 REQUIRED )
77
include( ${ITK_USE_FILE} )
88

99
set( operations

SoftwareGuide/Latex/DevelopmentGuidelines/CreateAModule.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ \subsection{CMakeLists.txt}
7272
set(MyModule_LIBRARIES MyModule)
7373

7474
if(NOT ITK_SOURCE_DIR)
75-
find_package(ITK REQUIRED)
75+
find_package(ITK 5 REQUIRED)
7676
list(APPEND CMAKE_MODULE_PATH ${ITK_CMAKE_DIR})
7777
include(ITKModuleExternal)
7878
else()

SoftwareGuide/Latex/Introduction/Installation.tex

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -582,7 +582,8 @@ \section{Using ITK as an External Library}
582582

583583
\small
584584
\begin{minted}[baselinestretch=1,fontsize=\footnotesize,linenos=false,bgcolor=ltgray]{cmake}
585-
find_package(ITK REQUIRED COMPONENTS Module1 Module2)
585+
set(MINIMUM_ITK_VERSION 5.4)
586+
find_package(ITK \${MINIMUM_ITK_VERSION} REQUIRED COMPONENTS Module1 Module2)
586587
include(\${ITK_USE_FILE})
587588
\end{minted}
588589
\normalsize
@@ -591,7 +592,8 @@ \section{Using ITK as an External Library}
591592

592593
\small
593594
\begin{minted}[baselinestretch=1,fontsize=\footnotesize,linenos=false,bgcolor=ltgray]{cmake}
594-
find_package(ITK REQUIRED
595+
set(MINIMUM_ITK_VERSION 5.4)
596+
find_package(ITK \${MINIMUM_ITK_VERSION} REQUIRED
595597
COMPONENTS
596598
MorphologicalContourInterpolation
597599
ITKSmoothing
@@ -654,7 +656,8 @@ \subsection{Hello World!}
654656
\begin{minted}[linenos=false]{cmake}
655657
project(HelloWorld)
656658
657-
find_package(ITK REQUIRED)
659+
set(MINIMUM_ITK_VERSION 5.4)
660+
find_package(ITK \${MINIMUM_ITK_VERSION} REQUIRED)
658661
include(${ITK_USE_FILE})
659662
660663
add_executable(HelloWorld HelloWorld.cxx)

0 commit comments

Comments
 (0)