-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #42 from CExA-project/add-doxygen
Add doxygen
- Loading branch information
Showing
47 changed files
with
4,059 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# .readthedocs.yaml | ||
# Read the Docs configuration file | ||
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details | ||
|
||
# Required | ||
version: 2 | ||
|
||
# Build documentation in the docs/ directory with Sphinx | ||
sphinx: | ||
configuration: docs/conf.py | ||
fail_on_warning: false | ||
|
||
python: | ||
install: | ||
- requirements: docs/requirements.txt | ||
|
||
build: | ||
os: ubuntu-22.04 | ||
tools: | ||
python: "3.10" | ||
apt_packages: | ||
- git | ||
- g++ | ||
- make |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#Look for an executable called sphinx-build | ||
find_program(SPHINX_EXECUTABLE | ||
NAMES sphinx-build | ||
DOC "Path to sphinx-build executable") | ||
|
||
include(FindPackageHandleStandardArgs) | ||
#Handle standard arguments to find_package like REQUIRED and QUIET | ||
find_package_handle_standard_args(Sphinx | ||
"Failed to find sphinx-build executable" | ||
SPHINX_EXECUTABLE) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# source: https://devblogs.microsoft.com/cppblog/clear-functional-c-documentation-with-sphinx-breathe-doxygen-cmake/ | ||
|
||
# Find all the public headers | ||
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/conf.py DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) | ||
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/index.rst DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) | ||
|
||
file(GLOB_RECURSE ${PROJECT_NAME}_PUBLIC_HEADERS | ||
${PROJECT_SOURCE_DIR}/fft/src/*.hpp) | ||
|
||
set(DOXYGEN_INPUT_DIR ${PROJECT_SOURCE_DIR}/fft/src/) | ||
set(DOXYGEN_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR}/doxygen) | ||
set(DOXYGEN_INDEX_FILE ${DOXYGEN_OUTPUT_DIR}/xml/index.xml) | ||
set(DOXYFILE_IN ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in) | ||
set(DOXYFILE_OUT ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile) | ||
|
||
# Set the Doxygen input and output directories in the Doxyfile | ||
configure_file(${DOXYFILE_IN} ${DOXYFILE_OUT}) | ||
|
||
# Doxygen won't create this for us | ||
file(MAKE_DIRECTORY ${DOXYGEN_OUTPUT_DIR}) | ||
|
||
# Only regenerate Doxygen when the Doxyfile or public headers change | ||
add_custom_command(OUTPUT ${DOXYGEN_INDEX_FILE} | ||
DEPENDS ${${PROJECT_NAME}_PUBLIC_HEADERS} | ||
COMMAND ${DOXYGEN_EXECUTABLE} Doxyfile | ||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} | ||
MAIN_DEPENDENCY Doxyfile | ||
COMMENT "Generating docs") | ||
|
||
# Nice named target so we can run the job easily | ||
add_custom_target(Doxygen ALL DEPENDS ${DOXYGEN_INDEX_FILE}) | ||
|
||
set(SPHINX_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}) | ||
set(SPHINX_BUILD ${CMAKE_CURRENT_BINARY_DIR}/sphinx) | ||
set(SPHINX_INDEX_FILE ${SPHINX_BUILD}/index.html) | ||
|
||
# Only regenerate Sphinx when: | ||
# - Doxygen has rerun | ||
# - Our doc files have been updated | ||
# - The Sphinx config has been updated | ||
add_custom_target(Sphinx ALL | ||
COMMAND ${SPHINX_EXECUTABLE} -W --keep-going -b html | ||
# Tell Breathe where to find the Doxygen output | ||
-Dbreathe_projects.${PROJECT_NAME}=${DOXYGEN_OUTPUT_DIR}/xml | ||
${SPHINX_SOURCE} ${SPHINX_BUILD} | ||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} | ||
DEPENDS Doxygen | ||
COMMENT "Generating documentation with Sphinx") | ||
|
||
include(GNUInstallDirs) | ||
install(DIRECTORY ${SPHINX_BUILD} | ||
DESTINATION ${CMAKE_INSTALL_DOCDIR}) |
Oops, something went wrong.