go2sh / cmake-integration-vscode

CMake Server Interface for VSCode.
https://go2sh.github.io/cmake-integration-vscode/
Other
19 stars 11 forks source link
cmake cmake-server extension vscode

CMake Integration for Visual Studio Code

The CMake Integration extension provides a first-class integration of the CMake configure and build workflow into Visual Studio Code. It lets you mange multiple CMake-based projects in one workspace supported by advanced features like fine control over projects, targets and configurations, project dependencies, workspace targets and more. Setup your build environment to through the settings editor and launch your configure and build process from keyboard or the VSCode command palette.

For more information:

Features

The CMake Integration for Visual Studio Code supports:

Requirements

CMake version 3.7 or higher must be installed.

Warning: This extension is incompatible with other CMake extensions like CMake Tools.

Quick Start

  1. Configure your default Generator in your User Settings (Default is Ninja).
  2. Add your CMake project(s) to the workspace.
  3. Select your project, target and configuration from the status bar.
  4. Hit F7 for building the currently selected target or Shift+F7 for the currently selected project (build all).

Pitfalls

Extension Settings

Most settings are documented well through VSCode settings dialog. The most important settings are:

Options cmake.build.workspaceTargets and cmake.build.targetDependencies can be used to configure an andvanced build workflow.

In both cases targets are specified by either a project name (all targets in the project) or by a project name and a target name.

# Project
{ "project": "test" }
# Project and target
{ "project": "test", "target": "app" }

Additionally cmake.build.targetDependencies object take a dependencies array for specifying dependencies for a project or a target.

{
    "project": "test",
    "target": "app",
    "dependencies": [
        { "project": "liba" },
        { "project": "libb", "target": "special"}
    ]
}

Both options have a JSON schema in place to guide you through the configuration.

Known Issues

None.

Contributing

As this extension is in a preview state, it is neither bug-free nor feature-complete. Your help is highly appreciated and feel free to contribute to this extension by opening a bug report or feature request or contribute directly via pull requests.

Roadmap

Release Notes

See the Changelog