CMake: fix Doxygen garbage cleaning

This commit is contained in:
Matteo Cypriani 2013-06-04 11:07:08 -04:00
parent 3aa5ae7513
commit f7533fc93f
1 changed files with 12 additions and 7 deletions

View File

@ -75,11 +75,16 @@ add_custom_command(
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
COMMENT "Generating Doxygen-based man pages")
add_custom_target(doc_doxygen true DEPENDS ${DOXYGEN_MANPAGES})
add_dependencies(doc doc_doxygen)
# Target to clean the files generated by Doxygen that we don't want
# (so-called "directory references"). This cannot be done with CMake's
# file() commands because it has to be run every time the target is
# built, and you cannot use CMake functions in a custom target or
# command.
add_custom_target(clean_doxygen_garbage
COMMAND rm -f "${OUTPUT_DIRECTORY}/_*_owlps_libowlps*_.${SECTION}")
# Clean Doxygen garbage
file(GLOB DOXYGEN_GARBAGE "${OUTPUT_DIRECTORY}/_*_owlps_libowlps*_.${SECTION}")
if (DOXYGEN_GARBAGE)
file(REMOVE ${DOXYGEN_GARBAGE})
endif()
# Set up the target
add_custom_target(doc_doxygen true DEPENDS ${DOXYGEN_MANPAGES})
# Add the target to the "doc" meta-target
add_dependencies(doc doc_doxygen clean_doxygen_garbage)