Set (configure) preset in custom task? #4303
-
Hi, we got a custom task generating a CMake Preset via Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
@KUGA2 Could you explain more about the workflow so that I understand the entire flow? There may be ways to do it, but it depends on how things are invoked and how the entire flow operates. Thanks! |
Beta Was this translation helpful? Give feedback.
-
Well, thats really it. We got one task that generates a CMake preset (Conan in our case, but that really does not matter). If we had a task that switched the active configure preset, we could chain it together. |
Beta Was this translation helpful? Give feedback.
Understood. I don't believe we have a command visible through the command pallete that would do this.
I attempted with a couple other tasks we have, and I don't believe we have one that would do this. We do have a command
cmake.setConfigurePreset
that can be called with the VS Code API, for example, through the VSCode API Explorer extension, but I attempted to use it in a tasks.json and it didn't seem to work.There may be a way if you investigate more on how to execute a vscode command through a tasks.json with arguments, but it seems to pass additional arguments that mess with how our implementation handles it.