Skip to content

Commit 3ebc75d

Browse files
committed
Update to use /examples directory instead of /example
- Changed cpp-library.cmake to look for examples/*.cpp instead of example/*.cpp - Updated Doxyfile template to use EXAMPLES_PATH instead of EXAMPLE_PATH - Updated docs module to set EXAMPLES_PATH variable correctly - Maintains consistency with modern project conventions
1 parent ae6e2bb commit 3ebc75d

File tree

4 files changed

+6
-8
lines changed

4 files changed

+6
-8
lines changed

cmake/cpp-library-ci.cmake

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ function(_cpp_library_setup_ci)
77
NAME
88
VERSION
99
DESCRIPTION
10-
CI_DEPLOY_DOCS # Always YES, but kept as parameter for template substitution
1110
)
1211

1312
cmake_parse_arguments(ARG "" "${oneValueArgs}" "" ${ARGN})

cmake/cpp-library-docs.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ function(_cpp_library_setup_docs)
4242
set(INPUT_DIR "${CMAKE_CURRENT_SOURCE_DIR}/include")
4343
set(OUTPUT_DIR "${CMAKE_CURRENT_BINARY_DIR}")
4444
set(AWESOME_CSS_PATH "${AWESOME_CSS_DIR}")
45-
set(EXAMPLE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/example")
45+
set(EXAMPLES_PATH "${CMAKE_CURRENT_SOURCE_DIR}/examples")
4646

4747
# Convert exclude symbols list to space-separated string
4848
if(ARG_DOCS_EXCLUDE_SYMBOLS)

cpp-library.cmake

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -113,21 +113,20 @@ function(cpp_library_setup)
113113
NAME "${ARG_NAME}"
114114
VERSION "${ARG_VERSION}"
115115
DESCRIPTION "${ARG_DESCRIPTION}"
116-
CI_DEPLOY_DOCS YES # Always enable docs deployment
117116
)
118117
endif()
119118

120119
# Build examples if specified
121120
if(ARG_EXAMPLES)
122121
foreach(example IN LISTS ARG_EXAMPLES)
123-
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/example/${example}.cpp")
122+
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/examples/${example}.cpp")
124123
string(REPLACE "${ARG_NAMESPACE}-" "" CLEAN_NAME "${ARG_NAME}")
125124

126125
# Check if this is a compile-fail test (has "_fail" in the name)
127126
string(FIND "${example}" "_fail" fail_pos)
128127
if(fail_pos GREATER -1)
129128
# Negative compile test: this example must fail to compile
130-
add_executable(${example} EXCLUDE_FROM_ALL "example/${example}.cpp")
129+
add_executable(${example} EXCLUDE_FROM_ALL "examples/${example}.cpp")
131130
target_link_libraries(${example} PRIVATE ${ARG_NAMESPACE}::${CLEAN_NAME})
132131
add_test(
133132
NAME compile_${example}
@@ -137,12 +136,12 @@ function(cpp_library_setup)
137136
set_tests_properties(compile_${example} PROPERTIES WILL_FAIL TRUE)
138137
else()
139138
# Regular example
140-
add_executable(${example} "example/${example}.cpp")
139+
add_executable(${example} "examples/${example}.cpp")
141140
target_link_libraries(${example} PRIVATE ${ARG_NAMESPACE}::${CLEAN_NAME})
142141
add_test(NAME ${example} COMMAND ${example})
143142
endif()
144143
else()
145-
message(WARNING "Example file example/${example}.cpp not found")
144+
message(WARNING "Example file examples/${example}.cpp not found")
146145
endif()
147146
endforeach()
148147
endif()

templates/Doxyfile.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ WARN_IF_UNDOCUMENTED = YES
88
INPUT = @INPUT_DIR@
99
RECURSIVE = YES
1010
EXCLUDE_SYMBOLS = @EXCLUDE_SYMBOLS@
11-
EXAMPLE_PATH = @EXAMPLE_PATH@
11+
EXAMPLE_PATH = @EXAMPLES_PATH@
1212
HTML_EXTRA_STYLESHEET = @AWESOME_CSS_PATH@/doxygen-awesome.css \
1313
@AWESOME_CSS_PATH@/doxygen-awesome-sidebar-only.css \
1414
@AWESOME_CSS_PATH@/doxygen-awesome-sidebar-only-darkmode-toggle.css

0 commit comments

Comments
 (0)