[CMake] Produce only an object file (*.o) from a CMake build target

Alexander Neundorf a.neundorf-work at gmx.net
Mon Jan 24 15:06:48 EST 2011


On Monday 24 January 2011, David Cole wrote:
> On Mon, Jan 24, 2011 at 2:33 PM, Andreas Pakulat <apaku at gmx.de> wrote:
> > On 24.01.11 09:37:01, Helseth, Nicholas H wrote:
> > > I'm trying to build an object file using CMake, but I can't seem to
> > > get CMake to build something other than a complete executable. I'm
> > > basically looking for the result of the following compilation (the
> > > result will be loaded on a VxWorks target and linked then-it needs to
> > > be a *.o because of the way our build system works):
> >
> > You can't do this with cmake.
>
> But you can do anything you want with custom commands in CMake. It just
> might not be very easy or very cross-platform.
>
> Why do you need the *.o files individually?
>
> Could you instead build a static library with CMake, and then use a custom
> command to glob for the *.o files produced?

Aren't the <COMPILE_C_OBJECT> etc. variables now also usable in normal cmake 
variables or something ?
Could this be used somehow for that ?

Alex


More information about the CMake mailing list