[CMake] Change object output directory

Qiyu Liu cmake at qlat.com
Mon Aug 1 03:37:33 EDT 2005


Quoting Alexander Neundorf <a.neundorf-work at gmx.net>:

> > --- Ursprüngliche Nachricht ---
> > Von: Qiyu Liu <cmake at qlat.com>
> > An: cmake at cmake.org
> > Betreff: [CMake] Change object output directory
> > Datum: Sun, 31 Jul 2005 13:43:27 -0600
> >
> > My program has multiple binaries that each create objects from the
> same
> > source files.  However, each binary creates these objects
> differently,
> > which is controlled a compile-time switch.
> >
> > CMake by default seems to output the objects in the same directory
> as
> > the source.  Thus, one binary would see the objects created by
> another
> > binary and use them rather than compiling its own version.  Until
> now,
> I
> > had been compiling one binary, running make clean, then compiling
> > another binary.  Obviously, this is horribly inefficient if you
> only
> > make a small change and don't want to recompile everything.
> >
> > Is there an option in CMake to specify where the object files are
> > output so I can avoid this conflict?
>
> I think you have two options:
>
> -either use current cmake from cvs, this should do what you want
>
> -or build each of your binaries in its own subdirectory (and use the
> source files from ../)
>
> Bye
> Alex
>
>
>
> --
> 5 GB Mailbox, 50 FreeSMS http://www.gmx.net/de/go/promail
> +++ GMX - die erste Adresse für Mail, Message, More +++
>

What is the syntax to do change the object directory if I use the cmake
from cvs?

Regarding your second suggestion, it is actually my current setup.  My
tree looks similar to:

program/source
program/binaries/module1
program/binaries/module2

Each CMakeLists is in its own module directory and everything sources
from the same source tree...

Are you suggesting I duplicate copies of the source for each of the
modules that is conflicting?

-Q


More information about the CMake mailing list