Skip to content

Commit

Permalink
cmake: Add a CMakePresets.json for default configuration with Ninja &
Browse files Browse the repository at this point in the history
MSVC
  • Loading branch information
OlivierLDff committed Mar 31, 2023
1 parent 3f7f834 commit 0d1748e
Show file tree
Hide file tree
Showing 2 changed files with 163 additions and 0 deletions.
159 changes: 159 additions & 0 deletions CMakePresets.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,159 @@
{
"version": 5,
"configurePresets": [
{
"name": "common",
"binaryDir": "${sourceDir}/build/${presetName}",
"hidden": true,
"cacheVariables": {
"CMAKE_EXPORT_COMPILE_COMMANDS": true
}
},
{
"name": "build-debug",
"hidden": true,
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug"
}
},
{
"name": "build-relwithdebinfo",
"hidden": true,
"cacheVariables": {
"CMAKE_BUILD_TYPE": "RelWithDebInfo"
}
},
{
"name": "build-release",
"hidden": true,
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release"
}
},
{
"name": "ninja",
"hidden": true,
"generator": "Ninja"
},
{
"name": "qt6",
"hidden": true,
"cacheVariables": {
"USE_QT5": false
}
},
{
"name": "qt5",
"hidden": true,
"cacheVariables": {
"USE_QT5": true
}
},
{
"name": "ninja-debug",
"displayName": "Ninja Debug",
"description": "Build in Debug with Ninja generator",
"inherits": ["common", "ninja", "build-debug", "qt6"]
},
{
"name": "ninja-relwithdebinfo",
"displayName": "Ninja RelWithDebInfo",
"description": "Build in RelWithDebInfo with Ninja generator",
"inherits": ["common", "ninja", "build-relwithdebinfo", "qt6"]
},
{
"name": "ninja-release",
"displayName": "Ninja Release",
"description": "Build in Release with Ninja generator",
"inherits": ["common", "ninja", "build-release", "qt6"]
},
{
"name": "ninja-multi",
"displayName": "Ninja Multi-Config",
"description": "Default build using Ninja Multi-Config generator",
"generator": "Ninja Multi-Config",
"inherits": ["common", "ninja", "qt6"]
},
{
"name": "msvc",
"hidden": true,
"condition": {
"type": "equals",
"lhs": "${hostSystemName}",
"rhs": "Windows"
},
"cacheVariables": {
"CMAKE_MSVC_RUNTIME_LIBRARY": "MultiThreadedDLL"
}
},
{
"name": "msvc-17",
"inherits": ["common", "msvc", "qt6"],
"displayName": "Visual Studio 2022",
"generator": "Visual Studio 17 2022",
"description": "Configure using Visual Studio 17 2022 generator"
}
],
"buildPresets": [
{
"name": "build-debug",
"configuration": "Debug",
"hidden": true
},
{
"name": "build-relwithdebinfo",
"configuration": "RelWithDebInfo",
"hidden": true
},
{
"name": "build-release",
"configuration": "Release",
"hidden": true
},
{
"name": "ninja-debug",
"configurePreset": "ninja-debug",
"inherits": "build-debug"
},
{
"name": "ninja-relwithdebinfo",
"configurePreset": "ninja-relwithdebinfo",
"inherits": "build-relwithdebinfo"
},
{
"name": "ninja-release",
"configurePreset": "ninja-release",
"inherits": "build-release"
},
{
"name": "ninja-multi-debug",
"configurePreset": "ninja-multi",
"inherits": "build-debug"
},
{
"name": "ninja-multi-relwithdebinfo",
"configurePreset": "ninja-multi",
"inherits": "build-relwithdebinfo"
},
{
"name": "ninja-multi-release",
"configurePreset": "ninja-multi",
"inherits": "build-release"
},
{
"name": "msvc-17-debug",
"configurePreset": "msvc-17",
"inherits": "build-debug"
},
{
"name": "msvc-17-relwithdebinfo",
"configurePreset": "msvc-17",
"inherits": "build-relwithdebinfo"
},
{
"name": "msvc-17-release",
"configurePreset": "msvc-17",
"inherits": "build-release"
}
]
}
4 changes: 4 additions & 0 deletions CMakePresets.json.license
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
SPDX-FileCopyrightText: 2023 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
SPDX-FileContributor: Olivier Le Doeuff <olivier.ldff@gmail.com>

SPDX-License-Identifier: MIT OR Apache-2.0

0 comments on commit 0d1748e

Please sign in to comment.