[cmake-developers] Linking to OBJECT libraries?

Stephen Kelly steveire at gmail.com
Thu Jun 6 10:41:35 EDT 2013


Brad King wrote:
> Instead let's consider introducing a usage requirement that can bring
> in object libraries, external objects, or even source files.  That
> would solve this and be pretty cool too.

There's no existing API for manipulating the source items of a target after 
its creation, so I thought that would be disallowed for some reason.

So, what we're talking about is something like a target property 
SOURCE_ITEMS?

 # Only appending to this property allowed:
 set_property(TARGET foo APPEND PROPERTY 
   SOURCE_ITEMS
     $<TARGET_OBJECTS:bar>
     somefile.cpp
     somecompileobject.o
 )

and a corresponding INTERFACE_SOURCE_ITEMS which gets consumed from the link 
interface?

Thanks,

Steve.





More information about the cmake-developers mailing list