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:
The CMake Integration for Visual Studio Code supports:
CMake version 3.7 or higher must be installed.
Warning: This extension is incompatible with other CMake extensions like CMake Tools
.
Restart CMake Client (Clean)
and select your project.Most settings are documented well through VSCode settings dialog. The most important settings are:
cmake.default.generator
: The generator to generate the build system.
Set this to an apropriate user default. (See Pitfalls)Options cmake.build.workspaceTargets
and cmake.build.targetDependencies
can be used to configure an andvanced build workflow.
cmake.build.workspaceTargets
: A list of targets, that are executed
on the Build workspace
command.cmake.build.targetDependencies
: A list of dependencies between projects
and/or targets, that will be resolved before building.
(e.g. Dependency between a library project and an application project using it)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.
None.
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.
See the Changelog