Once again, my CMake lack-of-knowledge is laid bare. I decided today to play around with presets and whipped up this file:
{
"version": 2,
"cmakeMinimumRequired": {
"major": 3,
"minor": 20,
"patch": 3
},
"configurePresets": [
{
"name": "Release",
"displayName": "Release Config",
"description": "Release build using GNU Make generator",
"generator": "Unix Makefiles",
"binaryDir": "${sourceDir}/build-Release",
"cacheVariables": {
"BASEDIR": "$env{BASEDIR}/Darwin",
"CMAKE_BUILD_TYPE": "Release",
"CMAKE_INSTALL_PREFIX": "${sourceDir}/install-Release"
}
}
],
"buildPresets": [
{
"name": "Release",
"configurePreset": "Release",
"targets": "install"
}
]
}
I’m mainly piggybacking off of other examples I saw out there.
What I’m aiming for is for this to be equivalent to:
mkdir build-Release
cd build-Release
cmake .. -DBASEDIR=$BASEDIR/Darwin -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=../install-Release
However, I must have got something wrong:
❯ cmake --version
cmake version 3.20.3
CMake suite maintained and supported by Kitware (kitware.com/cmake).
❯ cmake -S . --list-presets
CMake Error: Could not read presets from /Users/mathomp4/Models/MAPL-Try/MAPL: Invalid preset
I’m sure it’s blindingly obvious, but I’m just stumped!