From d5cbc2002bbf75f08036f7adf861b027768a0622 Mon Sep 17 00:00:00 2001 From: Martin Nowack Date: Mon, 6 Apr 2020 14:38:50 +0100 Subject: [cmake] Use clean command to remove generated doxygen files --- docs/CMakeLists.txt | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'docs') diff --git a/docs/CMakeLists.txt b/docs/CMakeLists.txt index 6f4168c3..5cab7b4a 100644 --- a/docs/CMakeLists.txt +++ b/docs/CMakeLists.txt @@ -33,15 +33,14 @@ if (ENABLE_DOXYGEN) # 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) + if ("${CMAKE_VERSION}" VERSION_LESS "3.15") + set_directory_properties(PROPERTY ADDITIONAL_MAKE_CLEAN_FILES + "${DOXYGEN_OUTPUT_DIR}") + else () + set_directory_properties(PROPERTY ADDITIONAL_CLEAN_FILES + "${DOXYGEN_OUTPUT_DIR}") + endif () + else() message(WARNING "Doxygen not found. Can't build Doxygen documentation") set(ENABLE_DOXYGEN OFF -- cgit 1.4.1