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: docs/build/customize-cmake-settings.md
+22-8Lines changed: 22 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,17 @@ ms.topic: how-to
7
7
---
8
8
# Customize CMake build settings
9
9
10
-
::: moniker range=">=msvc-160"
10
+
::: moniker range=">=msvc-180"
11
+
12
+
The CMake settings editor has been deprecated in Visual Studio 2026.
13
+
14
+
To learn about changing the *`CMakePresets.json`* file, see [CMakePresets.json and CMakeUserPresets.json Microsoft vendor maps](/cpp/build/cmake-presets-json-reference).
15
+
16
+
For Visual Studio 2019 to 2022, select your version by using the version selector in the sidebar menu.
17
+
18
+
::: moniker-end
19
+
20
+
::: moniker range=">=msvc-160 <=msvc-170"
11
21
12
22
Visual Studio uses a CMake configuration file to drive CMake generation and build. *`CMakePresets.json`* is supported by Visual Studio 2019 version 16.10 or later and is the recommended CMake configuration file. *`CMakePresets.json`* is supported directly by CMake and can be used to drive CMake generation and build from Visual Studio, from VS Code, in a Continuous Integration pipeline, and from the command line on Windows, Linux, and Mac. For more information on *`CMakePresets.json`*, see [Configure and build with CMake Presets](cmake-presets-vs.md).
13
23
@@ -23,6 +33,10 @@ Now you see the **Settings Editor** with the installed configurations on the lef
23
33
The left pane shows the installed configurations (x86-Debug). The right pane shows the settings for the selected configuration. The settings include the configuration name, configuration type (set to Debug), toolset (set to msvc_x86), CMake toolchain file (empty), build root (contains ${env:USERPROFILE}\CMakeBuilds\${workspaceHash}\build\${name}), CMake command arguments (empty), and build command arguments (-v).
24
34
:::image-end:::
25
35
36
+
> [!NOTE]
37
+
> If a JSON editor opens instead of the **Settings Editor** when you select **Manage Configurations**, you need to enable the CMakeSettings mode. Under **Tools** > **Options** > **CMake**, select **Never use CMake Presets**, and then close and reopen your CMake project. Alternatively, you can choose **Use CMake Presets if available, otherwise use CMakeSettings.json**, and then delete the *CMakePresets.json* file from the project folder.
38
+
> :::image type="content" source="media/options-configuration-file.png" alt-text="Screenshot of the C make options pane.":::
39
+
26
40
Visual Studio provides one `x64-Debug` configuration by default. You can add more configurations by choosing the green plus sign. The settings that you see in the editor might vary depending on which configuration is selected.
27
41
28
42
The options that you choose in the editor are written to a file called *`CMakeSettings.json`*. This file provides command-line arguments and environment variables that are passed to CMake when you build the projects. Visual Studio never modifies *`CMakeLists.txt`* automatically; by using *`CMakeSettings.json`* you can customize the build through Visual Studio while leaving the CMake project files untouched so that others on your team can consume them with whatever tools they're using.
@@ -201,11 +215,11 @@ For more information about each of the properties in the file, see [`CMakeSettin
201
215
202
216
::: moniker-end
203
217
204
-
## See also
218
+
## Related content
205
219
206
-
[CMake Projects in Visual Studio](cmake-projects-in-visual-studio.md)<br/>
207
-
[Configure a Linux CMake project](../linux/cmake-linux-project.md)<br/>
208
-
[Connect to your remote Linux computer](../linux/connect-to-your-remote-linux-computer.md)<br/>
0 commit comments