[CMake] "make superclean" target? (i.e. clear *everything*)
Brian Milco
bcmilco at gmail.com
Thu Apr 4 11:31:14 EDT 2013
On Thu, Apr 4, 2013 at 6:01 AM, Daniele E. Domenichelli <
daniele.domenichelli at gmail.com> wrote:
>
> One benefit is that it would allow to easily remove all cmake files when
> you wrongly run cmake in the source directory instead of in the build one.
>
>
A while ago I found the attached macro online[1]. It stops the build
process early on preventing an in source build.
Since it has to start the process to work you still get a CMakeCache.txt
file and CMakeFiles directory but those are easy enough to remove compared
to picking through your whole source tree.
To use it place the Macro as close to the top of your master CMakeLists.txt
file as you can and call it with something like:
# Appends the path where you are keeping this Macro
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules
${CMAKE_MODULE_PATH})
#Forces out of source builds just in case.
include(MacroOutOfSourceBuild)
macro_ensure_out_of_source_build("${PROJECT_NAME} requires an out of source
build.")
-Brian
[1]
https://github.com/DisCODe/DisCODe/blob/master/cmake/modules/MacroOutOfSourceBuild.cmake
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20130404/f9f5e9f4/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: MacroOutOfSourceBuild.cmake
Type: application/octet-stream
Size: 463 bytes
Desc: not available
URL: <http://www.cmake.org/pipermail/cmake/attachments/20130404/f9f5e9f4/attachment-0001.obj>
More information about the CMake
mailing list