Skip to content

Add cmakepreset 2 #707

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
145 changes: 145 additions & 0 deletions CMakePresets.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
{
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you rebase this so that the merge commits are removed?

"version": 3,
"configurePresets": [
{
"name": "base",
"displayName": "base preset",
"generator": "Ninja",
"binaryDir": "${sourceDir}/build-${presetName}",
"hidden": true
},
{
"name": "base-qt6",
"displayName": "base preset",
"generator": "Ninja",
"binaryDir": "${sourceDir}/build-${presetName}",
"hidden": true
},
{
"name": "dev-mold",
"displayName": "Build as debug + using mold linker",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug",
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON",
"CMAKE_SHARED_LINKER_FLAGS": "-fuse-ld=mold",
"USE_QT5" : "ON"
},
"inherits": [
"base"
]
},
{
"name": "dev",
"displayName": "Build as debug",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug",
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON",
"USE_QT5" : "ON"
},
"inherits": [
"base"
]
},
{
"name": "dev-qt6",
"displayName": "Build against qt6",
"binaryDir": "${sourceDir}/build-qt6",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug",
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON"
},
"inherits": [
"base-qt6"
]
},
{
"name": "release-qt6",
"displayName": "Build as release mode.",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release",
"BUILD_TESTING": "OFF"
},
"inherits": [
"base-qt6"
]
},
{
"name": "dev-mold-qt6",
"displayName": "Build as debug + using mold linker",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug",
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON",
"CMAKE_SHARED_LINKER_FLAGS": "-fuse-ld=mold"
},
"inherits": [
"base-qt6"
]
},
{
"name": "dev-clang",
"displayName": "dev-clang",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug",
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON",
"USE_QT5" : "ON"
},
"environment": {
"CXX": "clang++",
"CCACHE_DISABLE": "ON"
},
"inherits": [
"base"
]
},
{
"name": "release",
"displayName": "Build as release mode.",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release",
"BUILD_TESTING": "OFF",
"USE_QT5" : "ON"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you look at #498 and #498 there are a minefield of possible options and we were worried this file could become huge with so many options.

What do you think is the best way of covering the cases here ? And which ones should be left for CMakeUserPresets ? Eg i think probably sccache (from my old pull request) should be a user preset.

},
"inherits": [
"base"
]
}
],
"buildPresets": [
{
"name": "dev",
"configurePreset": "dev"
},
{
"name": "dev-mold",
"configurePreset": "dev-mold"
},
{
"name": "dev-mold-qt6",
"configurePreset": "dev-mold-qt6"
},
{
"name": "dev-qt6",
"configurePreset": "dev-qt6"
},
{
"name": "release-qt6",
"configurePreset": "release-qt6"
},
{
"name": "dev-clang",
"configurePreset": "dev-clang"
},
{
"name": "release",
"configurePreset": "release"
}
],
"testPresets": [
{
"name": "dev",
"configurePreset": "dev",
"output": {"outputOnFailure": true},
"execution": {"noTestsAction": "error", "stopOnFailure": false}
}
]
}
5 changes: 5 additions & 0 deletions CMakePresets.json.license
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# SPDX-FileCopyrightText: 2021 Klarälvdalens Datakonsult AB, a KDAB Group company <[email protected]>
# SPDX-FileContributor: Laurent Montel <[email protected]>
#
# SPDX-License-Identifier: MIT OR Apache-2.0