From bb79589e3ef49642fba71e1180713d746ae2bb81 Mon Sep 17 00:00:00 2001 From: Paulchen Panther Date: Thu, 20 Dec 2018 14:36:13 +0100 Subject: [PATCH] doxygen fix for documentation --- doc/CMakeLists.txt | 50 ++++++++++++++++++++++++---------------------- 1 file changed, 26 insertions(+), 24 deletions(-) diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt index dc5e88fd..5f90eced 100644 --- a/doc/CMakeLists.txt +++ b/doc/CMakeLists.txt @@ -1,32 +1,34 @@ +option(BUILD_HYPERION_DOC "Build hyperion documentation" OFF) -# Find doxygen +# Find doxygen and check if Doxygen is installed find_package(Doxygen QUIET) -# This processes our hyperion-cmake.doxyfile and subsitutes variables to generate a final hyperion.doxyfile -configure_file(${CMAKE_CURRENT_SOURCE_DIR}/hyperion.in.doxygen ${CMAKE_CURRENT_BINARY_DIR}/hyperion.doxygen) +if (BUILD_HYPERION_DOC) + if (DOXYGEN_FOUND) -# This processes the shell script that is used to build the documentation and check the result -configure_file(${CMAKE_CURRENT_SOURCE_DIR}/hyperion-build-doc.in.sh ${CMAKE_CURRENT_BINARY_DIR}/hyperion-build-doc.sh) + # set input and output files + set(DOXYGEN_IN ${CMAKE_CURRENT_SOURCE_DIR}/hyperion.in.doxygen) + set(DOXYGEN_OUT ${CMAKE_CURRENT_BINARY_DIR}/hyperion.doxygen) -# Define all static (i.e. not generated) documentation files -set(StaticDocumentationFiles hyperion-header.html hyperion-footer.html hyperion-stylesheet.css) + # request to configure the file + configure_file(${DOXYGEN_IN} ${DOXYGEN_OUT} @ONLY) + message(STATUS "Doxygen build started") -# Loop over all static documentation files -foreach(StaticDocumentationFile ${StaticDocumentationFiles}) - # Copy the file to the bindary documentation directory - configure_file(${CMAKE_CURRENT_SOURCE_DIR}/${StaticDocumentationFile} ${CMAKE_CURRENT_BINARY_DIR}/html/${StaticDocumentationFile} COPYONLY) -endforeach() + # Define all static (i.e. not generated) documentation files + set(StaticDocumentationFileshyperion-footer.html) -if(DOXYGEN_FOUND) - option(BuildDocumentationSearchEngine "Enable doxygen's search engine (requires that documentation to be installed on a php enabled web server)" OFF) - if(BuildDocumentationSearchEngine) - set(DOXYGEN_SEARCHENGINE YES) - else(BuildDocumentationSearchEngine) - set(DOXYGEN_SEARCHENGINE NO) - endif(BuildDocumentationSearchEngine) + # Loop over all static documentation files + foreach(StaticDocumentationFile ${StaticDocumentationFiles}) + # Copy the file to the bindary documentation directory + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/${StaticDocumentationFile} ${CMAKE_CURRENT_BINARY_DIR}/html/${StaticDocumentationFile} COPYONLY) + endforeach() - #Create a custom target to build documentation. It runs doxygen aginast the generated hyperion.doxyfile and checks its return value - add_custom_target(doc sh ${CMAKE_CURRENT_BINARY_DIR}/hyperion-build-doc.sh) -else(DOXYGEN_FOUND) - message(WARNING "Doxygen not found, unable to generate documenation!") -endif(DOXYGEN_FOUND) + add_custom_target( doc_doxygen ALL + COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYGEN_OUT} + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + COMMENT "Generating API documentation with Doxygen" + VERBATIM ) + else(DOXYGEN_FOUND) + message(WARNING "Doxygen not found, unable to generate documenation!") + endif(DOXYGEN_FOUND) +endif()