[CMake] Is there an elegant way to get list of object files participating into a library?

Michael Hertling mhertling at online.de
Sun Feb 27 19:17:59 EST 2011


On 02/27/2011 10:38 PM, Pere Mato Vila wrote:
> Hi,
> 
>   For the Windows platform  I am generating the .DEF files with all defined symbols to be exported.  For this  I need to get the list of all object files (.obj) participating into a library. The question is whether this list is available knowing the library target name. I can try to construct it staring from the list of sources and try to reverse-engineer the correct suffix replacement and their location in the build tree. But clearly would be better if this is given to me directly.     

If you use a Makefile generator, you might utilise the RULE_LAUNCH_LINK
target property for your purpose; see [1] for an example how to access
the object files being incorporated in a library target on *nix.

Regards,

Michael

[1] http://www.mail-archive.com/cmake@cmake.org/msg34148.html


More information about the CMake mailing list