[cmake-developers] Policy for INTERFACE_LINK_LIBRARIES
Stephen Kelly
steveire at gmail.com
Mon Dec 10 17:25:39 EST 2012
Brad King wrote:
> On 12/10/2012 09:52 AM, Stephen Kelly wrote:
>> Brad King wrote:
>>
>>> IIRC the topic that added dependent export support was only
>>> finished for the install(EXPORT) command and not for export().
>>> It added a test for the install case mixing namespaces:
>>>
>>> http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=955b9662
>>>
>>> It appears to work.
>>
>> Yes. I refactored my topic to use the same logic/code as is used there.
>
> Thanks.
>
>> That involved removing the EXPORT_NAMESPACE generator and adding a new
>> $<TARGET> generator which is a preprocessor-marker accepting only
>> literals for pointing out target names. Those target names only need to
>> be extracted at export time.
>>
>> I think the name $<TARGET> is suitable, but I don't mind changing it.
>
> How about "$<TARGET_NAME:...>"? If it is ever evaluated (instead
> of replaced) then it evalutes to "..." anyway, right?
Correct. Is does deliberately get evaluated at generate time when computing
the link implementation (or link interface). It is only preprocessed and
replaced when property values are being exported.
I've also extended the preprocessing logic now to also include
$<TARGET_PROPERTY:tgt,prop>
in cases where tgt is a literal. That saves having to (remember to) write
$<TARGET_PROPERTY:$<TARGET_NAME:tgt>,prop>
all the time. Using TARGET_NAME is still necessary in cases where tgt is not
a literal. Eg:
$<TARGET_PROPERTY:$<$<CONFIG_DEBUG>:$<TARGET_NAME:tgt_debug>>,prop>
Thanks,
Steve.
More information about the cmake-developers
mailing list