From ba660bfd6903ac909815fd0d8204e7bf03197ce8 Mon Sep 17 00:00:00 2001 From: Dan Liew Date: Fri, 29 Sep 2017 09:58:56 +0100 Subject: [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. --- README-CMake.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'README-CMake.md') diff --git a/README-CMake.md b/README-CMake.md index daa1e90c..a2f2da5f 100644 --- a/README-CMake.md +++ b/README-CMake.md @@ -6,7 +6,10 @@ its autoconf/Makefile based build system. ## Useful top level targets * `check` - Build and run all tests. -* `clean` - Clean the build tree. Note this won't clean the runtime build. +* `clean` - Invoke CMake's built-in target to clean the build tree. Note this + won't invoke the `clean_*` targets. It is advised that the `clean_all` target + is used instead. +* `clean_all` - Run all clean targets. * `clean_runtime` - Clean the runtime build tree. * `docs` - Build documentation * `edit_cache` - Show cmake/ccmake/cmake-gui interface for chaning configure options. -- cgit 1.4.1 From 4f72f52f09d75f942bd1f28bf03b5abd95d9627d Mon Sep 17 00:00:00 2001 From: Dan Liew Date: Fri, 29 Sep 2017 10:03:37 +0100 Subject: [CMake] Add `clean_doxygen` rule to clean up doxygen build tree and add this as a dependency of `clean_all`. --- README-CMake.md | 1 + docs/CMakeLists.txt | 14 ++++++++++++++ 2 files changed, 15 insertions(+) (limited to 'README-CMake.md') diff --git a/README-CMake.md b/README-CMake.md index a2f2da5f..5828e319 100644 --- a/README-CMake.md +++ b/README-CMake.md @@ -10,6 +10,7 @@ its autoconf/Makefile based build system. won't invoke the `clean_*` targets. It is advised that the `clean_all` target is used instead. * `clean_all` - Run all clean targets. +* `clean_doxygen` - Clean doxygen build tree. * `clean_runtime` - Clean the runtime build tree. * `docs` - Build documentation * `edit_cache` - Show cmake/ccmake/cmake-gui interface for chaning configure options. 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 -- cgit 1.4.1