File tree Expand file tree Collapse file tree 4 files changed +36
-49
lines changed Expand file tree Collapse file tree 4 files changed +36
-49
lines changed Original file line number Diff line number Diff line change @@ -105,9 +105,11 @@ jobs:
105
105
- name : Checkout repository
106
106
uses : actions/checkout@v3.5.3
107
107
108
- - name : Configure and build documentation
108
+ - name : Configure project
109
109
uses : threeal/cmake-action@v1.2.0
110
110
with :
111
111
source-dir : ${{ matrix.package }}
112
112
options : BUILD_DOCS=ON
113
- run-build : true
113
+
114
+ - name : Build documentation
115
+ run : cmake --build ${{ matrix.package }}/build --target docs
Original file line number Diff line number Diff line change @@ -60,7 +60,7 @@ if(CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
60
60
61
61
# Build XML documentation
62
62
if (BUILD_DOCS )
63
- include (cmake/target_generate_xml_docs .cmake )
64
- target_generate_xml_docs ( error )
63
+ include (cmake/add_xml_docs .cmake )
64
+ add_xml_docs ( docs include / error/error.hpp )
65
65
endif ()
66
66
endif ()
Original file line number Diff line number Diff line change
1
+ # A function that generates XML documentation from the specified source files.
2
+ function (add_xml_docs TARGET_NAME )
3
+ # Try to install Doxygen if not found
4
+ find_program (DOXYGEN_PROGRAM doxygen )
5
+ if (NOT DOXYGEN_PROGRAM )
6
+ find_program (APT_GET_PROGRAM apt-get )
7
+ if (APT_GET_PROGRAM )
8
+ message (STATUS "Doxygen could not be found, installing..." )
9
+ execute_process (COMMAND ${APT_GET_PROGRAM} install -y doxygen )
10
+ endif ()
11
+
12
+ find_program (BREW_PROGRAM brew )
13
+ if (BREW_PROGRAM )
14
+ message (STATUS "Doxygen could not be found, installing..." )
15
+ execute_process (COMMAND ${BREW_PROGRAM} install doxygen )
16
+ endif ()
17
+ endif ()
18
+
19
+ # Try to find Doxygen
20
+ find_package (Doxygen )
21
+ if (DOXYGEN_FOUND )
22
+ # Configure Doxygen to generate XML documentation
23
+ set (DOXYGEN_GENERATE_HTML NO )
24
+ set (DOXYGEN_GENERATE_XML YES )
25
+ set (DOXYGEN_XML_OUTPUT ${TARGET_NAME} )
26
+
27
+ # Generate XML documentation for the target
28
+ doxygen_add_docs (${TARGET_NAME} ${ARGN} USE_STAMP_FILE )
29
+ endif ()
30
+ endfunction ()
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments