doxygen fix for documentation

This commit is contained in:
Paulchen Panther 2018-12-20 14:36:13 +01:00 committed by GitHub
parent 8326c122fe
commit bb79589e3e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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()