[vtk-developers] CMake and VTK_LIBRARY_DIRS

Brad King brad.king at kitware.com
Mon Dec 9 09:09:19 EST 2013


On 12/07/2013 07:24 PM, lgpasquale wrote:
> You are indeed right, the linker is called with the full path to the
> libraries.
> However, if I output the contents of VTK_LIBRARIES (with
> message("${VTK_LIBRARIES}") ) they do not contain the full path, but only
> the name of the libraries.
> How can the linker know their full path? This must be due to something that
> happens in VtkConfig.cmake...

The names listed in VTK_LIBRARIES are logical target names for imported
VTK targets.  See here for an explanation of the CMake mechanism:

 http://www.cmake.org/Wiki/CMake/Tutorials/Exporting_and_Importing_Targets

Once imported in this way the VTK library target names can be treated
almost as if they were built inside your project.  CMake converts the
logical target names into the library file paths when generating the
link line.

-Brad



More information about the vtk-developers mailing list