about summary refs log tree commit diff homepage
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorDan Liew <daniel.liew@imperial.ac.uk>2017-09-29 09:58:56 +0100
committerDan Liew <daniel.liew@imperial.ac.uk>2017-10-04 22:28:52 +0100
commitba660bfd6903ac909815fd0d8204e7bf03197ce8 (patch)
tree39bf877641ee4edb49310724d8b4481d4e60d43c /CMakeLists.txt
parent12f0e2cd11e4bb9e0aa829f95bb437bee0e929cb (diff)
downloadklee-ba660bfd6903ac909815fd0d8204e7bf03197ce8.tar.gz
[CMake] Add global clean target `clean_all`. Fixes #718.
This target invokes the `clean` target but is also intended for use by
other cleaning targets. The `clean_runtime` target is now declared as a
dependency of `clean-all` so that the runtime is cleaned as well.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt17
1 files changed, 17 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ed031459..32933e7c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -490,6 +490,23 @@ else()
 endif()
 
 ################################################################################
+# Global clean target
+################################################################################
+# CMake already uses the "clean" target name but it doesn't clean everything
+# unfortunately. We can't modify the target so we provide our own "clean_all"
+# target that runs clean. Other rules for performing clean up should declare
+# that "clean_all" depends on those rules.
+add_custom_target(clean_all
+  # Invoke CMake's own clean target
+  COMMAND
+    "${CMAKE_COMMAND}"
+    "--build"
+    "${CMAKE_BINARY_DIR}"
+    "--target"
+    "clean"
+)
+
+################################################################################
 # KLEE runtime support
 ################################################################################
 # This is set here and not in `runtime` because `config.h` needs to be generated.