about summary refs log tree commit diff homepage
path: root/docs/CMakeLists.txt
diff options
context:
space:
mode:
authorDan Liew <daniel.liew@imperial.ac.uk>2017-09-29 10:03:37 +0100
committerDan Liew <daniel.liew@imperial.ac.uk>2017-10-04 22:28:52 +0100
commit4f72f52f09d75f942bd1f28bf03b5abd95d9627d (patch)
treec89cf0c6d43dba711e56c3d525fa865ce1160ac4 /docs/CMakeLists.txt
parentba660bfd6903ac909815fd0d8204e7bf03197ce8 (diff)
downloadklee-4f72f52f09d75f942bd1f28bf03b5abd95d9627d.tar.gz
[CMake] Add `clean_doxygen` rule to clean up doxygen build tree and
add this as a dependency of `clean_all`.
Diffstat (limited to 'docs/CMakeLists.txt')
-rw-r--r--docs/CMakeLists.txt14
1 files changed, 14 insertions, 0 deletions
diff --git a/docs/CMakeLists.txt b/docs/CMakeLists.txt
index 386298ce..f689e8a0 100644
--- a/docs/CMakeLists.txt
+++ b/docs/CMakeLists.txt
@@ -28,6 +28,20 @@ if (ENABLE_DOXYGEN)
       ${ADD_CUSTOM_COMMAND_USES_TERMINAL_ARG}
     )
     add_dependencies(docs doc-doxygen)
+
+    # FIXME: This variable should be used to set `OUTPUT_DIRECTORY` in
+    # doxygen.cfg
+    set(DOXYGEN_OUTPUT_DIR "${CMAKE_CURRENT_BINARY_DIR}/doxygen")
+
+    # Add rule to clean doxygen documentation
+    add_custom_target(clean_doxygen
+      COMMAND
+        "${CMAKE_COMMAND}"
+        "-E"
+        "remove_directory"
+        "${DOXYGEN_OUTPUT_DIR}"
+    )
+    add_dependencies(clean_all clean_doxygen)
   else()
     message(WARNING "Doxygen not found. Can't build Doxygen documentation")
     set(ENABLE_DOXYGEN OFF