Skip to content

Commit 0d8cb45

Browse files
committed
added cmake preset with ninja for windows
1 parent f561e07 commit 0d8cb45

File tree

1 file changed

+43
-14
lines changed

1 file changed

+43
-14
lines changed

CMakePresets.json

Lines changed: 43 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -62,43 +62,72 @@
6262
}
6363
},
6464
{
65-
"name": "linux-base",
66-
"description": "Use current Qt with Clang compiler",
65+
"name": "ninja-base",
66+
"description": "Use current Qt with Ninja",
6767
"hidden": true,
6868
"generator": "Ninja",
6969
"binaryDir": "${sourceDir}/build/${presetName}",
7070
"cacheVariables": {
7171
"CMAKE_TOOLCHAIN_FILE": "$env{QT_DIR}/lib/cmake/Qt6/qt.toolchain.cmake",
7272
"CMAKE_INSTALL_PREFIX": "${sourceDir}/build/${presetName}/install",
7373
"CMAKE_PREFIX_PATH": "$env{QT_DIR}/lib/cmake",
74-
"CMAKE_C_COMPILER": "clang",
75-
"CMAKE_CXX_COMPILER": "clang++",
7674
"QT_QML_GENERATE_QMLLS_INI": "ON",
7775
"CMAKE_CXX_FLAGS_DEBUG_INIT": "-DQT_QML_DEBUG -DQT_DECLARATIVE_DEBUG",
7876
"CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT": "-DQT_QML_DEBUG -DQT_DECLARATIVE_DEBUG"
79-
},
80-
"condition": {
81-
"type": "equals",
82-
"lhs": "${hostSystemName}",
83-
"rhs": "Linux"
77+
}
78+
},
79+
{
80+
"name": "clang-base",
81+
"displayName": "Qt Clang",
82+
"description": "Use current Qt with Clang compiler",
83+
"hidden": true,
84+
"inherits": "ninja-base",
85+
"cacheVariables": {
86+
"CMAKE_C_COMPILER": "clang",
87+
"CMAKE_CXX_COMPILER": "clang++"
88+
}
89+
},
90+
{
91+
"name": "Qt-Clang-Debug",
92+
"displayName": "Qt Clang Debug",
93+
"description": "Use current Qt with Clang compiler (Debug)",
94+
"inherits": "clang-base",
95+
"cacheVariables": {
96+
"CMAKE_BUILD_TYPE": "Debug"
8497
}
8598
},
8699
{
87100
"name": "compile_commands",
88101
"displayName": "Generate compile_commands",
89102
"description": "Use current Qt with Clang compiler (Debug)",
90-
"inherits": "linux-base",
103+
"inherits": "clang-base",
91104
"cacheVariables": {
92105
"CMAKE_BUILD_TYPE": "Debug",
93106
"MUSE_COMPILE_USE_UNITY": "OFF",
94107
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON"
95108
}
96109
},
97110
{
98-
"name": "Qt-Clang-Debug",
99-
"displayName": "Qt Clang Debug",
100-
"description": "Use current Qt with Clang compiler (Debug)",
101-
"inherits": "linux-base",
111+
"name": "msvc-base",
112+
"displayName": "Qt Msvc",
113+
"description": "Use current Qt with Msvc compiler",
114+
"hidden": true,
115+
"inherits": "ninja-base",
116+
"cacheVariables": {
117+
"CMAKE_C_COMPILER": "cl.exe",
118+
"CMAKE_CXX_COMPILER": "cl.exe"
119+
},
120+
"condition": {
121+
"type": "equals",
122+
"lhs": "${hostSystemName}",
123+
"rhs": "Windows"
124+
}
125+
},
126+
{
127+
"name": "Qt-Msvc-Debug",
128+
"displayName": "Qt Msvc Debug",
129+
"description": "Use current Qt with Msvc compiler (Debug)",
130+
"inherits": "msvc-base",
102131
"cacheVariables": {
103132
"CMAKE_BUILD_TYPE": "Debug"
104133
}

0 commit comments

Comments
 (0)