Skip to content

Commit 056d687

Browse files
committed
Add Windows preset too
1 parent 37e9818 commit 056d687

File tree

3 files changed

+49
-0
lines changed

3 files changed

+49
-0
lines changed

CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,5 @@ install(
4949
${CMAKE_CURRENT_BINARY_DIR}/${TARGET_PACKAGE_NAME}-version.cmake
5050
DESTINATION ${INSTALL_CONFIGDIR}
5151
)
52+
53+
include(CPack)

CMakePresets.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,18 @@
5050
"configurePreset": "release"
5151
}
5252
],
53+
"packagePresets": [
54+
{
55+
"name": "release",
56+
"configurePreset": "release",
57+
"configurations": [
58+
"Release"
59+
],
60+
"generators": [
61+
"TGZ"
62+
]
63+
}
64+
],
5365
"workflowPresets": [
5466
{
5567
"name": "debug",
@@ -82,6 +94,10 @@
8294
{
8395
"type": "test",
8496
"name": "release"
97+
},
98+
{
99+
"type": "package",
100+
"name": "release"
85101
}
86102
]
87103
}

cmake/CMakeWindowsPresets.json

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
"version": 9,
3+
"include": [
4+
"CMakeGenericPresets.json"
5+
],
6+
"configurePresets": [
7+
{
8+
"name": "release",
9+
"description": "Windows preset for library developers",
10+
"generator": "Visual Studio 17 2022",
11+
"inherits": [
12+
"root-config"
13+
],
14+
"cacheVariables": {
15+
"CMAKE_CXX_FLAGS": "/W4 /EHsc /w14242 /w14254 /w14263 /w14265 /w14287 /w14289 /w14296 /w14311 /w14545 /w14546 /w14547 /w14549 /w14555 /w14640 /w14826 /w14928 /WX"
16+
},
17+
"condition": {
18+
"type": "equals",
19+
"lhs": "${hostSystemName}",
20+
"rhs": "Windows"
21+
}
22+
},
23+
{
24+
"name": "debug",
25+
"description": "Windows preset for library developers",
26+
"inherits": [
27+
"release"
28+
]
29+
}
30+
]
31+
}

0 commit comments

Comments
 (0)