[CMake] seperate source/build directories (Was: cleaning targets)

Hendrik Sattler post at hendrik-sattler.de
Thu Nov 6 17:59:15 EST 2008


Am Thursday 06 November 2008 22:15:21 schrieb Eric (Brad) Lemings:
> Eric Noulard wrote:
> > 2008/11/6 Michael Jackson <mike.jackson at bluequartz.net>:
> >> All this is asking is 2 extra commands.
> >
> > You may perfectly do that with autotools too:
> >
> > mkdir build
> > cd build
> > /path/to/source/configure
> > make
> > make install

Once you have the configure script and if you use automake. The output of 
autoreconf (and everything it calls) is still in the source tree but are not 
source files since they are auto-generated.

I assume that most autoconf-but-not-automake projects will also fail to do 
the 'make' step correctly for out-of-source builds.

I agree, though, that a distclean target should be provided, even if it is 
possible that it is not perfect. Especially because:
  1. cmake does not forbid to do in-source builds
  2. running "cmake path/to/source" from a build dir is broken if there was
      a previous in-source build attempt
  3. no automatic way to clean up an erronous in-source build is provided

You either forbid in-source builds or try to provide a distclean target.

HS


More information about the CMake mailing list