Skip to content

Commit 3c7afe7

Browse files
committed
Merge branch 'Jordan08-dev-clean-v2-57' into codac2
2 parents cf5be5b + 6fe3347 commit 3c7afe7

2 files changed

Lines changed: 18 additions & 5 deletions

File tree

‎doc/CMakeLists.txt‎

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,19 @@
3434

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

37-
set(SPHINX_EXTRA_API ${CMAKE_CURRENT_BINARY_DIR}/manual/extra_html/api)
38-
file(MAKE_DIRECTORY ${SPHINX_EXTRA_API})
39-
40-
execute_process(COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYGEN_INPUT} OUTPUT_QUIET)
37+
execute_process(
38+
COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYGEN_INPUT}
39+
OUTPUT_QUIET
40+
ERROR_VARIABLE DOXYGEN_ERROR
41+
RESULT_VARIABLE DOXYGEN_RESULT
42+
)
43+
if(NOT DOXYGEN_RESULT EQUAL 0)
44+
if(EXISTS "${CMAKE_BINARY_DIR}/doc/api/xml/index.xml")
45+
message(WARNING "Doxygen exited with '${DOXYGEN_RESULT}' but generated XML output. Continuing so Python docstrings can still be generated.")
46+
else()
47+
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}")
48+
endif()
49+
endif()
4150
add_custom_target(api COMMAND ${DOXYGEN_EXECUTABLE} ${DOXYGEN_INPUT} OUTPUT_QUIET)
4251

4352
endif()

‎python/CMakeLists.txt‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,11 @@
6464
execute_process(COMMAND ${PYTHON_EXECUTABLE}
6565
${PROJECT_SOURCE_DIR}/scripts/doxygen/doxygen2docstring.py
6666
${CMAKE_CURRENT_BINARY_DIR}/../doc/api/xml/
67-
${CMAKE_CURRENT_BINARY_DIR}/docstring)
67+
${CMAKE_CURRENT_BINARY_DIR}/docstring
68+
RESULT_VARIABLE DOCSTRING_RESULT)
69+
if(NOT DOCSTRING_RESULT EQUAL 0)
70+
message(FATAL_ERROR "doxygen2docstring.py failed (exit code ${DOCSTRING_RESULT}) while generating the Python docstring headers.")
71+
endif()
6872

6973
endif()
7074

0 commit comments

Comments
 (0)