[CMake] cannot link vtkIO

David Cole david.cole at kitware.com
Wed Feb 18 12:06:06 EST 2009


What error do you get if you run cmake without the # on those two lines?
(Copy and paste the output of running cmake please.)


On Wed, Feb 18, 2009 at 11:54 AM, Yixun Liu <enjoywm at cs.wm.edu> wrote:

> David Cole wrote:
> > 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
> > <mailto: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 <http://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
> >
> >
>
> Sorry. It's a mistake. It doesn't work without "#".
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20090218/318c8b70/attachment.htm>


More information about the CMake mailing list