You&#39;ve got to do an<div><br></div><div>INCLUDE(${VTK_USE_FILE})</div><div><br></div><div>before VTK_LIBRARIES gets defined.</div><div><br></div><div>Shash<br><br><div class="gmail_quote">On Fri, Jul 1, 2011 at 2:13 PM, Sensei <span dir="ltr">&lt;<a href="mailto:senseiwa@gmail.com">senseiwa@gmail.com</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="im"><br>
On Jun 29, 2011, at 6:26pm, David Doria wrote:<br>
<br>
&gt; With recent versions of VTK, the preferred method is to link to ${VTK_LIBRARIES}<br>
<br>
<br>
</div>David, something is wrong with this on my system (OSX 10.6 with gcc, cmake 2.8.1, vtk 5.6). I am compiling a simple example from the wiki (*), however, it seems that the variable ${VTK_LIBRARIES} is empty (kits, however, are ok). This is my configuration:<br>

<br>
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)<br>
<br>
PROJECT(PP)<br>
<br>
FIND_PACKAGE(VTK REQUIRED)<br>
INCLUDE(${VTK_USE_FILE})<br>
<br>
MESSAGE(&quot;VTK:              ${VTK_FOUND}&quot;)<br>
MESSAGE(&quot;VTK_INCLUDE_DIRS: ${VTK_INCLUDE_DIRS}&quot;)<br>
MESSAGE(&quot;VTK_LIBRARY_DIRS: ${VTK_LIBRARY_DIRS}&quot;)<br>
MESSAGE(&quot;VTK_KITS:         ${VTK_KITS}&quot;)<br>
MESSAGE(&quot;VTK_DIR:          ${VTK_DIR}&quot;)<br>
MESSAGE(&quot;VTK_LIBRARIES:    ${VTK_LIBRARIES}&quot;)<br>
<br>
ADD_EXECUTABLE(PP a.cpp)<br>
<br>
IF(VTK_FOUND)<br>
  TARGET_LINK_LIBRARIES(PP ${VTK_LIBRARIES})<br>
  MESSAGE(&quot;==&gt; WITH LIBS&quot;)<br>
ELSE()<br>
  TARGET_LINK_LIBRARIES(PP vtkHybrid)<br>
  MESSAGE(&quot;==&gt; *NO* LIBS&quot;)<br>
ENDIF()<br>
<br>
<br>
As you can see, the variable isn&#39;t filled with any item:<br>
<br>
<br>
% cmake ..<br>
-- The C compiler identification is GNU<br>
-- The CXX compiler identification is GNU<br>
-- Checking whether C compiler has -isysroot<br>
-- Checking whether C compiler has -isysroot - yes<br>
-- Checking whether C compiler supports OSX deployment target flag<br>
-- Checking whether C compiler supports OSX deployment target flag - yes<br>
-- Check for working C compiler: /usr/bin/gcc<br>
-- Check for working C compiler: /usr/bin/gcc -- works<br>
-- Detecting C compiler ABI info<br>
-- Detecting C compiler ABI info - done<br>
-- Checking whether CXX compiler has -isysroot<br>
-- Checking whether CXX compiler has -isysroot - yes<br>
-- Checking whether CXX compiler supports OSX deployment target flag<br>
-- Checking whether CXX compiler supports OSX deployment target flag - yes<br>
-- Check for working CXX compiler: /usr/bin/c++<br>
-- Check for working CXX compiler: /usr/bin/c++ -- works<br>
-- Detecting CXX compiler ABI info<br>
-- Detecting CXX compiler ABI info - done<br>
VTK:              1<br>
VTK_INCLUDE_DIRS: /Users/sensei/Applications/vtk/include/vtk-5.6<br>
VTK_LIBRARY_DIRS: /Users/sensei/Applications/vtk/lib/vtk-5.6<br>
VTK_KITS:         COMMON;FILTERING;IO;GRAPHICS;GENERIC_FILTERING;IMAGING;RENDERING;VOLUMERENDERING;HYBRID;WIDGETS;INFOVIS;GEOVIS;VIEWS;QVTK;CHARTS<br>
VTK_DIR:          /Users/sensei/Applications/vtk/lib/vtk-5.6<br>
VTK_LIBRARIES:<br>
==&gt; WITH LIBS<br>
-- Configuring done<br>
-- Generating done<br>
-- Build files have been written to: /Users/sensei/Public/x<br>
<br>
<br>
<br>
Am I missing something?<br>
<br>
By the way, why isn&#39;t cmake warning about checking for vtk? It finds it, but no output like &quot;Check for working VTK&quot; is flushed to the console.<br>
<br>
Thanks!<br>
<br>
<br>
(*) <a href="http://www.vtk.org/Wiki/VTK/Examples/Cxx/SimpleOperations/DistancePointToLine" target="_blank">http://www.vtk.org/Wiki/VTK/Examples/Cxx/SimpleOperations/DistancePointToLine</a><br>
<div><div></div><div class="h5">_______________________________________________<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 VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
</div></div></blockquote></div><br></div>