Skip to content

Commit dfa99f1

Browse files
committed
Merging changes synced from https://github.com/MicrosoftDocs/cpp-docs-pr (branch live)
2 parents 09f9b25 + b15f2a6 commit dfa99f1

14 files changed

+504
-373
lines changed

docs/build/cmake-predefined-configuration-reference.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
description: "Learn more about: CMake predefined build configurations"
33
title: "CMake predefined configuration reference"
44
ms.description: "Visual Studio provides several predefined build configurations for CMake projects on Linux, Windows, ARM, and IoT."
5-
ms.date: "06/12/2019"
5+
ms.date: 08/03/2021
66
helpviewer_keywords: ["CMake redefined configurations"]
77
---
88
# CMake predefined build configurations
@@ -15,7 +15,7 @@ CMake projects are supported in Visual Studio 2017 and later.
1515

1616
::: moniker range=">=msvc-150"
1717

18-
In a CMake project, build configurations are stored in a CMakeSettings.json file. When you choose **Manage Configurations** from the build configuration dropdown in the main toolbar, a dialog appears that shows the default CMake configurations available in Visual Studio:
18+
In a CMake project, build configurations are stored in a *`CMakeSettings.json`* file. When you choose **Manage Configurations** from the build configuration dropdown in the main toolbar, a dialog appears that shows the default CMake configurations available in Visual Studio:
1919

2020
- x86 Debug
2121
- x86 Release
@@ -28,7 +28,7 @@ In a CMake project, build configurations are stored in a CMakeSettings.json file
2828
- MinGW Debug
2929
- MinGW Release
3030

31-
When you choose a configuration, it is added to the *CMakeSettings.json* file in the project's root folder. You can then use it to build your project. For information about the configuration properties, see [CMakeSettings reference](cmakesettings-reference.md).
31+
When you choose a configuration, it's added to the *`CMakeSettings.json`* file in the project's root folder. You can then use it to build your project. For information about the configuration properties, see [CMakeSettings reference](cmakesettings-reference.md).
3232

3333
## Linux predefined build configurations:
3434

@@ -92,7 +92,6 @@ When you choose a configuration, it is added to the *CMakeSettings.json* file in
9292
},
9393
```
9494

95-
9695
You can use these optional settings for more control:
9796

9897
```json
@@ -350,7 +349,7 @@ These options allow you to run commands on the remote system before and after bu
350349

351350
::: moniker range="msvc-160"
352351

353-
In a CMake project, build configurations are stored in a CMakeSettings.json file. When you choose **Manage Configurations** from the build configuration dropdown in the main toolbar, a dialog appears that shows the default CMake configurations available in Visual Studio:
352+
In a CMake project, build configurations are stored in a *`CMakeSettings.json`* file. When you choose **Manage Configurations** from the build configuration dropdown in the main toolbar, a dialog appears that shows the default CMake configurations available in Visual Studio:
354353

355354
- x86 Debug
356355
- x86 Clang Debug
@@ -374,7 +373,7 @@ In a CMake project, build configurations are stored in a CMakeSettings.json file
374373
- WSL Clang Release
375374
- Clang
376375

377-
When you choose a configuration, it is added to the CMakeSettings.json file in the project's root folder. You can then use it to build your project.
376+
When you choose a configuration, it's added to the *`CMakeSettings.json`* file in the project's root folder. You can then use it to build your project.
378377

379378
```json
380379
{

docs/build/cmake-presets-json-reference.md

Lines changed: 41 additions & 41 deletions
Large diffs are not rendered by default.

docs/build/cmake-presets-vs.md

Lines changed: 62 additions & 62 deletions
Large diffs are not rendered by default.

docs/build/cmake-projects-in-visual-studio.md

Lines changed: 55 additions & 55 deletions
Large diffs are not rendered by default.

docs/build/cmake-remote-debugging.md

Lines changed: 24 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ description: "How to use Visual Studio C++ on Windows to create and build a CMak
77

88
# Tutorial: Debug a CMake project on a remote Windows machine
99

10-
This tutorial uses Visual Studio C++ on Windows to create and build a CMake project that you can deploy and debug on a remote Windows machine. This tutorial is specific to Windows ARM64, but the steps can be generalized for other architectures.
10+
This tutorial uses Visual Studio C++ on Windows to create and build a CMake project that you can deploy and debug on a remote Windows machine. The tutorial is specific to Windows ARM64, but the steps can be generalized for other architectures.
1111

12-
In Visual Studio, the default debugging experience for ARM64 is remote debugging an ARM64 Windows machine. If you try to debug an ARM64 CMake project without configuring your debug settings as shown in this tutorial, you'll get an error that Visual Studio can't find the remote machine.
12+
In Visual Studio, the default debugging experience for ARM64 is remote debugging an ARM64 Windows machine. Configure your debug settings as shown in this tutorial. Otherwise, when you try to debug an ARM64 CMake project, you'll get an error that Visual Studio can't find the remote machine.
1313

1414
In this tutorial, you'll learn how to:
1515

@@ -24,7 +24,7 @@ In this tutorial, you'll learn how to:
2424

2525
### On the host machine
2626

27-
To set up Visual Studio for cross-platform C++ development, install the build tools for the target architecture. For this tutorial, install the ARM64 build tools by doing the following:
27+
To set up Visual Studio for cross-platform C++ development, install the build tools for the target architecture. For this tutorial, install the ARM64 build tools by doing these steps:
2828

2929
1. Run the Visual Studio Installer. If you haven't installed Visual Studio yet, see [Install Visual Studio](/visualstudio/install/install-visual-studio)
3030
1. On the Visual Studio Installer home screen, choose **Modify**.
@@ -43,6 +43,7 @@ To set up Visual Studio for cross-platform C++ development, install the build to
4343
## Create a CMake project
4444

4545
On the Windows host machine:
46+
4647
1. Run Visual Studio
4748
1. From the main menu, select **File** > **New** > **Project**.
4849
1. Select **CMake Project** > **Next**
@@ -63,18 +64,19 @@ In the **CMakeSettings** dialog that appears, select **arm64-debug**, and then p
6364

6465
![Add arm64-debug configuration.](media/cmake-add-config-icon-with-target-dialog.png)
6566

66-
This adds a debug configuration named **arm64-Debug** to your *`CmakeSettings.json`* file. This configuration name is a unique, friendly name that makes it easier for you to identify these settings in the **Configuration** dropdown.
67+
This command adds a debug configuration named `arm64-Debug` to your *`CmakeSettings.json`* file. This configuration name is a unique, friendly name that makes it easier for you to identify these settings in the **Configuration** dropdown.
6768

68-
The **Toolset** dropdown will be set to **msvc_arm64_x64**. Your settings should now look like this:
69+
The **Toolset** dropdown is set to **msvc_arm64_x64**. Your settings should now look like this:
6970

7071
![CMake settings dialog.](media/cmake-settings-editor2.png)
7172

7273
> [!Note]
73-
> In the **Toolset** dropdown, **msvc_arm64** selects 32-bit host tools to cross-compile to ARM64, whereas **msvc_arm64 x64** selects 64-bit host tools to cross-compile to ARM64--which is what you will do in this tutorial.
74+
> In the **Toolset** dropdown, **msvc_arm64** selects 32-bit host tools to cross-compile to ARM64, whereas **msvc_arm64 x64** selects 64-bit host tools to cross-compile to ARM64, which is what you'll do in this tutorial.
75+
76+
Save the *`CMakeSettings.json`* file. In the configuration dropdown, select **arm64-debug**. (It may take a moment after saving the *`CMakeSettings.json`* file for it to appear in the list):
7477

75-
Save the `CMakeSettings.json` file. In the configuration dropdown, select **arm64-debug** (it may take a moment after saving the `CMakeSettings.json` file for it to appear in the list):
78+
![Ensure that arm64-debug is selected in the Visual Studio configurations drop-down.](media/vs2019-cmake-manage-configurations-arm.png)
7679

77-
![Ensure that arm64-debug is selected in the Visual Studio configurations drop-down.](media/vs2019-cmake-manage-configurations-arm.png)
7880

7981
## Add a debug configuration file
8082

@@ -90,18 +92,19 @@ Open the project folder (in this example, **CMakeProject3 Project**), and then r
9092

9193
![Select add debug configuration.](media/cmake-targets-add-debug-configuration.png)
9294

93-
This creates a `launch.vs.json` file in your project. Open it and change the following entries to enable remote debugging:
95+
This command creates a *`launch.vs.json`* file in your project. Open it and change the following entries to enable remote debugging:
9496

95-
- `projectTarget`: this is set for you if you added the debug configuration file from the **Solution Explorer** targets view per the instructions above.
97+
- `projectTarget`: this value is set for you if you added the debug configuration file from the **Solution Explorer** targets view per the instructions above.
9698
- `remoteMachineName`: set to the IP address of the remote ARM64 machine, or its machine name.
9799

98-
For more information about `launch.vs.json` settings, see [launch.vs.json schema reference](launch-vs-schema-reference-cpp.md).
100+
For more information about *`launch.vs.json`* settings, see [`launch.vs.json` schema reference](launch-vs-schema-reference-cpp.md).
99101

100102
> [!Note]
101-
> If you're using the folder view instead of the targets view in **Solution Explorer**, right-click the `CMakeLists.txt` file and select **Add Debug Configuration**. This experience differs from adding the debug configuration from the targets view in the following ways:
103+
> If you're using the folder view instead of the targets view in **Solution Explorer**, right-click the *`CMakeLists.txt`* file and select **Add Debug Configuration**. This experience differs from adding the debug configuration from the targets view in the following ways:
104+
>
102105
> - You'll be asked to select a debugger (select **C/C++ Remote Windows Debug**).
103-
> - Visual Studio will provide less configuration template information in the `launch.vs.json` file so you'll need to add it yourself. You'll need to provide the `remoteMachineName` and `projectTarget` entries. When you add the configuration from the targets view, you only need to specify `remoteMachineName`.
104-
> - For the `projectTarget` setting value, check the startup item dropdown to get the unique name of your target, for example, in this tutorial it is `CMakeProject3.exe'.
106+
> - Visual Studio will provide less configuration template information in the *`launch.vs.json`* file so you'll need to add it yourself. You'll need to provide the `remoteMachineName` and `projectTarget` entries. When you add the configuration from the targets view, you only need to specify `remoteMachineName`.
107+
> - For the `projectTarget` setting value, check the startup item dropdown to get the unique name of your target, for example, in this tutorial it is *`CMakeProject3.exe`*'.
105108
106109
## Start the remote debugger monitor on the remote Windows machine
107110

@@ -111,7 +114,7 @@ For example, on the remote machine, from the Visual Studio Remote Debugger menu
111114

112115
![Remote debugger authentication options.](media/remote-debugger-options.png)
113116

114-
Then, in Visual Studio on the host machine, update the `launch.vs.json` file to match. For example, if you choose **No Authentication** on the remote debugger, update the `launch.vs.json` file in your project by adding **"authenticationType": "none"** to the `configurations` section `launch.vs.json`. Otherwise, `"authenticationType"` defaults to `"windows"` and doesn't need to be explicitly stated. This example shows a `launch.vs.json` file configured for no authentication:
117+
Then, in Visual Studio on the host machine, update the *`launch.vs.json`* file to match. For example, if you choose **No Authentication** on the remote debugger, update the *`launch.vs.json`* file in your project by adding `"authenticationType": "none"` to the `configurations` section *`launch.vs.json`*. Otherwise, `"authenticationType"` defaults to `"windows"` and doesn't need to be explicitly stated. This example shows a *`launch.vs.json`* file configured for no authentication:
115118

116119
``` XAML
117120
{
@@ -147,19 +150,20 @@ On the host machine, in the Visual Studio **Solution Explorer**, open the CPP fi
147150

148151
The default CPP file is a simple hello world console app. Set a breakpoint on `return 0;`.
149152

150-
On the Visual Studio toolbar, use the **Startup Item** dropdown to select the name you specified for `"name"` in your `launch.vs.json` file:
153+
On the Visual Studio toolbar, use the **Startup Item** dropdown to select the name you specified for `"name"` in your *`launch.vs.json`* file:
151154

152155
![Example startup item dropdown with CMakeProject3.exe selected.](media/startup-item.png)
153156

154157
To start debugging, on the Visual Studio toolbar choose **Debug** > **Start Debugging** (or press **F5**).
155158

156-
If it doesn't start, ensure that the following are set correctly in the `launch.vs.json` file:
159+
If it doesn't start, ensure that the following are set correctly in the *`launch.vs.json`* file:
160+
157161
- `"remoteMachineName"` should be set to the IP address, or the machine name, of the remote ARM64 Windows machine.
158162
- `"name"` should match the selection in the Visual Studio startup item dropdown.
159163
- `"projectTarget"` should match the name of the CMake target you want to debug.
160164
- `"type"` should be `"remoteWindows"`
161-
- If the authentication type on the remote debugger is set to **No Authentication**, you should have `"authenticationType": "none"` set in the `launch.vs.json` file.
162-
- If you are using Windows authentication, sign in when prompted using an account recognized by the remote machine.
165+
- If the authentication type on the remote debugger is set to **No Authentication**, you should have `"authenticationType": "none"` set in the *`launch.vs.json`* file.
166+
- If you're using Windows authentication, sign in when prompted using an account recognized by the remote machine.
163167

164168
After the project builds, the app should appear on the remote ARM64 Windows machine:
165169

@@ -180,4 +184,4 @@ Learn more about configuring and debugging CMake projects in Visual Studio:
180184
> [Customize CMake build settings](customize-cmake-settings.md)\
181185
> [Configure CMake debugging sessions](configure-cmake-debugging-sessions.md)\
182186
> [CMake predefined configuration reference](cmake-predefined-configuration-reference.md)\
183-
[launch.vs.json schema reference](launch-vs-schema-reference-cpp.md)
187+
> [`launch.vs.json` schema reference](launch-vs-schema-reference-cpp.md)

0 commit comments

Comments
 (0)