[CMake] Automate cleaning after CMAKE_DISABLE_IN_SOURCE_BUILD

Ateljevich, Eli eli at water.ca.gov
Mon Jul 16 12:47:59 EDT 2012


Hi everyone,
My CMakeLists.txt uses the undocumented features:
set(CMAKE_DISABLE_SOURCE_CHANGES ON)
set(CMAKE_DISABLE_IN_SOURCE_BUILD ON)

The first one prevents in-source builds as expected (even in 2.6, which I wasn't expecting). I find this very useful. I'm not sure about the second one.

However, regardless of version it seems like artifacts are left in the /src directory. If the user does the smart-but-not-expert thing and backs out to /build and tries ../src, cmake fails again thinking that the output directory is still /src.

Is there a way to intercede earlier like Brad Kings "InSource.cmake" idea? Sorry if I missed any decisive documentation on this - it isn't that I see nothing on the subject, but rather a lot of stuff that doesn't look like it got implemented.

Barring that, is there a good way to clean up after the fact?

Thanks,
Eli


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20120716/7a80f8aa/attachment.htm>


More information about the CMake mailing list