[CMake] Disallowing in-source builds

aaron.meadows at thomsonreuters.com aaron.meadows at thomsonreuters.com
Wed Oct 6 14:10:37 EDT 2010


Hi all.

 

Is there a good way to disallow in-source builds?  Ideally, I'd like to
prevent it before any cruft is written into the source tree.  I
experimented with writing a function into my CMakelists file and calling
it.  The function checked if CMAKE_BINARY_DIR was equal to
CMAKE_SOURCE_DIR and messaged a FATAL_ERROR if that was the case.  This
works ok, but still generates a CMakeFiles directory and a
CMakeCache.txt file.

 

The second half of the question is of course, is there an easy way to
clean out a source tree if an in-source build was accidentally kicked
off?  (short of dividing the files by their timestamp and removing the
newer ones, etc..)

 

Thanks!

 

--aaron

 

Aaron Meadows
Software Engineer

Thomson Reuters

Phone: 314.468.3530
Mobile: 636.541.6139
aaron.meadows at thomsonreuters.com
thomsonreuters.com

 



This email was sent to you by Thomson Reuters, the global news and information company.
Any views expressed in this message are those of the individual sender, except where the sender specifically states them to be the views of Thomson Reuters.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20101006/fb903d7e/attachment-0001.htm>


More information about the CMake mailing list