0

I have two devcontainers defined for my c++ project, one for gcc and one for clang, each based on a different container source.

enter image description here

The clang container is defined so

// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/debian
{
    "name": "mw-clang",
    "image": "dockerhub.moduleworks.com:443/devops/docker-images/linux-clang-toolkit",


    // Configure tool-specific properties.
    // "customizations": {},
    "customizations": {
        "vscode": {"extensions": ["ms-vscode.cmake-tools"]}
    }


}

However I have two different cmake presets, again one for gcc and one for clang. I've figured out how to tell vscode that I need cmake tools for each container.

enter image description here

Is it also possible in each dev container to specific the CMakePreset which is most suitable for that container and also add other custom CMake flags?

πάντα ῥεῖ
  • 1
  • 13
  • 116
  • 190
bradgonesurfing
  • 30,949
  • 17
  • 114
  • 217
  • (preface: I'm not familiar with devcontainer setup). [docs](https://github.com/microsoft/vscode-cmake-tools/blob/main/docs/cmake-settings.md#cmake-settings). I'm not aware of a setting for specifying a default preset to use. There are settings currently for setting configure args (`cmake.configureArgs`). see also `cmake.buildArgs`, `cmake.configureEnvironment`, `cmake.configureSettings`. – starball May 05 '23 at 07:21
  • I googled "`site:github.com/microsoft/vscode-cmake-tools/issues default preset setting`" and didn't see anything that looked promising in the top search results. All I saw was https://github.com/microsoft/vscode-cmake-tools/issues/2711. I assume you'll need something like a VS Code setting for selecting default CMake configure and build presets to use? (in which case you might need/want to [create a feature-request issue ticket](https://github.com/microsoft/vscode-cmake-tools/issues/new?assignees=&labels=&template=bugreport.yml)) – starball May 05 '23 at 07:22

0 Answers0