vscode-cmake-tools
vscode-cmake-tools copied to clipboard
CMakePresets with a multi-folder workspace isn't integrated correctly
Brief Issue Summary
A workspace with multiple folders each with its own CMakePresets.json file is offering the older, non-preset commands.
Expected:
Hit Ctrl+Shift+P, and type "scan".
Apparent Behavior:
You'll see the "CMake: scan for kits" command offered. But... when presets are used you'd expect "CMake: scan for compilers" instead.
Same if you type "preset" instead. None of the preset-related commands are available.
Platform and Versions
- CMake Tools Extension Version: 1.7.3
Just to confirm, you're talking about "multi-root" workspaces, and not a single folder with multiple CMake projects in subfolders of that single folder in the workspace, right?
I'm currently seeing this on a loaded VSCode workspace file with multiple folders in it, each with its own CMake project, and one of which currently uses CMakePresets.json. Each folder is a subdirectory of the directory that contains the workspace file. Whatever you want to call that :-).
We're transitioning, so not all of the folders use presets just yet. But still, it should be possible to use the presets folder and have all the presets commands enabled, at least when a file from that folder is open (contextual switches can be... confusing, but that's life).
I got some clarification from @TheJCAB about the workspace:
- multi-root with 4 folders
- folder 1 has the CMake project with CMakePresets.json in it
- folders 2-4 are not CMake projects.
I also experience this. My current workaround is to use cmake.ignoreCMakeListsMissing
in the .code-workspace settings file (ie. applied to all workspace roots).
Any news regarding cmake presets and multi-root workspaces ?