Skip to content

Commit 8024301

Browse files
committed
Add CMake workflow presets
clang-format -i *.json use CMAKE_UNITY_BUILD as default prevent clang-tidy as precompile step add ENABLE_DOXYGEN option
1 parent 5549a82 commit 8024301

File tree

7 files changed

+312
-42
lines changed

7 files changed

+312
-42
lines changed

CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,11 @@ endif()
9494
# set the startup project for the "play" button in MSVC
9595
set_property(DIRECTORY PROPERTY VS_STARTUP_PROJECT intro)
9696

97+
if(ENABLE_DOXYGEN)
98+
include(cmake/Doxygen.cmake)
99+
myproject_enable_doxygen("")
100+
endif()
101+
97102
if(CMAKE_SKIP_INSTALL_RULES)
98103
return()
99104
endif()

CMakePresets.json

Lines changed: 124 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
2-
"version": 3,
2+
"version": 6,
33
"cmakeMinimumRequired": {
44
"major": 3,
5-
"minor": 21,
5+
"minor": 25,
66
"patch": 0
77
},
88
"configurePresets": [
@@ -16,7 +16,8 @@
1616
},
1717
{
1818
"name": "conf-windows-common",
19-
"description": "Windows settings for MSBuild toolchain that apply to msvc and clang",
19+
"description":
20+
"Windows settings for MSBuild toolchain that apply to msvc and clang",
2021
"hidden": true,
2122
"inherits": "conf-common",
2223
"condition": {
@@ -62,7 +63,8 @@
6263
{
6364
"name": "windows-msvc-debug-developer-mode",
6465
"displayName": "msvc Debug (Developer Mode)",
65-
"description": "Target Windows with the msvc compiler, debug build type",
66+
"description":
67+
"Target Windows with the msvc compiler, debug build type",
6668
"inherits": "conf-windows-common",
6769
"cacheVariables": {
6870
"CMAKE_C_COMPILER": "cl",
@@ -74,7 +76,8 @@
7476
{
7577
"name": "windows-msvc-release-developer-mode",
7678
"displayName": "msvc Release (Developer Mode)",
77-
"description": "Target Windows with the msvc compiler, release build type",
79+
"description":
80+
"Target Windows with the msvc compiler, release build type",
7881
"inherits": "conf-windows-common",
7982
"cacheVariables": {
8083
"CMAKE_C_COMPILER": "cl",
@@ -86,7 +89,8 @@
8689
{
8790
"name": "windows-msvc-debug-user-mode",
8891
"displayName": "msvc Debug (User Mode)",
89-
"description": "Target Windows with the msvc compiler, debug build type",
92+
"description":
93+
"Target Windows with the msvc compiler, debug build type",
9094
"inherits": "conf-windows-common",
9195
"cacheVariables": {
9296
"CMAKE_C_COMPILER": "cl",
@@ -98,7 +102,8 @@
98102
{
99103
"name": "windows-msvc-release-user-mode",
100104
"displayName": "msvc Release (User Mode)",
101-
"description": "Target Windows with the msvc compiler, release build type",
105+
"description":
106+
"Target Windows with the msvc compiler, release build type",
102107
"inherits": "conf-windows-common",
103108
"cacheVariables": {
104109
"CMAKE_C_COMPILER": "cl",
@@ -110,7 +115,8 @@
110115
{
111116
"name": "windows-clang-debug",
112117
"displayName": "clang Debug",
113-
"description": "Target Windows with the clang compiler, debug build type",
118+
"description":
119+
"Target Windows with the clang compiler, debug build type",
114120
"inherits": "conf-windows-common",
115121
"cacheVariables": {
116122
"CMAKE_C_COMPILER": "clang-cl",
@@ -126,7 +132,8 @@
126132
{
127133
"name": "windows-clang-release",
128134
"displayName": "clang Release",
129-
"description": "Target Windows with the clang compiler, release build type",
135+
"description":
136+
"Target Windows with the clang compiler, release build type",
130137
"inherits": "conf-windows-common",
131138
"cacheVariables": {
132139
"CMAKE_C_COMPILER": "clang-cl",
@@ -140,9 +147,10 @@
140147
}
141148
},
142149
{
143-
"name": "unixlike-gcc-debug",
150+
"name": "gcc-debug",
144151
"displayName": "gcc Debug",
145-
"description": "Target Unix-like OS with the gcc compiler, debug build type",
152+
"description":
153+
"Target Unix-like OS with the gcc compiler, debug build type",
146154
"inherits": "conf-unixlike-common",
147155
"cacheVariables": {
148156
"myproject_ENABLE_COVERAGE": false,
@@ -153,9 +161,10 @@
153161
}
154162
},
155163
{
156-
"name": "unixlike-gcc-release",
164+
"name": "gcc-release",
157165
"displayName": "gcc Release",
158-
"description": "Target Unix-like OS with the gcc compiler, release build type",
166+
"description":
167+
"Target Unix-like OS with the gcc compiler, release build type",
159168
"inherits": "conf-unixlike-common",
160169
"cacheVariables": {
161170
"CMAKE_C_COMPILER": "gcc",
@@ -164,9 +173,10 @@
164173
}
165174
},
166175
{
167-
"name": "unixlike-clang-debug",
176+
"name": "clang-debug",
168177
"displayName": "clang Debug",
169-
"description": "Target Unix-like OS with the clang compiler, debug build type",
178+
"description":
179+
"Target Unix-like OS with the clang compiler, debug build type",
170180
"inherits": "conf-unixlike-common",
171181
"cacheVariables": {
172182
"myproject_ENABLE_COVERAGE": false,
@@ -177,9 +187,10 @@
177187
}
178188
},
179189
{
180-
"name": "unixlike-clang-release",
190+
"name": "clang-release",
181191
"displayName": "clang Release",
182-
"description": "Target Unix-like OS with the clang compiler, release build type",
192+
"description":
193+
"Target Unix-like OS with the clang compiler, release build type",
183194
"inherits": "conf-unixlike-common",
184195
"cacheVariables": {
185196
"CMAKE_C_COMPILER": "clang",
@@ -191,7 +202,8 @@
191202
"testPresets": [
192203
{
193204
"name": "test-common",
194-
"description": "Test CMake settings that apply to all configurations",
205+
"description":
206+
"Test CMake settings that apply to all configurations",
195207
"hidden": true,
196208
"output": {
197209
"outputOnFailure": true
@@ -230,32 +242,118 @@
230242
"configurePreset": "windows-clang-release"
231243
},
232244
{
233-
"name": "test-unixlike-gcc-debug",
245+
"name": "gcc-debug",
234246
"displayName": "Strict",
235247
"description": "Enable output and stop on failure",
236248
"inherits": "test-common",
237-
"configurePreset": "unixlike-gcc-debug"
249+
"configurePreset": "gcc-debug"
238250
},
239251
{
240-
"name": "test-unixlike-gcc-release",
252+
"name": "gcc-release",
241253
"displayName": "Strict",
242254
"description": "Enable output and stop on failure",
243255
"inherits": "test-common",
244-
"configurePreset": "unixlike-gcc-release"
256+
"configurePreset": "gcc-release"
245257
},
246258
{
247-
"name": "test-unixlike-clang-debug",
259+
"name": "clang-debug",
248260
"displayName": "Strict",
249261
"description": "Enable output and stop on failure",
250262
"inherits": "test-common",
251-
"configurePreset": "unixlike-clang-debug"
263+
"configurePreset": "clang-debug"
252264
},
253265
{
254-
"name": "test-unixlike-clang-release",
266+
"name": "clang-release",
255267
"displayName": "Strict",
256268
"description": "Enable output and stop on failure",
257269
"inherits": "test-common",
258-
"configurePreset": "unixlike-clang-release"
270+
"configurePreset": "clang-release"
271+
}
272+
],
273+
"buildPresets": [
274+
{
275+
"name": "clang-release",
276+
"configurePreset": "clang-release"
277+
},
278+
{
279+
"name": "clang-install",
280+
"configurePreset": "clang-release",
281+
"targets": [
282+
"install"
283+
]
284+
},
285+
{
286+
"name": "clang-debug",
287+
"configurePreset": "clang-debug"
288+
},
289+
{
290+
"name": "gcc-release",
291+
"configurePreset": "gcc-release"
292+
},
293+
{
294+
"name": "gcc-install",
295+
"configurePreset": "gcc-release",
296+
"targets": [
297+
"install"
298+
]
299+
},
300+
{
301+
"name": "gcc-debug",
302+
"configurePreset": "gcc-debug"
303+
}
304+
],
305+
"packagePresets": [
306+
{
307+
"name": "clang-release",
308+
"configurePreset": "clang-release",
309+
"generators": [
310+
"TGZ"
311+
]
312+
},
313+
{
314+
"name": "gcc-release",
315+
"configurePreset": "gcc-release",
316+
"generators": [
317+
"TGZ"
318+
]
319+
}
320+
],
321+
"workflowPresets": [
322+
{
323+
"description": "Developer workflow without installation",
324+
"name": "clang-debug",
325+
"steps": [
326+
{
327+
"type": "configure",
328+
"name": "clang-debug"
329+
},
330+
{
331+
"type": "build",
332+
"name": "clang-debug"
333+
},
334+
{
335+
"type": "test",
336+
"name": "clang-debug"
337+
}
338+
]
339+
},
340+
{
341+
"description": "Release workflow without test",
342+
"name": "clang-release",
343+
"steps": [
344+
{
345+
"name": "clang-release",
346+
"type": "configure"
347+
},
348+
{
349+
"name": "clang-release",
350+
"type": "build"
351+
},
352+
{
353+
"name": "clang-release",
354+
"type": "package"
355+
}
356+
]
259357
}
260358
]
261359
}

0 commit comments

Comments
 (0)