[CMake] target_link_libraries replacing fully-qualified library with -l<x>

Brad King brad.king at kitware.com
Thu Jan 29 08:41:56 EST 2015


On 01/28/2015 03:12 PM, Chris Green wrote:
> target_link_libraries(<target> /X/Y/libtbb.so)
> 
> results in link.txt files containing -ltbb.

This happens when the library is in an implicit link directory,
or possibly when the library does not have an SONAME field set.

For the former case, use an imported target:

 http://www.cmake.org/cmake/help/v3.1/command/add_library.html#imported-libraries
 http://www.cmake.org/cmake/help/v3.1/manual/cmake-buildsystem.7.html#imported-targets

-Brad



More information about the CMake mailing list