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
+20-54Lines changed: 20 additions & 54 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,15 +7,25 @@ ms.topic: how-to
7
7
---
8
8
# Customize CMake build settings
9
9
10
-
::: moniker range=">=msvc-160"
10
+
::: moniker range="=visual-studio"
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-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
14
24
If you maintain projects that use a *`CMakeSettings.json`* file for CMake build configuration, Visual Studio 2019 and later versions provide a **CMake settings editor**. The editor lets you add CMake configurations and customize their settings easily. It's intended to be a simpler alternative to manually editing the *`CMakeSettings.json`* file. However, if you prefer to edit the file directly, you can select the **Edit JSON** link in the upper right of the editor.
15
25
16
26
To open the CMake settings editor, select the **Configuration** drop-down in the main toolbar and choose **Manage Configurations**.
17
27
18
-

28
+

19
29
20
30
Now you see the **Settings Editor** with the installed configurations on the left.
21
31
@@ -24,7 +34,7 @@ The left pane shows the installed configurations (x86-Debug). The right pane sho
24
34
:::image-end:::
25
35
26
36
> [!NOTE]
27
-
> If a JSON editor opens instead of the **Settings Editor** when you select **Manage Configurations**, you need to enable the CMakeSettings mode. In Visual Studio 2026, 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.
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.
28
38
> :::image type="content" source="media/options-configuration-file.png" alt-text="Screenshot of the C make options pane.":::
29
39
30
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.
@@ -161,55 +171,11 @@ For more information about each of the properties in the file, see [CMakeSetting
161
171
162
172
::: moniker-end
163
173
164
-
::: moniker range="<=msvc-150"
165
-
166
-
Visual Studio 2017 provides several CMake configurations that define how CMake is invoked to create the CMake cache for a given project. To add a new configuration, select the configuration drop-down in the toolbar and choose **Manage Configurations**:
167
-
168
-

169
-
170
-
You can choose from the list of predefined configurations:
171
-
172
-

173
-
174
-
The first time you select a configuration, Visual Studio creates a *`CMakeSettings.json`* file in your project's root folder. This file is used to re-create the CMake cache file, for example after a **Clean** operation.
175
-
176
-
To add another configuration, right-click *`CMakeSettings.json`* and choose **Add Configuration**.
177
-
178
-

179
-
180
-
You can also edit the file using the **CMake Settings Editor**. Right-click on *`CMakeSettings.json`* in **Solution Explorer** and choose **Edit CMake Settings**. Or, select **Manage Configurations** from the configuration drop-down at the top of the editor window.
181
-
182
-
You can also directly edit *`CMakeSettings.json`* to create custom configurations. The following example shows a sample configuration, which you can use as a starting point:
0 commit comments