[CMake] Object files as targets (or add_object)

Bill Hoffman bill.hoffman at kitware.com
Sat Jun 20 08:23:00 EDT 2009


Henrique Almeida wrote:
>  Do CMake developers read the mailing list ?
> 
No. :)

> 2009/6/18 Henrique Almeida <hdante at gmail.com>:
>>  Hello,
>>
>>  I'm working on a cross platform libc implementation that uses CMake
>> for the building process. I've noticed that CMake doesn't currently
>> support adding non linked or partially linked object files as a
>> target. For example, I need to install a "runtime.o" object file which
>> will provide runtime support for the library users. I've searched the
>> CMake mailing list and I've found a question about partially linked
>> object files (the poster had issues with circular references), in
>> which the poster suggests, as a trick, creating a static library, then
>> manually unpacking the archive and running the linker with the
>> "relocatable" flag to build the partially linked object (which
>> required knowledge of the archiver and linker argument parameters).
>> I've not seen any further comment about this, however.
>>
>>  Are there any plans to add built-in, cross-platform support for
>> defining object files as targets ? This is something some projects
>> would benefit with.
I am not even sure this can be done in some of the IDE's.  If you can 
figure out how to do this on Xcode, and VS, I would not be opposed to a 
patch.   I suppose you could just create a static library, and then use 
the .o files from that.   There is not much over head in creating a 
static library.

-Bill


More information about the CMake mailing list