Presets: Detect and handle CMAKE_TOOLCHAIN_FILE in CMake Gui
If the toolchain is set in the Presets, then the GUI should seed the toolchain-dialog with this value.
As it is now, the variable will simply be ignored, and the toolchain has to be picked manually.
cmake version 3.19.0-rc1
{
"version": 1,
"cmakeMinimumRequired": {
"major": 3,
"minor": 17,
"patch": 0
},
"configurePresets": [
{
"name": "armv5",
"displayName": "Arm Config",
"description": "Default build using Ninja generator",
"generator": "Ninja",
"binaryDir": "${sourceDir}/build/${presetName}",
"cacheVariables": {
"CMAKE_TOOLCHAIN_FILE": {
"type": "FILEPATH",
"value": "${sourceDir}/cmake/armvte-toolchainfile.cmake"
},
"CMAKE_BUILD_TYPE": {
"type": "STRING",
"value": "RelWithDebInfo"
}
}
},
{
"name": "mingw",
"displayName": "Mingw Config",
"description": "Default build using Ninja generator",
"generator": "Ninja",
"binaryDir": "${sourceDir}/build/${presetName}",
"cacheVariables": {
"CMAKE_TOOLCHAIN_FILE": {
"type": "FILEPATH",
"value": "${sourceDir}/cmake/mingw-toolchainfile.cmake"
},
"CMAKE_BUILD_TYPE": {
"type": "STRING",
"value": "RelWithDebInfo"
}
}
}
]
}
Edited by Craig Scott