[cmake-developers] Setting target properties before the target is defined ?

Stephen Kelly steveire at gmail.com
Wed Mar 27 09:32:56 EDT 2013


Brad King wrote:

> On 03/27/2013 08:54 AM, Stephen Kelly wrote:
>> Brad King <brad.king at ...> writes:
>>> the iface->SharedDeps list needs to be included in
>>> IMPORTED_LINK_INTERFACE_TARGETS_≤CONFIG> also.
>> 
>> The problem with this is that it will break working code. Not-found
>> entries in the LINK_DEPENDENT_LIBRARIES do not currently cause a build
>> error. The only effect (as far as I know) is that the target location is
>> not available for generating the correct RPATH information, which
>> downstreams may or may not use.
> 
> It's not for -rpath, it's for -rpath-link.  They are different.
> 
> See the example here for how it can cause a build error in downstreams:
> 
>  
http://thread.gmane.org/gmane.comp.programming.tools.cmake.user/35578/focus=35666

Ok. 

All I know is that it doesn't seem to cause a build error for me when I 
export a target with LINK_PUBLIC Qt5::Core LINK_PRIVATE Qt5::Script and then 
have the caller only find Qt5Core and not Qt5Script.

Would that be because libQt5Script.so.5 is in the same dir as 
libQt5Core.so.5, and the Qt5::Script entry in LINK_DEPENDENT_LIBRARIES is 
ignored?

Also, when building the executable, the link line contains the full path to 
Qt5Core, and -Wl,-rpath,/path/to/qt5prefix/lib. Maybe that's what makes it 
work for me either?

At any rate, changing this to be a fatal error should at least come with a 
policy, no?

Thanks,

Steve.





More information about the cmake-developers mailing list