[CMake] Forcing 'out-of-source' build

j s j.s4403 at gmail.com
Fri Nov 26 16:55:55 EST 2010


I'd recommend this:
touch CMakeCache.txt
touch CMakeFiles

Check said files into your revision control system.

The fact that it can't create a directory alone makes cmake freak out almost
immediately.

Juan

On Fri, Nov 26, 2010 at 3:06 PM, Eric Noulard <eric.noulard at gmail.com>wrote:

> 2010/11/26 Wylie, Brian <bnwylie at sandia.gov>:
> > Hi All,
> >
> > I want to force an 'out-of-source' build for a small project that I
> converted to use Cmake.
> >
> > I did a bit of searching and found variants of the following...
> >
> > # Make sure the build is out of source
> > STRING(COMPARE EQUAL "${CMAKE_SOURCE_DIR}" "${CMAKE_BINARY_DIR}"
> insource)
> >  IF(insource)
> >    MESSAGE(FATAL_ERROR "Do not build in your source dir please :)")
> >  ENDIF(insource)
> >
> >
> > It works but it still generates a CMakeCache.txt file and a CMakeFiles
> directory in the source directory (which I've also seen others
> discussing)...  is there a more official way to block 'in-source' builds
> that leaves the source dir pristine?
>
> There is a feature request pending for this (with one duplicate)
> http://www.vtk.org/Bug/view.php?id=6672
>
> --
> Erk
> Membre de l'April - « promouvoir et défendre le logiciel libre » -
> http://www.april.org
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20101126/d7c8d27e/attachment.htm>


More information about the CMake mailing list