Re: [CMake] [Titan-developers] Forcing 'out-of-source' build
I am not sure if you can prevent it from generating those files but you could remove those files with file(REMOVE ...) in your IF(insource) block. On Fri, Nov 26, 2010 at 3:24 PM, Wylie, Brian wrote: > 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? > > Brian Wylie - Org 1424 > Sandia National Laboratories > MS 1323 - Building CSRI/242 > (505)844-2238 FAX(505)284-2518 > ___ __ > /_ __(_) /_ _ > / / / / __/ __ `/ __ \ > / / / / /_/ /_/ / / / / > /_/ /_/\__/\__,_/_/ /_/ > Scalable Analysis and Visualization > > > > ___ > Titan-developers mailing list > titan-develop...@public.kitware.com > http://public.kitware.com/cgi-bin/mailman/listinfo/titan-developers > ___ 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
Re: [CMake] [Titan-developers] Forcing 'out-of-source' build
On Fri, Nov 26, 2010 at 3:24 PM, Wylie, Brian wrote: > 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? > This was discussed recently by the ITK community, the best they came up with was making CMake give instructions on how to clean up your source tree. Hopefully this link works, and you can see what I mean, http://www.itk.org/gitweb?p=ITK.git;a=blob;f=CMake/PreventInSourceBuilds.cmake;h=78f6b4e63ab7b08ec87146f61adbb791a178;hb=HEAD Marcus ___ 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