Files
aare/docs/CMakeLists.txt
mazzol_a 56e880638e
Build on RHEL9 / build (push) Successful in 3m49s
Build on RHEL8 / build (push) Successful in 4m8s
Run tests using data on local RHEL8 / build (push) Successful in 4m44s
Build on local RHEL8 / build (push) Successful in 3m21s
handle overloads (#433)
Pybind11 merges all docstrings of overloaded functions into one
docstring.
Sphinx rendering usually complains about these merged docstrings e.g
unexpected Section titles.

Added a custom sphinx extension that overwrites the standard pybind11
method and function document handler.

The handler splits the pybind generated docstring and adds for each
overload its own method header.
2026-11-03 09:51:26 +01:00

24 lines
825 B
CMake

# SPDX-License-Identifier: MPL-2.0
find_package(Doxygen REQUIRED)
find_package(Sphinx REQUIRED)
# Doxygen
set(DOXYGEN_IN ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in)
set(DOXYGEN_OUT ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile)
configure_file(${DOXYGEN_IN} ${DOXYGEN_OUT} @ONLY)
# Sphinx
set(SPHINX_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/src)
set(SPHINX_BUILD ${CMAKE_CURRENT_BINARY_DIR})
add_custom_target(
docs
COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYGEN_OUT}
COMMAND
${CMAKE_COMMAND} -E env "PYTHONPATH=${CMAKE_BINARY_DIR}" # find aare module
${SPHINX_EXECUTABLE} -W -a -b html -Dversion=${PROJECT_VERSION}
-Drelease=${PROJECT_VERSION}
-Dbreathe_projects.aare=${CMAKE_CURRENT_BINARY_DIR}/xml -c
"${CMAKE_CURRENT_SOURCE_DIR}" ${SPHINX_SOURCE} ${SPHINX_BUILD}/html
COMMENT "Generating documentation with Sphinx")