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

Chris Green greenc at fnal.gov
Wed Jan 28 15:12:03 EST 2015


Hi,

I've been trying to run down a problem with our cmake-based build system 
that appears to be a result of a target_link_libraries(...) invocation 
taking a fully qualified shared library location and replacing it with 
-l<lib>. Since we're trying very hard to avoid picking up unwanted, 
older copies of this library from system areas, this is causing us quite 
some angst.

The command:

target_link_libraries(<target> /X/Y/libtbb.so)

results in link.txt files containing -ltbb.

I wasn't able to find anywhere in documentation that mentioned this was 
a possible behavior of target_link_libraries, which is why it took us so 
long to trace it down to this in particular.

So, my questions:

 1. Is this a bug?
 2. If not a bug, what is the rationale for this behavior, and under
    what circumstances does this behavior get triggered?
 3. Is it possible to deactivate this behavior?
 4. If not, can it be made possible to deactivate this behavior?

Thanks for your help,

Chris.

-- 
Chris Green <greenc at fnal.gov>, FNAL CS/SCD/ADSS/SSI/SSD;
'phone (630) 840-2167; Skype: chris.h.green;
IM: greenc at jabber.fnal.gov, chissgreen (AIM, Yahoo),
chissg at hotmail.com (MSNM), chris.h.green (Google Talk).

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20150128/a02d4ff0/attachment.html>


More information about the CMake mailing list