Inside the companion
Build your studio
Two small CMake checkpoints: one executable, then a library with tests and presets.
Project files 9
Save the working build commands
Debug and Release presets with separate build trees and test commands.
{
"version": 6,
"cmakeMinimumRequired": {
"major": 3,
"minor": 25,
"patch": 0
},
"configurePresets": [
{
"name": "debug",
"generator": "Ninja",
"binaryDir": "${sourceDir}/build/${presetName}",
"cacheVariables": {
"CMAKE_CXX_COMPILER": "clang++",
"CMAKE_BUILD_TYPE": "Debug",
"CMAKE_EXPORT_COMPILE_COMMANDS": true,
"BUILD_TESTING": true
}
},
{
"name": "release",
"inherits": "debug",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release"
}
}
],
"buildPresets": [
{
"name": "debug",
"configurePreset": "debug"
},
{
"name": "release",
"configurePreset": "release"
}
],
"testPresets": [
{
"name": "debug",
"configurePreset": "debug",
"output": {
"outputOnFailure": true
},
"execution": {
"noTestsAction": "error"
}
},
{
"name": "release",
"configurePreset": "release",
"output": {
"outputOnFailure": true
},
"execution": {
"noTestsAction": "error"
}
}
]
}
This is the file included with the course. Copy and download give you its complete source.
Taking your work offline? Download all course companions
