[cmake-developers] target_link_libraries not callable from other directory scopes

Rolf Eike Beer eike at sf-mail.de
Fri Apr 27 14:53:00 EDT 2018


Craig Scott wrote:

> This limitation has been intentional since target_link_libraries was first
> created long before the others. It is the oldest of the target_ commands.
> The original justification is that we don't want to allow this because it
> makes it very easy for non-local commands to drastically change the way a
> target is built. That the newer target_ commands allow non-local targets
> was an oversight.
> 
> Maybe the limitation could be lifted but I'd like to see a strong
> justification and example use case.

[…]

This sounds very much like what I'm doing for OSM2go by other means. This will 
become simpler once 3.12 is out and object libraries can drag in additional 
dependencies:

https://github.com/osm2go/osm2go/blob/master/src/platforms/gtk/CMakeLists.txt

Eike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: This is a digitally signed message part.
URL: <https://cmake.org/pipermail/cmake-developers/attachments/20180427/4f5e6c31/attachment.sig>


More information about the cmake-developers mailing list