Skip to content

Commit 3b5aefc

Browse files
committed
DOC: Update HelloWorld guide to use ITK 6 CMake targets
For simplicity we just use ITK_INTERFACE_LIBRARIES.
1 parent cb52ee2 commit 3b5aefc

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

SoftwareGuide/Latex/Introduction/Installation.tex

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -647,13 +647,15 @@ \subsection{Hello World!}%
647647
\begin{minted}[linenos=false]{cmake}
648648
project(HelloWorld)
649649
650-
set(MINIMUM_ITK_VERSION 5.4)
650+
set(MINIMUM_ITK_VERSION 6.0)
651651
find_package(ITK \${MINIMUM_ITK_VERSION} REQUIRED)
652-
include(${ITK_USE_FILE})
652+
653+
# Generate the ITK factory registration code.
654+
itk_generate_factory_registration()
653655
654656
add_executable(HelloWorld HelloWorld.cxx)
655657
656-
target_link_libraries(HelloWorld ${ITK_LIBRARIES})
658+
target_link_libraries(HelloWorld ${ITK_INTERFACE_LIBRARIES})
657659
\end{minted}
658660
659661
The first line defines the name of your project as it appears in Visual Studio
@@ -663,9 +665,9 @@ \subsection{Hello World!}%
663665
corrected by providing the location of the directory where ITK was compiled or
664666
installed on your system. In this case the path to the ITK's binary/installation
665667
directory needs to be specified as the value of the \code{ITK\_DIR} CMake
666-
variable. The line \code{include(\$\{USE\_ITK\_FILE\})} loads the
667-
\code{UseITK.cmake} file which contains the configuration information about the
668-
specified ITK build. The line starting with \code{add\_executable} call defines
668+
variable. The line \code{itk\_generate\_factory\_registration()} generates configuration
669+
to enable input-output factory class registration in the subsequent executable.
670+
The line starting with \code{add\_executable} call defines
669671
as its first argument the name of the executable that will be produced
670672
as result of this project. The remaining argument(s) of \code{add\_executable}
671673
are the names of the source files to be compiled. Finally, the

0 commit comments

Comments
 (0)