Skip to content

Commit fa53f42

Browse files
committed
Update dependencies and enhance CI configuration
- Updated doctest dependency version from 2.4.12 to 2.5.2 in cpp-library.cmake. - Improved README.md with additional setup instructions for CPM.cmake and local usage examples. - Refined CI workflow configuration in ci.yml and ci.yml.in to utilize defined action variables for better maintainability. - Updated Doxygen theme dependency version from 2.4.1 to 2.4.2 in cpp-library-docs.cmake. - Added new graph options in Doxyfile.in to control documentation output.
1 parent 0e6c594 commit fa53f42

7 files changed

Lines changed: 62 additions & 13 deletions

File tree

.github/workflows/ci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ jobs:
1414
runs-on: ubuntu-latest
1515

1616
steps:
17+
# [DEPENDENCY] https://github.com/actions/checkout/releases
1718
- uses: actions/checkout@v6
1819

1920
- name: Run dependency mapping tests
@@ -27,6 +28,7 @@ jobs:
2728
runs-on: ubuntu-latest
2829

2930
steps:
31+
# [DEPENDENCY] https://github.com/actions/checkout/releases
3032
- uses: actions/checkout@v6
3133

3234
- name: Download CPM.cmake
@@ -136,6 +138,7 @@ jobs:
136138
runs-on: ubuntu-latest
137139

138140
steps:
141+
# [DEPENDENCY] https://github.com/actions/checkout/releases
139142
- uses: actions/checkout@v6
140143

141144
- name: Check README examples

README.md

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,17 @@ cmake --build --preset=init
9292

9393
## Manual Setup
9494

95-
If you prefer to set up your project manually, or need to integrate cpp-library into an existing project, follow these steps.
95+
If you prefer to set up your project manually or need to integrate the cpp-library into an existing project, follow these steps.
9696

9797
### Usage
9898

99+
Install [CPM.cmake](https://github.com/cpm-cmake/CPM.cmake):
100+
101+
```bash
102+
mkdir -p cmake
103+
curl -L -o cmake/CPM.cmake "https://github.com/cpm-cmake/CPM.cmake/releases/latest/download/get_cpm.cmake"
104+
```
105+
99106
Use `CPMAddPackage` to fetch cpp-library directly in your `CMakeLists.txt`:
100107

101108
```cmake
@@ -130,8 +137,6 @@ cpp_library_setup(
130137
)
131138
```
132139

133-
**Requirements:** CMake 3.24+, C++17+ compiler (GCC 7+, Clang 5+, MSVC 2017+, or Apple Clang 9+)
134-
135140
### Consuming Libraries Built with cpp-library
136141

137142
#### Using CPMAddPackage (recommended)
@@ -525,6 +530,20 @@ The dependency provider (CMake 3.24+) tracks `find_package()` and `CPMAddPackage
525530

526531
## Development
527532

533+
To use a local copy of cpp-library:
534+
535+
```
536+
CPMAddPackage(
537+
NAME cpp-library
538+
SOURCE_DIR "${CMAKE_SOURCE_DIR}/../cpp-library"
539+
)
540+
```
541+
542+
To use cpp-library from a specific commit:
543+
```
544+
CPMAddPackage("gh:stlab/cpp-library#65dbed9fff9a0331355bd51dc1e8156262390154")
545+
```
546+
528547
To run cpp-library's unit tests for dependency mapping and installation:
529548

530549
```bash

cmake/cpp-library-ci.cmake

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,22 @@
99
# - Postcondition: .github/workflows/ci.yml created from template if not present
1010
# - With force_init: overwrites existing workflow file
1111
function(_cpp_library_setup_ci PACKAGE_NAME force_init)
12+
# GitHub Actions refs (versions and source links) - update here to bump CI deps
13+
# [DEPENDENCY] https://github.com/actions/checkout/releases
14+
set(CI_ACTION_CHECKOUT "actions/checkout@v6")
15+
# [DEPENDENCY] https://github.com/ilammy/msvc-dev-cmd/releases
16+
# @1.13.0
17+
set(CI_ACTION_MSVC_DEV_CMD "ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756")
18+
# [DEPENDENCY] https://github.com/ssciwr/doxygen-install/releases
19+
# @2.0.1
20+
set(CI_ACTION_DOXYGEN_INSTALL "ssciwr/doxygen-install@329d88f5a303066a5bd006db7516b1925b86350e")
21+
# [DEPENDENCY] https://github.com/actions/configure-pages/releases
22+
set(CI_ACTION_CONFIGURE_PAGES "actions/configure-pages@v6")
23+
# [DEPENDENCY] https://github.com/actions/upload-pages-artifact/releases
24+
set(CI_ACTION_UPLOAD_PAGES_ARTIFACT "actions/upload-pages-artifact@v5")
25+
# [DEPENDENCY] https://github.com/actions/deploy-pages/releases
26+
set(CI_ACTION_DEPLOY_PAGES "actions/deploy-pages@v5")
27+
1228
set(ci_template "${CPP_LIBRARY_ROOT}/templates/.github/workflows/ci.yml.in")
1329
set(ci_dest "${CMAKE_CURRENT_SOURCE_DIR}/.github/workflows/ci.yml")
1430

cmake/cpp-library-docs.cmake

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ function(_cpp_library_setup_docs)
2626
# Download doxygen-awesome-css theme via CPM
2727
# https://github.com/jothepro/doxygen-awesome-css
2828
CPMAddPackage(
29-
URI gh:jothepro/doxygen-awesome-css@2.4.1
29+
# [DEPENDENCY] https://github.com/jothepro/doxygen-awesome-css/releases
30+
URI gh:jothepro/doxygen-awesome-css@2.4.2
3031
DOWNLOAD_ONLY YES
3132
)
3233

cpp-library.cmake

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,8 @@ function(cpp_library_setup)
289289
# This must happen during normal configuration (not deferred) because CPMAddPackage uses add_subdirectory
290290
if(BUILD_TESTING AND (ARG_TESTS OR ARG_EXAMPLES))
291291
if(NOT TARGET doctest::doctest)
292-
CPMAddPackage("gh:doctest/doctest@2.4.12")
292+
# [DEPENDENCY] https://github.com/doctest/doctest/releases
293+
CPMAddPackage("gh:doctest/doctest@2.5.2")
293294
endif()
294295
endif()
295296

templates/.github/workflows/ci.yml.in

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Auto-generated from cpp-library (https://github.com/stlab/cpp-library)
22
# Do not edit this file directly - it will be overwritten when templates are regenerated
3+
# Dependency versions are defined in cmake/cpp-library-ci.cmake (with source links)
34

45
name: CI
56

@@ -34,7 +35,9 @@ jobs:
3435
runs-on: ${{ matrix.os }}
3536

3637
steps:
37-
- uses: actions/checkout@v6
38+
- uses: @CI_ACTION_CHECKOUT@
39+
- if: ${{ startsWith(matrix.config.os, 'windows') }}
40+
uses: @CI_ACTION_MSVC_DEV_CMD@
3841

3942
- name: Configure CMake
4043
run: cmake --preset=test
@@ -97,7 +100,7 @@ jobs:
97100
runs-on: ubuntu-latest
98101

99102
steps:
100-
- uses: actions/checkout@v6
103+
- uses: @CI_ACTION_CHECKOUT@
101104

102105
- name: Configure CMake with clang-tidy
103106
run: cmake --preset=clang-tidy
@@ -117,11 +120,10 @@ jobs:
117120
contents: read
118121

119122
steps:
120-
- uses: actions/checkout@v6
123+
- uses: @CI_ACTION_CHECKOUT@
121124

122-
# ssciwr/doxygen-install@1.6.4
123125
- name: Install Doxygen
124-
uses: ssciwr/doxygen-install@501e53b879da7648ab392ee226f5b90e42148449
126+
uses: @CI_ACTION_DOXYGEN_INSTALL@
125127

126128
- name: Configure CMake
127129
run: cmake --preset=docs
@@ -130,13 +132,13 @@ jobs:
130132
run: cmake --build --preset=docs
131133

132134
- name: Setup Pages
133-
uses: actions/configure-pages@v5
135+
uses: @CI_ACTION_CONFIGURE_PAGES@
134136

135137
- name: Upload artifact
136-
uses: actions/upload-pages-artifact@v4
138+
uses: @CI_ACTION_UPLOAD_PAGES_ARTIFACT@
137139
with:
138140
path: build/docs/html
139141

140142
- name: Deploy to GitHub Pages
141143
id: deployment
142-
uses: actions/deploy-pages@v4
144+
uses: @CI_ACTION_DEPLOY_PAGES@

templates/Doxyfile.in

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,10 @@ DISTRIBUTE_GROUP_DOC = YES
2525
MAX_INITIALIZER_LINES = 0
2626
MULTILINE_CPP_IS_BRIEF = YES
2727
WARN_AS_ERROR = YES
28+
INCLUDE_GRAPH = NO
29+
INCLUDED_BY_GRAPH = NO
30+
DIRECTORY_GRAPH = NO
31+
CLASS_GRAPH = NO
32+
COLLABORATION_GRAPH = NO
33+
GRAPHICAL_HIERARCHY = NO
34+
GROUP_GRAPHS = NO

0 commit comments

Comments
 (0)