@@ -11,28 +11,29 @@ function(_cpp_library_setup_docs)
1111 set (multiValueArgs
1212 DOCS_EXCLUDE_SYMBOLS
1313 )
14-
14+
1515 cmake_parse_arguments (ARG "" "${oneValueArgs} " "${multiValueArgs} " ${ARGN} )
16-
16+
1717 find_package (Doxygen REQUIRED)
1818 if (NOT DOXYGEN_FOUND)
1919 message (WARNING "Doxygen not found. Documentation will not be built." )
2020 return ()
2121 endif ()
22-
22+
2323 # Download doxygen-awesome-css theme via CPM
24+ # https://github.com/jothepro/doxygen-awesome-css
2425 CPMAddPackage(
25- URI gh:jothepro/
[email protected] .
0 26+ URI gh:jothepro/
[email protected] .
1 2627 DOWNLOAD_ONLY YES
2728 )
28-
29+
2930 # Set the CSS directory path
3031 set (AWESOME_CSS_DIR ${doxygen-awesome-css_SOURCE_DIR})
31-
32+
3233 # Configure Doxyfile from template
3334 set (DOXYFILE_IN ${CPP_LIBRARY_ROOT} /templates/Doxyfile.in)
3435 set (DOXYFILE_OUT ${CMAKE_CURRENT_BINARY_DIR} /Doxyfile)
35-
36+
3637 # Set variables for Doxyfile template
3738 set (PROJECT_NAME "${ARG_NAME} " )
3839 set (PROJECT_BRIEF "${ARG_DESCRIPTION} " )
@@ -41,27 +42,27 @@ function(_cpp_library_setup_docs)
4142 set (OUTPUT_DIR "${CMAKE_CURRENT_BINARY_DIR} " )
4243 set (AWESOME_CSS_PATH "${AWESOME_CSS_DIR} " )
4344 set (EXAMPLES_PATH "${CMAKE_CURRENT_SOURCE_DIR} /examples" )
44-
45+
4546 # Convert exclude symbols list to space-separated string
4647 if (ARG_DOCS_EXCLUDE_SYMBOLS)
4748 string (REPLACE ";" " " EXCLUDE_SYMBOLS_STR "${ARG_DOCS_EXCLUDE_SYMBOLS} " )
4849 set (EXCLUDE_SYMBOLS "${EXCLUDE_SYMBOLS_STR} " )
4950 else ()
5051 set (EXCLUDE_SYMBOLS "" )
5152 endif ()
52-
53+
5354 # Check if we have a custom Doxyfile, otherwise use template
5455 if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR} /docs/Doxyfile" )
5556 configure_file ("${CMAKE_CURRENT_SOURCE_DIR} /docs/Doxyfile" ${DOXYFILE_OUT} @ONLY)
5657 else ()
5758 configure_file (${DOXYFILE_IN} ${DOXYFILE_OUT} @ONLY)
5859 endif ()
59-
60+
6061 # Add custom target for documentation with proper stderr capture
6162 if (WIN32 )
6263 # On Windows, use PowerShell to redirect stderr to stdout
6364 add_custom_target (docs
64- COMMAND PowerShell -Command "& { ${DOXYGEN_EXECUTABLE} ${DOXYFILE_OUT} 2>&1 } "
65+ COMMAND PowerShell -Command "& ' ${DOXYGEN_EXECUTABLE} ' ' ${DOXYFILE_OUT} ' 2>&1"
6566 WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
6667 COMMENT "Generating API documentation with Doxygen"
6768 VERBATIM
@@ -75,11 +76,11 @@ function(_cpp_library_setup_docs)
7576 VERBATIM
7677 )
7778 endif ()
78-
79+
7980 # Ensure the output directory exists
8081 file (MAKE_DIRECTORY ${OUTPUT_DIR} )
81-
82+
8283 message (STATUS "Documentation target 'docs' configured" )
8384 message (STATUS "Run 'cmake --build . --target docs' to generate documentation" )
84-
85+
8586endfunction ()
0 commit comments