[cmake-developers] TARGET_OBJECTS and buildsystem replacement macros

Stephen Kelly steveire at gmail.com
Thu Mar 20 11:05:14 EDT 2014


Brad King wrote:

>> If only the buildsystem tool knows the correct arch, does that mean that
>> CMake can not learn a built-in feature for installing object libraries,
>> because it is not possible to implement install() correctly for the files
>> for Xcode?
> 
> I'd rather have a builtin feature for installing object libraries than
> encourage use of the install_objlib_hack approach you posted.

Me too. I just posted it to illustrate the problem and to point out that the 
problem may block the 'install object libraries' feature, until perhaps 
install() is updated to handle this problem.

>> 1) I can modify the TargetObjectsNode to replace the CfgIntDir macros
>> with the actual configuration, but that will affect the generated
>> buildsystem files too
>> 2) We can leave things as they are in the branch, meaning install(FILES)
>> won't work well with $<TARGET_OBJECTS> and let users of file(GENERATE)
>> deal with the output.
> 
> Does my $<CONFIG> suggestion above resolve this?

Perhaps.

> I think it leaves
> only the Xcode $(CURRENT_ARCH) problem.  Perhaps a similar $<ARCH>
> genex can be used for that too.

Perhaps. I'll not take that on now.

>> 3) We can make it an error to use $<TARGET_OBJECTS> in any user-context
>> of generator expressions. That will also affect the use of
>> $<TARGET_PROPERTY:SOURCES> when object libraries are involved.
> 
> This approach would allow us to delay a decision until later so let's
> use it if we can't find a good solution now.

Ok. I've added a commit which implements this and which can be reverted in 
the future.

Thanks,

Steve.





More information about the cmake-developers mailing list