My first attempt at creating a CMakePrests.json, when trying to list my presets, I get an invalid preset
warning.
I verified my preset validates against the scheme, so nothing obviously wrong jumps out at me, so any help to track down the issue is appreciated.
Validated Json: Newtonsoft
Output:
matt@thonkpad ~/src/personal/cpp_starter_template $ cmake . --list-presets
CMake Error: Could not read presets from /home/matt/src/personal/cpp_starter_template: Invalid preset
matt@thonkpad ~/src/personal/cpp_starter_template $ cmake . --trace --list-presets
Running with trace output on.
CMake Error: Could not read presets from /home/matt/src/personal/cpp_starter_template: Invalid preset
matt@thonkpad ~/src/personal/cpp_starter_template $ cmake . --debug-output --list-presets
Running with debug output on.
CMake Error: Could not read presets from /home/matt/src/personal/cpp_starter_template: Invalid preset
matt@thonkpad ~/src/personal/cpp_starter_template $ cmake --version
cmake version 3.20.2
CMake suite maintained and supported by Kitware (kitware.com/cmake).
matt@thonkpad ~/src/personal/cpp_starter_template $ cat CMakePresets.json
{
"version": 2,
"cmakeMinimumRequired": {
"major": 3,
"minor": 20,
"patch": 0
},
"configurePresets": [
{
"name": "base",
"displayName": "Base",
"description": "Base configuration",
"hidden": true,
"binaryDir": "${sourceDir}/build/${presetName}",
"cacheVariables": {
"CMAKE_EXPORT_COMPILE_COMMANDS" : "ON"
}
},
{
"inherits": "base",
"name": "debug",
"displayName": "Debug",
"description": "Build as Debug",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug"
}
},
{
"inherits": [
"base",
"debug"
],
"name": "dev",
"displayName": "Developer",
"description": "Build as Debug, with warnings enabled.",
"cacheVariables": {
"ENABLE_WARNINGS": "TRUE"
},
"warnings": {
"dev": true,
"deprecated": true,
"uninitialized": true,
"systemVars": true
},
"errors": {
"dev": true,
"deprecated": true
}
},
{
"inherits": "base",
"name": "release",
"displayName": "Release",
"description": "Build as Release",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release"
}
},
{
"inherits": [
"base",
"release"
],
"name": "release-static-libs",
"displayName": "Release (Static libs)",
"description": "Build as Release, forcing static built libraries",
"cacheVariables": {
"BUILD_SHARED_LIBS": "OFF"
}
},
{
"inherits": [
"base",
"release"
],
"name": "release-shared-libs",
"displayName": "Release (Shared libs)",
"description": "Build as Release, forcing shared built libraries",
"cacheVariables": {
"BUILD_SHARED_LIBS": "ON"
}
},
{
"inherits": "base",
"name": "relwithdebinfo",
"displayName": "RelWithDebInfo",
"description": "Build as Release with Debug Info",
"binaryDir": "${sourceDir}/build/${presetName}",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "RelWithDebInfo"
}
},
{
"inherits": "base",
"name": "minsizerel",
"displayName": "MinSizeRel",
"description": "Build as Release, optimizing for size",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "MinSizeRel"
}
}
],
"buildPresets": [
{
"name": "debug",
"configurePreset": "debug",
"jobs": 4
},
{
"name": "dev",
"configurePreset": "dev",
"jobs": 4
},
{
"name": "release",
"configurePreset": "release",
"jobs": 4
},
{
"name": "release-static-libs",
"configurePreset": "release-static-libs",
"jobs": 4
},
{
"name": "release-shared-libs",
"configurePreset": "release-shared-libs",
"jobs": 4
},
{
"name": "relwithdebinfo",
"configurePreset": "relwithdebinfo",
"jobs": 4
},
{
"name": "minsizerel",
"configurePreset": "minsizerel",
"jobs": 4
}
],
"testPresets": [
]
}