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