Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions doc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,19 @@

message(STATUS "Building API Documentation (mandatory for Python binding or for building the manual)")

set(SPHINX_EXTRA_API ${CMAKE_CURRENT_BINARY_DIR}/manual/extra_html/api)
file(MAKE_DIRECTORY ${SPHINX_EXTRA_API})

execute_process(COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYGEN_INPUT} OUTPUT_QUIET)
execute_process(
COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYGEN_INPUT}
OUTPUT_QUIET
ERROR_VARIABLE DOXYGEN_ERROR
RESULT_VARIABLE DOXYGEN_RESULT
)
if(NOT DOXYGEN_RESULT EQUAL 0)
if(DOXYGEN_RESULT STREQUAL "Segmentation fault" AND EXISTS "${CMAKE_BINARY_DIR}/doc/api/xml/index.xml")
message(WARNING "Doxygen exited with '${DOXYGEN_RESULT}' but generated XML output. Continuing so Python docstrings can still be generated.")
else()
message(FATAL_ERROR "Doxygen failed to generate the API documentation (exit code ${DOXYGEN_RESULT}), which is required for the Python docstrings. Doxygen errors: ${DOXYGEN_ERROR}")
endif()
endif()
add_custom_target(api COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYGEN_INPUT} OUTPUT_QUIET)

endif()
Expand Down
6 changes: 5 additions & 1 deletion python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,11 @@
execute_process(COMMAND ${PYTHON_EXECUTABLE}
${PROJECT_SOURCE_DIR}/scripts/doxygen/doxygen2docstring.py
${CMAKE_CURRENT_BINARY_DIR}/../doc/api/xml/
${CMAKE_CURRENT_BINARY_DIR}/docstring)
${CMAKE_CURRENT_BINARY_DIR}/docstring
RESULT_VARIABLE DOCSTRING_RESULT)
if(NOT DOCSTRING_RESULT EQUAL 0)
message(FATAL_ERROR "doxygen2docstring.py failed (exit code ${DOCSTRING_RESULT}) while generating the Python docstring headers.")
endif()

endif()

Expand Down
Loading