File tree Expand file tree Collapse file tree 3 files changed +35
-47
lines changed Expand file tree Collapse file tree 3 files changed +35
-47
lines changed Original file line number Diff line number Diff line change @@ -60,7 +60,10 @@ 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 (error_docs include /error/error.hpp )
65
+
66
+ add_custom_target (docs )
67
+ add_dependencies (docs error_docs )
65
68
endif ()
66
69
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