Skip to content

Commit 0508115

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 c48af0a commit 0508115

File tree

5 files changed

+310
-38
lines changed

5 files changed

+310
-38
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": [
@@ -28,7 +28,8 @@
2828
},
2929
{
3030
"name": "conf-windows-common",
31-
"description": "Windows settings for MSBuild toolchain that apply to msvc and clang",
31+
"description":
32+
"Windows settings for MSBuild toolchain that apply to msvc and clang",
3233
"hidden": true,
3334
"inherits": "conf-common",
3435
"condition": {
@@ -74,7 +75,8 @@
7475
{
7576
"name": "windows-msvc-debug-developer-mode",
7677
"displayName": "msvc Debug (Developer Mode)",
77-
"description": "Target Windows with the msvc compiler, debug build type",
78+
"description":
79+
"Target Windows with the msvc compiler, debug build type",
7880
"inherits": "conf-windows-common",
7981
"cacheVariables": {
8082
"CMAKE_C_COMPILER": "cl",
@@ -86,7 +88,8 @@
8688
{
8789
"name": "windows-msvc-release-developer-mode",
8890
"displayName": "msvc Release (Developer Mode)",
89-
"description": "Target Windows with the msvc compiler, release build type",
91+
"description":
92+
"Target Windows with the msvc compiler, release build type",
9093
"inherits": "conf-windows-common",
9194
"cacheVariables": {
9295
"CMAKE_C_COMPILER": "cl",
@@ -98,7 +101,8 @@
98101
{
99102
"name": "windows-msvc-debug-user-mode",
100103
"displayName": "msvc Debug (User Mode)",
101-
"description": "Target Windows with the msvc compiler, debug build type",
104+
"description":
105+
"Target Windows with the msvc compiler, debug build type",
102106
"inherits": "conf-windows-common",
103107
"cacheVariables": {
104108
"CMAKE_C_COMPILER": "cl",
@@ -110,7 +114,8 @@
110114
{
111115
"name": "windows-msvc-release-user-mode",
112116
"displayName": "msvc Release (User Mode)",
113-
"description": "Target Windows with the msvc compiler, release build type",
117+
"description":
118+
"Target Windows with the msvc compiler, release build type",
114119
"inherits": "conf-windows-common",
115120
"cacheVariables": {
116121
"CMAKE_C_COMPILER": "cl",
@@ -122,7 +127,8 @@
122127
{
123128
"name": "windows-clang-debug",
124129
"displayName": "clang Debug",
125-
"description": "Target Windows with the clang compiler, debug build type",
130+
"description":
131+
"Target Windows with the clang compiler, debug build type",
126132
"inherits": "conf-windows-common",
127133
"cacheVariables": {
128134
"CMAKE_C_COMPILER": "clang-cl",
@@ -138,7 +144,8 @@
138144
{
139145
"name": "windows-clang-release",
140146
"displayName": "clang Release",
141-
"description": "Target Windows with the clang compiler, release build type",
147+
"description":
148+
"Target Windows with the clang compiler, release build type",
142149
"inherits": "conf-windows-common",
143150
"cacheVariables": {
144151
"CMAKE_C_COMPILER": "clang-cl",
@@ -152,9 +159,10 @@
152159
}
153160
},
154161
{
155-
"name": "unixlike-gcc-debug",
162+
"name": "gcc-debug",
156163
"displayName": "gcc Debug",
157-
"description": "Target Unix-like OS with the gcc compiler, debug build type",
164+
"description":
165+
"Target Unix-like OS with the gcc compiler, debug build type",
158166
"inherits": "conf-unixlike-common",
159167
"cacheVariables": {
160168
"myproject_ENABLE_COVERAGE": false,
@@ -165,9 +173,10 @@
165173
}
166174
},
167175
{
168-
"name": "unixlike-gcc-release",
176+
"name": "gcc-release",
169177
"displayName": "gcc Release",
170-
"description": "Target Unix-like OS with the gcc compiler, release build type",
178+
"description":
179+
"Target Unix-like OS with the gcc compiler, release build type",
171180
"inherits": "conf-unixlike-common",
172181
"cacheVariables": {
173182
"CMAKE_C_COMPILER": "gcc",
@@ -176,9 +185,10 @@
176185
}
177186
},
178187
{
179-
"name": "unixlike-clang-debug",
188+
"name": "clang-debug",
180189
"displayName": "clang Debug",
181-
"description": "Target Unix-like OS with the clang compiler, debug build type",
190+
"description":
191+
"Target Unix-like OS with the clang compiler, debug build type",
182192
"inherits": "conf-unixlike-common",
183193
"cacheVariables": {
184194
"myproject_ENABLE_COVERAGE": false,
@@ -189,9 +199,10 @@
189199
}
190200
},
191201
{
192-
"name": "unixlike-clang-release",
202+
"name": "clang-release",
193203
"displayName": "clang Release",
194-
"description": "Target Unix-like OS with the clang compiler, release build type",
204+
"description":
205+
"Target Unix-like OS with the clang compiler, release build type",
195206
"inherits": "conf-unixlike-common",
196207
"cacheVariables": {
197208
"CMAKE_C_COMPILER": "clang",
@@ -251,7 +262,8 @@
251262
"testPresets": [
252263
{
253264
"name": "test-common",
254-
"description": "Test CMake settings that apply to all configurations",
265+
"description":
266+
"Test CMake settings that apply to all configurations",
255267
"hidden": true,
256268
"output": {
257269
"outputOnFailure": true
@@ -290,32 +302,118 @@
290302
"configurePreset": "windows-clang-release"
291303
},
292304
{
293-
"name": "test-unixlike-gcc-debug",
305+
"name": "gcc-debug",
294306
"displayName": "Strict",
295307
"description": "Enable output and stop on failure",
296308
"inherits": "test-common",
297-
"configurePreset": "unixlike-gcc-debug"
309+
"configurePreset": "gcc-debug"
298310
},
299311
{
300-
"name": "test-unixlike-gcc-release",
312+
"name": "gcc-release",
301313
"displayName": "Strict",
302314
"description": "Enable output and stop on failure",
303315
"inherits": "test-common",
304-
"configurePreset": "unixlike-gcc-release"
316+
"configurePreset": "gcc-release"
305317
},
306318
{
307-
"name": "test-unixlike-clang-debug",
319+
"name": "clang-debug",
308320
"displayName": "Strict",
309321
"description": "Enable output and stop on failure",
310322
"inherits": "test-common",
311-
"configurePreset": "unixlike-clang-debug"
323+
"configurePreset": "clang-debug"
312324
},
313325
{
314-
"name": "test-unixlike-clang-release",
326+
"name": "clang-release",
315327
"displayName": "Strict",
316328
"description": "Enable output and stop on failure",
317329
"inherits": "test-common",
318-
"configurePreset": "unixlike-clang-release"
330+
"configurePreset": "clang-release"
331+
}
332+
],
333+
"buildPresets": [
334+
{
335+
"name": "clang-release",
336+
"configurePreset": "clang-release"
337+
},
338+
{
339+
"name": "clang-install",
340+
"configurePreset": "clang-release",
341+
"targets": [
342+
"install"
343+
]
344+
},
345+
{
346+
"name": "clang-debug",
347+
"configurePreset": "clang-debug"
348+
},
349+
{
350+
"name": "gcc-release",
351+
"configurePreset": "gcc-release"
352+
},
353+
{
354+
"name": "gcc-install",
355+
"configurePreset": "gcc-release",
356+
"targets": [
357+
"install"
358+
]
359+
},
360+
{
361+
"name": "gcc-debug",
362+
"configurePreset": "gcc-debug"
363+
}
364+
],
365+
"packagePresets": [
366+
{
367+
"name": "clang-release",
368+
"configurePreset": "clang-release",
369+
"generators": [
370+
"TGZ"
371+
]
372+
},
373+
{
374+
"name": "gcc-release",
375+
"configurePreset": "gcc-release",
376+
"generators": [
377+
"TGZ"
378+
]
379+
}
380+
],
381+
"workflowPresets": [
382+
{
383+
"description": "Developer workflow without installation",
384+
"name": "clang-debug",
385+
"steps": [
386+
{
387+
"type": "configure",
388+
"name": "clang-debug"
389+
},
390+
{
391+
"type": "build",
392+
"name": "clang-debug"
393+
},
394+
{
395+
"type": "test",
396+
"name": "clang-debug"
397+
}
398+
]
399+
},
400+
{
401+
"description": "Release workflow without test",
402+
"name": "clang-release",
403+
"steps": [
404+
{
405+
"name": "clang-release",
406+
"type": "configure"
407+
},
408+
{
409+
"name": "clang-release",
410+
"type": "build"
411+
},
412+
{
413+
"name": "clang-release",
414+
"type": "package"
415+
}
416+
]
319417
}
320418
]
321419
}

0 commit comments

Comments
 (0)