Skip to content

Commit 7bf4c3e

Browse files
committed
Add cmake workflow preset
1 parent dc67259 commit 7bf4c3e

File tree

3 files changed

+85
-5
lines changed

3 files changed

+85
-5
lines changed

.clang-format

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
11
---
2+
BasedOnStyle: Google
3+
ConstructorInitializerIndentWidth: 2
4+
ContinuationIndentWidth: 2
5+
IndentWidth: 2
6+
TabWidth: 2
7+
UseTab: Never
8+
---
29
Language: Cpp
310
Standard: c++17
411
UseTab: Never

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@ if(MYLIB_INSTALL AND NOT CMAKE_SKIP_INSTALL_RULES)
160160
OPTIONAL
161161
)
162162
endif()
163+
include(CPack)
163164
endif()
164165

165166
#----------------------------------------------------------------------------------------------------------------------

CMakePresets.json

Lines changed: 77 additions & 5 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": 14,
5+
"minor": 25,
66
"patch": 0
77
},
88
"configurePresets": [
@@ -24,19 +24,91 @@
2424
"name": "dev-win",
2525
"description": "Windows preset for library developers",
2626
"hidden": false,
27-
"inherits": ["dev"],
27+
"inherits": [
28+
"dev"
29+
],
2830
"cacheVariables": {
2931
"CMAKE_CXX_FLAGS": "/W4 /EHsc /w14242 /w14254 /w14263 /w14265 /w14287 /w14289 /w14296 /w14311 /w14545 /w14546 /w14547 /w14549 /w14555 /w14640 /w14826 /w14928 /WX"
32+
},
33+
"condition": {
34+
"type": "equals",
35+
"lhs": "${hostSystemName}",
36+
"rhs": "Windows"
3037
}
3138
},
3239
{
33-
"name": "dev-linux",
40+
"name": "Release",
3441
"description": "Linux preset for library developers",
3542
"hidden": false,
36-
"inherits": ["dev"],
43+
"inherits": [
44+
"dev"
45+
],
3746
"cacheVariables": {
3847
"CMAKE_CXX_FLAGS": "-Wall -Wextra -Wpedantic -Wshadow -Wconversion -Wsign-conversion -Wcast-align -Wcast-qual -Wnull-dereference -Woverloaded-virtual -Wformat=2 -Werror"
48+
},
49+
"condition": {
50+
"type": "notEquals",
51+
"lhs": "${hostSystemName}",
52+
"rhs": "Windows"
3953
}
4054
}
55+
],
56+
"buildPresets": [
57+
{
58+
"name": "Release",
59+
"configurePreset": "Release"
60+
},
61+
{
62+
"name": "install",
63+
"configurePreset": "Release",
64+
"targets": [
65+
"install"
66+
]
67+
}
68+
],
69+
"testPresets": [
70+
{
71+
"name": "Release",
72+
"configurePreset": "Release",
73+
"output": {
74+
"outputOnFailure": true
75+
},
76+
"execution": {
77+
"noTestsAction": "error",
78+
"stopOnFailure": true
79+
}
80+
}
81+
],
82+
"packagePresets": [
83+
{
84+
"name": "Release",
85+
"configurePreset": "Release",
86+
"generators": [
87+
"TGZ"
88+
]
89+
}
90+
],
91+
"workflowPresets": [
92+
{
93+
"name": "Release",
94+
"steps": [
95+
{
96+
"type": "configure",
97+
"name": "Release"
98+
},
99+
{
100+
"type": "build",
101+
"name": "Release"
102+
},
103+
{
104+
"type": "test",
105+
"name": "Release"
106+
},
107+
{
108+
"type": "package",
109+
"name": "Release"
110+
}
111+
]
112+
}
41113
]
42114
}

0 commit comments

Comments
 (0)