[Insight-users] Problem with compilation of myProject VTK-ITK

David Doria daviddoria at gmail.com
Thu Sep 27 11:34:17 EDT 2012


On Thu, Sep 27, 2012 at 11:29 AM, Krzysztof J. Rechowicz <
k.rechowicz at gmail.com> wrote:

> Hi all,
>
> I am working on setting up ITK (4.2.0) VTK (5.10) for use in a classroom
> following the example in the "Getting Started with ITK + VTK" PPT and it
> seems that the some of the libraries listed in Cmakelists.txt, e.g.
> ITKBasicFilters are no longer present in ver. 4.2 what leads to compiling
> errors. Is there some hint which libraries to add to be able to compile
> myProject?
>
>
> Thank you,
>
> Krzysztof Rechowicz
>
> Cmakelists.txt
> PROJECT( myProject )
>
> FIND_PACKAGE ( ITK )
>
> IF (  ITK_FOUND  )
>
>          INCLUDE(  ${USE_ITK_FILE}  )
>
> ENDIF(   ITK_FOUND   )
>
> FIND_PACKAGE ( VTK )
>
> IF (   VTK_FOUND   )
>
>          INCLUDE(  ${USE_VTK_FILE}  )
>
> ENDIF(   VTK_FOUND   )INCLUDE_DIRECTORIES(
> ${myProject_SOURCE_DIR}
> )
>
> ADD_EXECUTABLE( myProject   myProject.cxx )
>
> TARGET_LINK_LIBRARIES ( myProject  ITKBasicFilters ITKCommon ITKIO
> vtkRendering  vtkGraphics vtkHybrid vtkImaging vtkIO vtkFiltering vtkCommon)
>

With recent versions of ITK and VTK (4.2 and 5.10 should qualify), you can
simply do:

TARGET_LINK_LIBRARIES ( myProject  ${ITK_LIBRARIES} ${VTK_LIBRARIES})

David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20120927/fc60fbda/attachment.htm>


More information about the Insight-users mailing list