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/vcpkg.md
+19-9Lines changed: 19 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -1,38 +1,40 @@
1
1
---
2
-
title: vcpkg\: a C++ package Manager for Windows| Microsoft Docs
2
+
title: vcpkg\: a C++ package manager for Windows, Linux and MacOS | Microsoft Docs
3
3
description: vcpkg is a command line package manager that greatly simplifies the acquisition and installation of open-source C++ libraries on Windows.
4
4
keywords: vcpkg
5
5
author: mikeblome
6
6
ms.author: mblome
7
-
ms.date: 04/06/2018
7
+
ms.date: 05/14/2018
8
8
ms.technology: ["cpp-ide"]
9
9
ms.tgt_pltfrm: "windows"
10
10
ms.assetid: f50d459a-e18f-4b4e-814b-913e444cedd6
11
11
ms.topic: "conceptual"
12
12
dev_langs: ["C++"]
13
13
ms.workload: ["cplusplus"]
14
14
---
15
-
# vcpkg: C++ Package Manager for Windows
15
+
# vcpkg: C++ package manager
16
16
17
-
vcpkg is a command-line package manager that greatly simplifies the acquisition and installation of third-party libraries on Windows. If your project uses third-party libraries, we recommend that you use vcpkg to install them. vcpkg supports both open-source and proprietary libraries. All libraries in the vcpkg public catalog have been tested for compatibility with Visual Studio 2015 and Visual Studio 2017. As of January 2018 there are over 600 libraries in the catalog and the C++ community is adding more libraries on an ongoing basis.
17
+
vcpkg is a command-line package manager that greatly simplifies the acquisition and installation of third-party libraries on Windows, Linux and MacOS. If your project uses third-party libraries, we recommend that you use vcpkg to install them. vcpkg supports both open-source and proprietary libraries. All libraries in the vcpkg public catalog have been tested for compatibility with Visual Studio 2015 and Visual Studio 2017. As of May 2018 there are over 900 libraries in the Windows catalog and 350 in the Linux/MacOS catalog. The C++ community is adding more libraries to both catalogs on an ongoing basis.
18
18
19
19
## Simple yet flexible
20
20
21
21
With a single command, you can download sources and build a library. vcpkg is itself an open-source project, available on GitHub. You can customize your private clone(s) in any way you like. For example, you can specify different libraries, or different versions of libraries than what are found in the public catalog. You can have multiple clones of vcpkg on a single machine, each one producing custom sets of libraries and/or compilation switches, etc. Each clone is a self-contained, x-copyable environment with its own copy of vcpkg.exe that operates only on its own hierarchy. vcpkg is not added to any environment variables, and has no dependency on the Windows Registry or Visual Studio.
22
22
23
23
## Sources not binaries
24
24
25
-
For libraries in the public catalog, vcpkg downloads sources instead of binaries[1]. It compiles those sources using Visual Studio 2017, or Visual Studio 2015 if 2017 is not installed. In C++, it is very important that any libraries you use are complied with the same compiler, and compiler version, as the application code that links to it. By using vcpkg, you eliminate or at least greatly reduce the potential for mismatched binaries and the problems they can cause. In teams that are standardized on a specific version of the Visual C++ compiler, one team member can use vcpkg to download sources and compile a set of binaries and then use the export command to zip up the binaries and headers for other team members. For more information, see Export compiled binaries and headers below.
25
+
For libraries in the public catalog, vcpkg downloads sources instead of binaries[1]. It compiles those sources using Visual Studio 2017, or Visual Studio 2015 if 2017 is not installed. In C++, it is very important that any libraries you use are complied with the same compiler, and compiler version, as the application code that links to it. By using vcpkg, you eliminate or at least greatly reduce the potential for mismatched binaries and the problems they can cause. In teams that are standardized on a specific version of the Visual C++ compiler, one team member can use vcpkg to download sources and compile a set of binaries and then use the export command to zip up the binaries and headers for other team members. For more information, see [Export compiled binaries and headers](#export_binaries_per_project) below.
26
26
27
27
If you create a vcpkg clone with private libraries in the ports collection, you can add a port that downloads prebuilt binaries and headers and write a portfile.cmake file that simply copies those files to the desired location.
28
28
29
29
[1]*Note: for some proprietary libraries, sources are not available. Vcpkg will download compatible prebuilt binaries in these cases.*
30
30
31
-
## Installation
31
+
## Installation
32
32
33
33
Clone the vcpkg repo from GitHub: https://github.com/Microsoft/vcpkg. You can download to any folder location you prefer.
34
34
35
-
Run the bootstrapper in the root folder: **bootstrap-vcpkg.bat**.
After you get the name of a library by using **vcpkg search**, you use **vcpkg install** to download the library and compile it. vcpkg uses the library's portfile in the ports directory. If no triplet is specified, vcpkg will install and compile for x86-windows. If the portfile specifies dependencies, vcpkg downloads and installs those also. After downloading, vcpkg builds the library by using whatever build system the library uses. CMake and MSBuild projects files are preferred, but MAKE is supported along with any other build system. If vcpkg cannot find the specified build system on the local machine, it downloads and installs it.
69
+
After you get the name of a library by using **vcpkg search**, you use **vcpkg install** to download the library and compile it. vcpkg uses the library's portfile in the ports directory. If no triplet is specified, vcpkg will install and compile for x86-windows. If the portfile specifies dependencies, vcpkg downloads and installs those also. After downloading, vcpkg builds the library by using whatever build system the library uses. CMake and MSBuild projects (on Windows) are preferred, but MAKE is supported along with any other build system. If vcpkg cannot find the specified build system on the local machine, it downloads and installs it.
68
70
69
71
```cmd
70
72
> vcpkg install boost:x86-windows
@@ -74,6 +76,14 @@ The following packages will be built and installed:
74
76
* bzip2:x86-windows
75
77
* zlib:x86-windows
76
78
Additional packages (*) will be installed to complete this operation.
79
+
80
+
```
81
+
82
+
For CMAKE projects, use use CMAKE_TOOLCHAIN_FILE to make libraries available with `find_package()`. For example,
@@ -110,7 +120,7 @@ If you need to use a specific version of a library that is different from the ve
110
120
1. Run **vcpkg install \<library>**.
111
121
1. Use **vcpkg integrate project** to create a NuGet package that references that library on a per-project basis.
112
122
113
-
## Export compiled binaries and headers
123
+
## <aname="export_binaries_per_project"></a> Export compiled binaries and headers
114
124
115
125
Requiring everyone on a team to download and build libraries can be inefficient. A single team member can do that work, and then use **vcpkg export** to create a zip file of the binaries and headers that can be easily shared with other team members.
0 commit comments