Skip to content

Commit d0974a8

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

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

SoftwareGuide/Latex/Introduction/Installation.tex

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -644,17 +644,18 @@ \subsection{Hello World!}%
644644
The \code{CMakeLists.txt} file contains the following lines:
645645
646646
% CMake looks similar to bash with regards to formatting.
647-
\begin{minted}[linenos=false]{cmake}
647+
\small
648+
\begin{minted}[baselinestretch=1,fontsize=\footnotesize,linenos=false,bgcolor=ltgray]{cmake}
648649
project(HelloWorld)
649650
650-
set(MINIMUM_ITK_VERSION 5.4)
651+
set(MINIMUM_ITK_VERSION 6.0)
651652
find_package(ITK \${MINIMUM_ITK_VERSION} REQUIRED)
652-
include(${ITK_USE_FILE})
653+
itk_generate_factory_registration()
653654
654655
add_executable(HelloWorld HelloWorld.cxx)
655-
656-
target_link_libraries(HelloWorld ${ITK_LIBRARIES})
656+
target_link_libraries(HelloWorld ${ITK_INTERFACE_LIBRARIES})
657657
\end{minted}
658+
\normalsize
658659
659660
The first line defines the name of your project as it appears in Visual Studio
660661
or Eclipse; this line will have no effect with UNIX/Linux Makefiles. The second
@@ -663,9 +664,9 @@ \subsection{Hello World!}%
663664
corrected by providing the location of the directory where ITK was compiled or
664665
installed on your system. In this case the path to the ITK's binary/installation
665666
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
667+
variable. The line \code{itk\_generate\_factory\_registration()} generates configuration
668+
to enable input-output factory class registration in the subsequent executable.
669+
The line starting with \code{add\_executable} call defines
669670
as its first argument the name of the executable that will be produced
670671
as result of this project. The remaining argument(s) of \code{add\_executable}
671672
are the names of the source files to be compiled. Finally, the

0 commit comments

Comments
 (0)