<div dir="ltr"><div><div><div><div><div><div>If your project uses CMake then the imported targets from VTK will automatically pull in their appropriate dependencies in the right order. For example:<br><br></div>CMakeLists.txt:<br></div><span style="font-family:monospace,monospace">project(foo)<br><br></span></div><span style="font-family:monospace,monospace">find_package(VTK REQUIRED)<br></span></div><div><span style="font-family:monospace,monospace">include(${VTK_USE_FILE})<br><br></span></div><div><span style="font-family:monospace,monospace"># Add an executable that users vtkFiltersCore<br></span></div><span style="font-family:monospace,monospace">add_executable(foo foo.cxx)<br></span></div><span style="font-family:monospace,monospace">target_link_libraries(foo vtkFiltersCore)<br></span><br></div>Since your using CMake then vtkFiltersCore is not just a link library, but a full blown imported target, which means that it carries it's dependencies with it as they need to be linked.<br><div><br></div></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature"><div dir="ltr">- Chuck<br></div></div></div>
<br><div class="gmail_quote">On Thu, Apr 21, 2016 at 7:54 AM, just_rookie <span dir="ltr"><<a href="mailto:925345468@qq.com" target="_blank">925345468@qq.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi all,<br>
<br>
I would like to link static VTK libraries (linux .a files) in CMake, I got<br>
two questions:<br>
<br>
(1) How to find out which static libraries should be linked? Based on header<br>
files or other ways?<br>
<br>
(2) When linking static libraries, linking order is important, so is there a<br>
default linking order of VTK libraries? Which libraries should come first or<br>
come later?<br>
<br>
Thank you in advance!<br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://vtk.1045678.n5.nabble.com/default-linking-order-of-static-VTK-libraries-in-CMake-tp5737819.html" rel="noreferrer" target="_blank">http://vtk.1045678.n5.nabble.com/default-linking-order-of-static-VTK-libraries-in-CMake-tp5737819.html</a><br>
Sent from the VTK - Users mailing list archive at Nabble.com.<br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" 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" rel="noreferrer" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=vtkusers" rel="noreferrer" target="_blank">http://markmail.org/search/?q=vtkusers</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/vtkusers" rel="noreferrer" target="_blank">http://public.kitware.com/mailman/listinfo/vtkusers</a><br>
</blockquote></div><br></div>