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

Active Target does not allow special or multiple targets

Open Trass3r opened this issue 5 years ago • 10 comments

Once the extension has built up its target list it's only possible to select one of the offered targets which are somehow filtered it seems. So I can neither set e.g. ninja folder targets like src/all nor can I give multiple targets to build exactly what I need for my work. If the target is not in the list it should just be accepted as-is and passed to ninja.

Platform and Versions

  • Operating System: Win10 Remote WSL Ubuntu 20.04
  • CMake Version: 3.17
  • VSCode Version: 1.47
  • CMake Tools Extension Version: 1.4.1
  • Compiler/Toolchain: clang-10

Trass3r avatar Jul 10 '20 11:07 Trass3r

I'm particularly interested in the filtering issue. We've also noticed it strips out folder/all named targets, which we often want to build. The only workaround we've found is to set CMake Tools not to configure on opening a folder, open the target picker which lets you type arbitrary text since it hasn't got a filter list yet, then press build. CMake Tools will pass your arbitrary string to CMake for building - so long as you've picked a folder/all target, it works.

Is there any chance of a quick resolution to it filtering out these targets?

andrewmcdonald-oxb avatar Nov 04 '20 21:11 andrewmcdonald-oxb

The workaround I'm using is the build using task setting.

Trass3r avatar Nov 04 '20 21:11 Trass3r

Would either of you be able to provide a sample project that has the targets you're talking about? That would make it easier for one of us maintainers or someone in the community to pick up this feature request and implement it.

(This is not a statement that we'll get to it right away. It's just a way to make it more likely that someone can hit the ground running with this and implement it sooner.)

Thanks!

bobbrow avatar Nov 04 '20 22:11 bobbrow

I guess any project with multiple targets generating Ninja files will do.

Trass3r avatar Nov 05 '20 19:11 Trass3r

That's right. The attached is a simple setup with CMake targets defined in two subfolders. CMake generates targets named FolderA/all and FolderB/all for conveniently building all targets in those subfolders, but they aren't picked up by CMake Tools in either the target picker or Project Outline pane. https://cmake.org/cmake/help/latest/generator/Ninja.html

They are displayed if you generate then run ninja -t targets all from the command line, but there's a lot of other internal gubbins listed there too. I don't know what method CMake Tools uses to discover the target list. https://ninja-build.org/manual.html#_extra_tools

AllTest.zip

andrewmcdonald-oxb avatar Nov 05 '20 21:11 andrewmcdonald-oxb

This issue is now marked as 'stale-old' due to there being no activity on it for the past 720 days. Unless the 'stale-old' label is removed or the issue is commented on, this will be remain open for at least 14 days and then it may be closed. If you would like to make this issue exempt from getting stale, please add the 'stale-exempt' label.

github-actions[bot] avatar Oct 19 '23 16:10 github-actions[bot]

Still valid?

Trass3r avatar Oct 19 '23 17:10 Trass3r

Yes, I'm still hopeful for this, as it's not available in the latest CMake Tools. @bobbrow is there enough info to understand what we'd like?

andrewmcdonald-oxb avatar Oct 19 '23 17:10 andrewmcdonald-oxb

@andrewmcdonald-oxb There does seem to be enough information to investigate this at our soonest availability, thanks for providing a sample project. Based on bandwidth, we will investigate this when we can. Also, we are happy to take open-source contributions for this feature!

gcampbell-msft avatar Oct 24 '23 13:10 gcampbell-msft

That would be a real time saver in large projects. On the UI design side it would make sense to add checkboxes in target picker similar to branch picker in a popular eamodio.gitlens extension.

lmielick avatar Dec 03 '25 08:12 lmielick