Skip to content

Commit aaa4c69

Browse files
committed
Fixing doxygen builds on Windows
Fixed a quoting issue with doxygen builds on Windows. Updated doxygen-awesome-css to 2.4.1 Changed recommendation on setting CPM_SOURCE_CACHE to only apply if the project is top-level.
1 parent efbdc4f commit aaa4c69

File tree

3 files changed

+24
-18
lines changed

3 files changed

+24
-18
lines changed

README.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,10 @@ cmake_minimum_required(VERSION 3.20)
2828
# Project declaration - cpp_library_setup will use this name and detect version from git tags
2929
project(your-library)
3030
31-
set(CPM_SOURCE_CACHE ${CMAKE_SOURCE_DIR}/.cache/cpm CACHE PATH "CPM cache")
31+
# Setup cpp-library infrastructure
32+
if(PROJECT_IS_TOP_LEVEL)
33+
set(CPM_SOURCE_CACHE ${CMAKE_SOURCE_DIR}/.cache/cpm CACHE PATH "CPM cache")
34+
endif()
3235
include(cmake/CPM.cmake)
3336
3437
# Fetch cpp-library via CPM
@@ -173,7 +176,7 @@ cpp_library_setup(
173176
### Documentation Features
174177

175178
- **Doxygen integration** with modern configuration
176-
- **[email protected].0** theme for beautiful output
179+
- **[email protected].1** theme for beautiful output
177180
- **Symbol exclusion** support for implementation details
178181
- **GitHub Pages deployment** via CI
179182
- **Custom Doxyfile support** (falls back to template)
@@ -224,7 +227,9 @@ cmake_minimum_required(VERSION 3.20)
224227
project(enum-ops)
225228
226229
# Setup cpp-library infrastructure
227-
set(CPM_SOURCE_CACHE ${CMAKE_SOURCE_DIR}/.cache/cpm CACHE PATH "CPM cache" FORCE)
230+
if(PROJECT_IS_TOP_LEVEL)
231+
set(CPM_SOURCE_CACHE ${CMAKE_SOURCE_DIR}/.cache/cpm CACHE PATH "CPM cache")
232+
endif()
228233
include(cmake/CPM.cmake)
229234
230235
# Fetch cpp-library via CPM

cmake/cpp-library-docs.cmake

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -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+
8586
endfunction()

templates/custom.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
/*
2-
No fixes needed for [email protected].0
2+
No fixes needed for [email protected].1
33
*/

0 commit comments

Comments
 (0)