[vtkusers] default linking order of static VTK libraries in CMake

Chuck Atkins chuck.atkins at kitware.com
Thu Apr 21 09:01:22 EDT 2016


If your project uses CMake then the imported targets from VTK will
automatically pull in their appropriate dependencies in the right order.
For example:

CMakeLists.txt:
project(foo)

find_package(VTK REQUIRED)
include(${VTK_USE_FILE})

# Add an executable that users vtkFiltersCore
add_executable(foo foo.cxx)
target_link_libraries(foo vtkFiltersCore)

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.


- Chuck

On Thu, Apr 21, 2016 at 7:54 AM, just_rookie <925345468 at qq.com> wrote:

> Hi all,
>
> I would like to link static VTK libraries (linux .a files) in CMake, I got
> two questions:
>
> (1) How to find out which static libraries should be linked? Based on
> header
> files or other ways?
>
> (2) When linking static libraries, linking order is important, so is there
> a
> default linking order of VTK libraries? Which libraries should come first
> or
> come later?
>
> Thank you in advance!
>
>
>
> --
> View this message in context:
> http://vtk.1045678.n5.nabble.com/default-linking-order-of-static-VTK-libraries-in-CMake-tp5737819.html
> Sent from the VTK - Users mailing list archive at Nabble.com.
> _______________________________________________
> Powered by 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 VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Search the list archives at: http://markmail.org/search/?q=vtkusers
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtkusers
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20160421/79d2f570/attachment.html>


More information about the vtkusers mailing list