vscode-cmake-tools icon indicating copy to clipboard operation
vscode-cmake-tools copied to clipboard

CMakePresets with a multi-folder workspace isn't integrated correctly

Open TheJCAB opened this issue 3 years ago • 4 comments

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

TheJCAB avatar Aug 04 '21 18:08 TheJCAB

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?

bobbrow avatar Aug 04 '21 18:08 bobbrow

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).

TheJCAB avatar Aug 04 '21 18:08 TheJCAB

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.

bobbrow avatar Aug 06 '21 21:08 bobbrow

I also experience this. My current workaround is to use cmake.ignoreCMakeListsMissing in the .code-workspace settings file (ie. applied to all workspace roots).

david-fong avatar Aug 08 '22 20:08 david-fong

Any news regarding cmake presets and multi-root workspaces ?

nono313 avatar Oct 05 '22 08:10 nono313