Change this:<div><span class="Apple-style-span" style="border-collapse: collapse; ">#FIND_PACKAGE(VTK REQUIRED)<br>#INCLUDE(${VTK_USE_FILE})<br></span><br></div><div>to this:</div><div><span class="Apple-style-span" style="border-collapse: collapse; ">FIND_PACKAGE(VTK REQUIRED)<br>
INCLUDE(${VTK_USE_FILE})<br></span><div class="gmail_quote"><br></div><div class="gmail_quote"><br></div><div class="gmail_quote">(Remove the comment character # -- those lines are commented out...)</div><div class="gmail_quote">
<br></div><div class="gmail_quote"><br></div><div class="gmail_quote">HTH,</div><div class="gmail_quote">David</div><div class="gmail_quote"><br></div><div class="gmail_quote"><br></div><div class="gmail_quote">On Wed, Feb 18, 2009 at 8:26 AM, Yixun Liu <span dir="ltr"><<a href="mailto:enjoywm@cs.wm.edu">enjoywm@cs.wm.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hi,<br>
I developed an application, which has many CMakeList, based on VTK. One of CMakelist files is like the<br>
following,<br>
<br>
#FIND_PACKAGE(VTK REQUIRED)<br>
#INCLUDE(${VTK_USE_FILE})<br>
<br>
...<br>
<br>
TARGET_LINK_LIBRARIES(TetrahedrisationNG<br>
Basics<br>
Graphics2DNG<br>
Graphics3DNG<br>
vtkIO<br>
vtkCommon<br>
)<br>
<br>
The error is<br>
/usr/lib64/gcc/x86_64-suse-linux/4.2.1/../../../../x86_64-suse-linux/bin/ld:<br>
cannot find -lvtkIO<br>
<br>
However, I can successfully make vtk example using the following CMakeList.<br>
<br>
PROJECT (BlockMatchingGPU)<br>
<br>
FIND_PACKAGE(VTK REQUIRED)<br>
IF(NOT VTK_USE_RENDERING)<br>
MESSAGE(FATAL_ERROR "Example ${PROJECT_NAME} requires VTK_USE_RENDERING.")<br>
ENDIF(NOT VTK_USE_RENDERING)<br>
INCLUDE(${VTK_USE_FILE})<br>
<br>
<br>
FIND_PACKAGE (ITK)<br>
IF (ITK_FOUND)<br>
INCLUDE(${USE_ITK_FILE} )<br>
ENDIF(ITK_FOUND)<br>
<br>
<br>
ADD_EXECUTABLE(BlockMatchingGPU BlockMatchingGPU.cxx)<br>
<br>
<br>
TARGET_LINK_LIBRARIES(BlockMatchingGPU ITKBasicFilters ITKCommon ITKIO vtkRendering vtkGraphics vtkHybrid vtkImaging vtkIO vtkFiltering vtkCommon)<br>
<br>
The application has many CMakeList. I don't know whether I add FIND_PACKAGE<br>
into the correct CMakeList.<br>
<br>
Thanks.<br>
<br>
Yixun<br>
<br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br>
</blockquote></div><br></div>