[CMake] cannot link vtkIO
David Cole
david.cole at kitware.com
Wed Feb 18 11:01:48 EST 2009
Change this:#FIND_PACKAGE(VTK REQUIRED)
#INCLUDE(${VTK_USE_FILE})
to this:
FIND_PACKAGE(VTK REQUIRED)
INCLUDE(${VTK_USE_FILE})
(Remove the comment character # -- those lines are commented out...)
HTH,
David
On Wed, Feb 18, 2009 at 8:26 AM, Yixun Liu <enjoywm at cs.wm.edu> wrote:
> Hi,
> I developed an application, which has many CMakeList, based on VTK. One of
> CMakelist files is like the
> following,
>
> #FIND_PACKAGE(VTK REQUIRED)
> #INCLUDE(${VTK_USE_FILE})
>
> ...
>
> TARGET_LINK_LIBRARIES(TetrahedrisationNG
> Basics
> Graphics2DNG
> Graphics3DNG
> vtkIO
> vtkCommon
> )
>
> The error is
>
> /usr/lib64/gcc/x86_64-suse-linux/4.2.1/../../../../x86_64-suse-linux/bin/ld:
> cannot find -lvtkIO
>
> However, I can successfully make vtk example using the following CMakeList.
>
> PROJECT (BlockMatchingGPU)
>
> FIND_PACKAGE(VTK REQUIRED)
> IF(NOT VTK_USE_RENDERING)
> MESSAGE(FATAL_ERROR "Example ${PROJECT_NAME} requires VTK_USE_RENDERING.")
> ENDIF(NOT VTK_USE_RENDERING)
> INCLUDE(${VTK_USE_FILE})
>
>
> FIND_PACKAGE (ITK)
> IF (ITK_FOUND)
> INCLUDE(${USE_ITK_FILE} )
> ENDIF(ITK_FOUND)
>
>
> ADD_EXECUTABLE(BlockMatchingGPU BlockMatchingGPU.cxx)
>
>
> TARGET_LINK_LIBRARIES(BlockMatchingGPU ITKBasicFilters ITKCommon ITKIO
> vtkRendering vtkGraphics vtkHybrid vtkImaging vtkIO vtkFiltering vtkCommon)
>
> The application has many CMakeList. I don't know whether I add FIND_PACKAGE
> into the correct CMakeList.
>
> Thanks.
>
> Yixun
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20090218/884c18e8/attachment.htm>
More information about the CMake
mailing list