etc: Add Doxygen

This commit is contained in:
Joshua Scott 2018-11-18 17:19:18 +00:00
parent 79105ab3d3
commit cc788b12b3
2 changed files with 29 additions and 0 deletions

View File

@ -23,6 +23,26 @@ target_link_libraries(${PROJECT_NAME} RapidXML)
add_subdirectory("src/dml")
add_subdirectory("src/protocol")
find_package(Doxygen)
option(KI_BUILD_DOCUMENTATION "Determines whether to build the HTML documentation. (via Doxygen)" ${DOXYGEN_FOUND})
if (KI_BUILD_DOCUMENTATION)
if(NOT DOXYGEN_FOUND)
message(FATAL_ERROR "Doxygen is needed to build the documentation.")
endif()
set(DOXYFILE_IN ${PROJECT_SOURCE_DIR}/docs/Doxyfile.in)
set(DOXYFILE_OUT ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile)
configure_file(${DOXYFILE_IN} ${DOXYFILE_OUT} @ONLY)
add_custom_target(
doc ALL
COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYFILE_OUT}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Generating API documentation with Doxygen"
VERBATIM
)
endif()
option(COVERALLS "Generate coveralls data" OFF)
if (COVERALLS)
include(Coveralls)

9
docs/Doxyfile.in Normal file
View File

@ -0,0 +1,9 @@
PROJECT_NAME = "libki"
STRIP_FROM_PATH = "@PROJECT_SOURCE_DIR@"
INPUT = "@PROJECT_SOURCE_DIR@/src" \
"@PROJECT_SOURCE_DIR@/include"
FILE_PATTERNS = *.h \
*.cpp
OUTPUT_DIRECTORY = "@CMAKE_CURRENT_BINARY_DIR@/docs"
RECURSIVE = YES
GENERATE_LATEX = NO