You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+3Lines changed: 3 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,6 +6,8 @@ Features:
6
6
7
7
- Add an option to specify the launch target for debugging CTest tests. [#4273](https://github.com/microsoft/vscode-cmake-tools/pull/4273)
8
8
- Add a setting to enable/disable our built-in language services. [#4290](https://github.com/microsoft/vscode-cmake-tools/issues/4290)
9
+
- Add an option to group the default build target dropdown using CMake groups [#3953](https://github.com/microsoft/vscode-cmake-tools/pull/3953)[@itzandroidtab](https://github.com/itzandroidtab)
10
+
- Add `cmake.exclude` setting that allows users to set folders that they want the CMake Tools extension to ignore. [#4112](https://github.com/microsoft/vscode-cmake-tools/issues/4112)
9
11
10
12
Improvements:
11
13
@@ -20,6 +22,7 @@ Bug Fixes:
20
22
- Fixes localization for "workspace is" string. [#4374](https://github.com/microsoft/vscode-cmake-tools/issues/4374)
21
23
- Make tooltips for selecting Launch/Debug Target. [#4373](https://github.com/microsoft/vscode-cmake-tools/issues/4373)
22
24
- Fix bug where unrelated symlinks are read as variant files [#4304](https://github.com/microsoft/vscode-cmake-tools/issues/4304)[@vitorramos](https://github.com/vitorramos).
25
+
- Fix evaluation of conditions in presets. [#4425](https://github.com/microsoft/vscode-cmake-tools/issues/4425)
23
26
- Fix incorrect IntelliSense configuration when a `UTILITY` has source files. [#4404](https://github.com/microsoft/vscode-cmake-tools/issues/4404)
Copy file name to clipboardExpand all lines: docs/README.md
+46-35Lines changed: 46 additions & 35 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,49 +5,16 @@ CMake Tools is an extension designed to make it easy to work with CMake-based pr
5
5
If you are new, try the [CMake Tools quick start](https://code.visualstudio.com/docs/cpp/CMake-linux) and see the [frequently asked questions](faq.md).
6
6
7
7
[How to](how-to.md)
8
+
8
9
*[Create a new project](how-to.md#create-a-new-project)
9
10
*[Configure a project](how-to.md#configure-a-project)
10
11
*[Build a project](how-to.md#build-a-project)
11
12
*[Debug a project](how-to.md#debug-a-project)
12
13
*[Pass command-line arguments to the debugger](debug-launch.md#debug-using-a-launchjson-file)
13
14
*[Set up include paths for C++ IntelliSense](how-to.md#set-up-include-paths-for-c-intellisense)
14
15
15
-
[Kits](kits.md)
16
-
*[How kits are found and defined](kits.md#how-kits-are-found-and-defined)
17
-
*[Kit options](kits.md#kit-options)
18
-
19
-
[Configure](configure.md)
20
-
*[CMake configuration process overview](configure.md#cmake-configuration-process-overview)
*[Configure and build with CMake Presets](cmake-presets.md#configure-and-build-with-cmake-presets)
52
19
*[Supported CMake and CMakePresets.json versions](cmake-presets.md#supported-cmake-and-cmakepresetsjson-versions)
53
20
*[Enable CMakePresets.json in the CMake Tools extension](cmake-presets.md#enable-cmakepresetsjson-in-the-cmake-tools-extension)
@@ -73,7 +40,49 @@ CMake Tools is an extension designed to make it easy to work with CMake-based pr
73
40
*[Sourcing the environment when building with command line generators on Windows](cmake-presets.md#sourcing-the-environment-when-building-with-command-line-generators-on-windows)
Copy file name to clipboardExpand all lines: docs/build.md
+5-4Lines changed: 5 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -31,13 +31,14 @@ Selecting this button shows a quick pick list for all the targets CMake Tools is
31
31
You can build a single target without changing the current build target from the VS Code command palette by running the **CMake: Build Target** command, or by pressing the keyboard shortcut (default is `Shift+F7`). CMake will build any dependent targets, even if they aren't directly selected.
32
32
33
33
## Create a build task
34
+
34
35
You can also define a build task from the VS Code command palette by running the **Tasks: Configure Task** command.
35
36
36
37

37
38
38
39
By choosing the "CMake: build" task, the following task will be created in "${workspaceFolder}/.vscode/tasks.json" file.
39
40
40
-
```
41
+
```json
41
42
{
42
43
"version": "2.0.0",
43
44
"tasks": [
@@ -58,7 +59,7 @@ By choosing the "CMake: build" task, the following task will be created in "${wo
58
59
59
60
The default target is set to "all" target (named ALL_BUILD in some generators). You can modify the "targets" value with a single target or a list of targets that can be built. Here is an example of two customized build tasks in which the name of the task, the list of targets, and the description of the tasks is modified:
60
61
61
-
```
62
+
```json
62
63
{
63
64
"version": "2.0.0",
64
65
"tasks": [
@@ -103,9 +104,9 @@ For advanced scenarios, additional flags to `--build` can be set with [cmake.bui
103
104
104
105
### The build environment
105
106
106
-
Environment variables are inherited from the calling Visual Studio Code process, with additional variables from the [cmake.buildEnvironment](cmake-settings.md#cmake-settings)and[cmake.environment](cmake-settings.md#cmake-settings) settings.
107
+
Environment variables are inherited from the calling Visual Studio Code process, along with any additional variables set in the CMake [CMake Presets Environment](cmake-presets.md#set-and-reference-environment-variables).
107
108
108
-
If you are using a [Visual Studio Kit](kits.md#visual-Studio), CMake Tools runs the build with the appropriate environment variables set to build with the chosen version of Visual Studio, much like how it sets these environment variables during [the CMakeTools configure step](configure.md#the-cmake-tools-configure-step).
109
+
If you are using either a cl.exe compiler or Ninja, and you have `cmake.useVsDeveloperEnvironment` set to `auto`, CMake Tools will attempt to detect and paply the appropriate environment variables set to build with the chosen version of Visual Studio. CMake Tools will do this no matter what if you set `cmake.useVsDeveloperEnviornment` to `always`.
Copy file name to clipboardExpand all lines: docs/cmake-presets.md
+25-11Lines changed: 25 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,6 +5,7 @@ CMake supports two files that allow users to specify common configure, build, an
5
5
`CMakePresets.json` is for saving project-wide builds. `CMakeUserPresets.json` is for developers to save their own local builds. Their integration is available in CMake Tools version 1.7 and later.
6
6
7
7
This article contains information about `CMakePresets.json` integration in the CMake Tools extension for Visual Studio Code. Here are helpful links:
8
+
8
9
- For more information on the format of `CMakePresets.json`, see the official [CMake documentation](https://cmake.org/cmake/help/latest/manual/cmake-presets.7.html).
9
10
- For more information on the Microsoft vendor maps and macro expansion, see [`CMakePresets.json` and `CMakeUserPresets.json` Microsoft vendor maps](https://docs.microsoft.com/cpp/build/cmake-presets-json-reference).
10
11
- For more information on how to use `CMakePresets.json` in Visual Studio, see [Configure and build with CMake Presets in Visual Studio](https://docs.microsoft.com/cpp/build/cmake-presets-vs).
@@ -70,9 +71,21 @@ Select a Test Preset to make it the active Test Preset. This is the `testPreset`
70
71
71
72
All Test Presets must specify an associated `configurePreset` value. CMake Tools will hide Test Presets that don't apply to the active Configure Preset. For more information, see the [list of Test Presets](https://cmake.org/cmake/help/latest/manual/cmake-presets.7.html#test-preset).
72
73
74
+
### CMake: Select Package Preset
75
+
76
+
**CMake: Select Package Preset** lists the default Package Presets and the union of non-hidden Package Presets defined in `CMakePresets.json` and `CMakeUserPresets.json`. The default Package Preset will not perform a packaging.
77
+
78
+
Select a Package Preset to make it the active Package Preset. This is the `packagePreset` value that will be used when you invoke **CMake: Run CPack** to package. This will package your code in the format specified in the presets file.
79
+
80
+
### CMake: Select Workflow Preset
81
+
82
+
**CMake: Select Workflow Preset** lists the default Workflow Presets and the union of non-hidden Workflow Presets defined in `CMakePresets.json` and `CMakeUserPresets.json`. The default Workflow Preset will simply configure the project.
83
+
84
+
Selecte a Workflow Preset to make it the active Workflow Preset. This is the `workflowPreset` value that will be used when you invoke **CMake: Run Workflow**.
85
+
73
86
### CMake: Run Tests
74
87
75
-
To invoke CTest, run **CMake: Run Tests** from the command palette.
88
+
To invoke CTest, run **CMake: Run Tests** from the command palette.
76
89
When integration with the test explorer is enabled, using `cmake.ctest.testExplorerIntegrationEnabled`, the method of test execution will depend on `cmake.ctest.allowParallelJobs`. With `cmake.ctest.allowParallelJobs` disabled, each test will be run individually so that we can accurately track progress in the Test Explorer. When it is enabled, they will all be run in parallel, which is the same as running `ctest --preset <testPreset>` from the command line, where `<testPreset>` is the name of the active Test Preset.
77
90
78
91
### CMake Tools side bar Project Status View behavior
@@ -94,10 +107,10 @@ To add a new Configure Preset to `CMakePresets.json`, run the **CMake: Add Confi
94
107
95
108

96
109
97
-
- Select **Inherit from Configure Preset** to inherit from an existing Configure Preset. For more information about inheritance, see the [list of Configure Presets](https://cmake.org/cmake/help/latest/manual/cmake-presets.7.html#configure-preset).
98
-
- Select the **Toolchain File** template to configure your CMake project with a CMake toolchain file.
99
-
- Select the **Custom** template to configure an empty Configure Preset.
100
-
- Select **[Scan for Compilers]** to search for C/C++ compilers on your machine.
110
+
- Select **Inherit from Configure Preset** to inherit from an existing Configure Preset. For more information about inheritance, see the [list of Configure Presets](https://cmake.org/cmake/help/latest/manual/cmake-presets.7.html#configure-preset).
111
+
- Select the **Toolchain File** template to configure your CMake project with a CMake toolchain file.
112
+
- Select the **Custom** template to configure an empty Configure Preset.
113
+
- Select **[Scan for Compilers]** to search for C/C++ compilers on your machine.
101
114
102
115
The selected template will be added to `CMakePresets.json` if `CMakePresets.json` exists. Otherwise, the template will be copied into a new `CMakePresets.json` file. For more information on editing Configure Presets, see [Edit presets](#edit-presets).
103
116
@@ -117,6 +130,7 @@ For more information on editing Build Presets, see the [list of Build Presets](h
117
130
### Add new Test Presets
118
131
119
132
To add a new Test Preset to `CMakePresets.json`, run the **CMake: Add Test Preset** command. This command lists several Test Preset templates in the command palette:
133
+
120
134
- Select **Create from Configure Preset** to display a list of `configurePresets` values defined in `CMakePresets.json`. After you select a Configure Preset, an empty Test Preset associated with the selected Configure Preset will be created.
121
135
- Select **Inherit from Test Preset** to display a list of `testPresets` values defined in `CMakePresets.json`. After you select a Test Preset, a new Test Preset that inherits from the selected Test Preset will be created.
122
136
- Select the **Custom** template to configure an empty Test Preset.
@@ -183,7 +197,7 @@ You can reference environment variables by using the `$env{<variable-name>}` and
183
197
184
198
The target architecture (x64, Win32, ARM64, or ARM) can be set with `architecture.value`. This is equivalent to passing `-A` to CMake from the command line. For more information, see [Platform Selection](https://cmake.org/cmake/help/latest/generator/Visual%20Studio%2016%202019.html#platform-selection).
185
199
186
-
> [!Note]
200
+
> [!NOTE]
187
201
> Currently, Visual Studio Generators expect the Win32 syntax and command-line generators (like Ninja) expect the x86 syntax when you're building for x86.
188
202
189
203
You can set the host architecture (x64 or x86) and toolset by using `toolset.value`. This is equivalent to passing `-T` to CMake from the command line. For more information, see [Toolset Selection](https://cmake.org/cmake/help/latest/generator/Visual%20Studio%2016%202019.html#toolset-selection).
@@ -212,17 +226,17 @@ Set the path to `vcpkg.cmake` with the `VCPKG_ROOT` environment variable in `CMa
212
226
},
213
227
```
214
228
215
-
`VCPKG_ROOT` should be set to the root of your vcpkg installation. For more information, see [vcpkg environment variables](https://learn.microsoft.com/en-us/vcpkg/users/config-environment#vcpkg_root).
229
+
`VCPKG_ROOT` should be set to the root of your vcpkg installation. For more information, see [vcpkg environment variables](https://learn.microsoft.com/vcpkg/users/config-environment#vcpkg_root).
216
230
217
-
If you're already using a CMake toolchain file and want to enable vcpkg integration, see [Using multiple toolchain files](https://learn.microsoft.com/en-us/vcpkg/users/buildsystems/cmake-integration#using-multiple-toolchain-files). Follow those instructions to use an external toolchain file with a project by using vcpkg.
231
+
If you're already using a CMake toolchain file and want to enable vcpkg integration, see [Using multiple toolchain files](https://learn.microsoft.com/vcpkg/users/buildsystems/cmake-integration#using-multiple-toolchain-files). Follow those instructions to use an external toolchain file with a project by using vcpkg.
218
232
219
233
## Substitute commands in `launch.json` and `settings.json`
220
234
221
235
CMake Tools supports command substitution for launch commands when `CMakePresets.json` integration is enabled. For more information, see [Command substitution](cmake-settings.md#command-substitution).
222
236
223
237
## Ignored settings
224
238
225
-
`CMakePresets.json` should be the source of truth for all settings related to configure, build, and test, except for settings that can be used as temporary overrides (see below). This eliminates behavior specific to Visual Studio Code and ensures that your CMake and CTest invocations can be reproduced from the command line.
239
+
`CMakePresets.json` should be the source of truth for all settings related to configure, build, and test, except for settings that can be used as temporary overrides (see below). This eliminates behavior specific to Visual Studio Code and ensures that your CMake and CTest invocations can be reproduced from the command line.
226
240
227
241
The following settings in `settings.json` either duplicate options in `CMakePresets.json` or no longer apply. These settings will be ignored when `CMakePresets.json` integration is enabled.
228
242
@@ -259,7 +273,7 @@ The following settings can be used temporarily when CMakePresets integration is
259
273
## Unsupported commands
260
274
261
275
The following commands are not supported when `CMakePresets.json` integration is enabled:
262
-
-**CMake: Quick Start**
276
+
263
277
-**CMake: Select Variant**
264
278
-**CMake: Scan for Kits**
265
279
-**CMake: Select a Kit**
@@ -282,7 +296,7 @@ If you're working on Windows, CMake must be on `PATH`.
282
296
283
297
Other troubleshooting steps include:
284
298
285
-
- Confirm that `cmake.exe` and your generator are installed and on `PATH`. If you're working on Windows, run the **CMake: Scan for Compilers** command so the extension can detect build tools installed with Visual Studio.
299
+
- Confirm that `cmake.exe` and your generator are installed and on `PATH`, unless you've provided an absolute path. If you're working on Windows, run the **CMake: Scan for Compilers** command so the extension can detect build tools installed with Visual Studio.
286
300
- Delete the cache and reconfigure the project (**CMake: Delete Cache and Reconfigure**).
287
301
- Reset the CMake Tools extension state (**CMake: Reset CMake Tools Extension State**).
288
302
- Increase the logging level (`cmake.loggingLevel` in `settings.json`) and/or check the log file (**CMake: Open the CMake Tools Log File**).
0 commit comments