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/linux/cmake-linux-project.md
+8-9Lines changed: 8 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,20 +1,20 @@
1
1
---
2
2
title: "Create and configure a Linux CMake project in Visual Studio"
3
3
description: "How to create, configure, edit, and compile a Linux CMake project in Visual Studio"
4
-
ms.date: "07/22/2020"
4
+
ms.date: "07/23/2020"
5
5
ms.assetid: f8707b32-f90d-494d-ae0b-1d44425fdc25
6
6
---
7
7
# Create and configure a Linux CMake project
8
8
9
-
We recommend that you use CMake for projects that are cross-platform or that you think you might make open-source. You can use CMake projects to build and debug the same source code on Windows, the Windows Subsystem for Linux (WSL), and remote systems.
10
-
11
-
This article describes how to create a new CMake project and configure it to build and debug on a remote Linux system or WSL.
12
-
13
9
::: moniker range="vs-2015"
14
10
Linux support is available in Visual Studio 2017 and later. To see the documentation for these versions, set the Visual Studio **Version** selector control for this article to Visual Studio 2017 or Visual Studio 2019. It's found at the top of the table of contents on this page.
15
-
16
11
::: moniker-end
12
+
17
13
::: moniker range=">=vs-2017"
14
+
We recommend that you use CMake for projects that are cross-platform or that you think you might make open-source. You can use CMake projects to build and debug the same source code on Windows, the Windows Subsystem for Linux (WSL), and remote systems.
15
+
16
+
This article describes how to create a new CMake project and configure it to build and debug on a remote Linux system or WSL.
17
+
18
18
## Before you begin
19
19
20
20
First, make sure you have the Visual Studio Linux workload installed, including the CMake component. That's the **Linux development with C++** workload in the Visual Studio installer. See [Install the C++ Linux workload in Visual Studio](download-install-and-setup-the-linux-development-workload.md) if you aren't sure that you have that installed.
@@ -26,16 +26,15 @@ Also, make sure the following are installed on the remote machine:
26
26
- rsync
27
27
- zip
28
28
- ninja-build
29
-
30
29
::: moniker-end
31
-
::: moniker range="vs-2017"
32
30
31
+
::: moniker range="vs-2017"
33
32
The CMake support in Visual Studio requires the server mode support that was introduced in CMake 3.8. For a Microsoft-provided CMake variant, download the latest prebuilt binaries at [https://github.com/Microsoft/CMake/releases](https://github.com/Microsoft/CMake/releases).
34
33
35
34
The binaries are installed in `~/.vs/cmake`. After deploying the binaries, your project automatically regenerates. If the CMake specified by the `cmakeExecutable` field in *CMakeSettings.json* is invalid (it doesn't exist or is an unsupported version), and the prebuilt binaries are present, Visual Studio ignores `cmakeExecutable` and uses the prebuilt binaries.
36
35
::: moniker-end
37
-
::: moniker range=">=vs-2019"
38
36
37
+
::: moniker range=">=vs-2019"
39
38
Linux support for CMake projects requires that the target machine have a recent version of CMake. Often, the version offered by a distribution's default package manager isn't recent enough to support all the features required by Visual Studio. Visual Studio 2019 detects whether a recent version of CMake is installed on the Linux system. If none is found, Visual Studio shows an info-bar at the top of the editor pane. It offers to install CMake for you from [https://github.com/Microsoft/CMake/releases](https://github.com/Microsoft/CMake/releases).
40
39
41
40
You can use Visual Studio 2019 to build and debug on a remote Linux system or WSL, and CMake will be invoked on that system. Cmake version 3.14 or later should be installed on the target machine.
0 commit comments