hyperion.ng/doc/CMakeLists.txt

35 lines
1.2 KiB
CMake
Raw Normal View History

2018-12-20 14:36:13 +01:00
option(BUILD_HYPERION_DOC "Build hyperion documentation" OFF)
2018-12-20 14:36:13 +01:00
# Find doxygen and check if Doxygen is installed
find_package(Doxygen QUIET)
2018-12-20 14:36:13 +01:00
if (BUILD_HYPERION_DOC)
if (DOXYGEN_FOUND)
2018-12-20 14:36:13 +01:00
# set input and output files
set(DOXYGEN_IN ${CMAKE_CURRENT_SOURCE_DIR}/hyperion.in.doxygen)
set(DOXYGEN_OUT ${CMAKE_CURRENT_BINARY_DIR}/hyperion.doxygen)
2018-12-20 14:36:13 +01:00
# request to configure the file
configure_file(${DOXYGEN_IN} ${DOXYGEN_OUT} @ONLY)
message(STATUS "Doxygen build started")
2018-12-20 14:36:13 +01:00
# Define all static (i.e. not generated) documentation files
2018-12-31 00:21:44 +01:00
set(StaticDocumentationFiles hyperion-footer.html)
2018-12-20 14:36:13 +01:00
# 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()
2018-12-20 14:36:13 +01:00
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()