microsoft / microsoft/vscode-cmake-tools

environmentSetupScript support for Presets

Open
#4,227 0 comments 5 reactions 0 assignees View on GitHub
enhancement Feature: presets
Dominant language
TypeScript
Stars
1.7k
Forks
546
Avg merge
2d 16h
Merged PRs (30d)
32

Description

### Brief Issue Summary

From comment on #4117

we are heavily relying on the environmentSetupScript key in cmake-kits.json. It doesn't seem to exist in CMake Presets.

According to this issue over at the CMake project it seems to be intentionally left out: https://gitlab.kitware.com/cmake/cmake/-/issues/21619

The environmentSetupScript makes it really easy to use Yocto SDKs, since this the default way to use it with cmake tool chain files (sourcing the environment setup script for e.g. $CC and then using the cmake tool chain file): https://docs.yoctoproject.org/dev/sdk-manual/using.html#running-the-sdk-environment-setup-script

Unfortunately Yocto is lacking documentation on using the SDK with cmake, here is what I found:
https://patchwork.yoctoproject.org/project/oe-core/patch/20220331024645.655-1-workjagadeesh@gmail.com/

https://docs.yoctoproject.org/sdk-manual/working-projects.html

Sourcing the environment script from command line and then opening code from the terminal is also only partially solving the issue. We use the remote ssh/WSL extension a lot, and sourcing an environment before opening the remote/WSL session doesn't seem to be possible.

It would be great to somehow have the environmentSetupScript key available when used with CMake Presets, otherwise we still need to rely on CMake Kits (here is to hope that the cmake tools extension will not drop CMake Kits support).

Thanks in advance :)

### CMake Tools Diagnostics

```shell

```

### Debug Log

```shell

```

### Additional Information

_No response_

Contributor guide

Open the contributing guide

Research direction

Start by tracing the CMake Presets and CMake Kits entry points, then compare how environmentSetupScript is handled for kits. Review CMake issue 21619 and the linked Yocto SDK documentation to establish expected behavior, including remote and WSL use. Done means preset-based workflows can use the requested environment setup without dropping existing Kits support.

Written by the indexing model from the issue text.

Assessment

Tech stack
cmake
Domain
build-system, tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.