Improve documentation workflow (#163)

* Compact project relative paths from doc directory

* Remove committed example_list.md

- generate example_list from cmake for documentation

* Fix doxygen same-line comments

* Add workflow for generating documentation
This commit is contained in:
Tushar Maheshwari
2021-07-23 12:10:47 +05:30
committed by GitHub
parent 7f95d59954
commit a40a54ec10
7 changed files with 72 additions and 87 deletions

View File

@@ -1,10 +1,15 @@
find_package(Doxygen)
if (DOXYGEN_FOUND)
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in
${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
@ONLY
)
# Generate example list for documentation
set(EXAMPLE_LIST "${CMAKE_CURRENT_BINARY_DIR}/example_list.md")
file(WRITE ${EXAMPLE_LIST} "# Examples")
file(GLOB_RECURSE EXAMPLES RELATIVE ${PROJECT_SOURCE_DIR}
"${PROJECT_SOURCE_DIR}/examples/*.cpp")
foreach(EXAMPLE IN LISTS EXAMPLES)
file(APPEND ${EXAMPLE_LIST} "\n@example ${EXAMPLE}")
endforeach(EXAMPLE IN LISTS EXAMPLES)
configure_file(Doxyfile.in Doxyfile @ONLY)
# note the option ALL which allows to build the docs together with the application
add_custom_target(doc