PS D:\src\vcpkg> .\vcpkg integrate project
Created nupkg: D:\src\vcpkg\scripts\buildsystems\vcpkg.D.src.vcpkg.1.0.0.nupkg
With a project open, go to Tools->NuGet Package Manager->Package Manager Console and paste:
Install-Package vcpkg.D.src.vcpkg -Source "D:/src/vcpkg/scripts/buildsystems"
The generated NuGet package does not contain the actual libraries. It instead acts like a
shortcut (or symlink) to the vcpkg install and will "automatically" update with any changes
(install/remove) to the libraries. You do not need to regenerate or update the NuGet package.
Common Configuration
VcpkgEnabled
(Use Vcpkg)
This can be set to "false" to explicitly disable vcpkg integration for the project
VcpkgConfiguration
(Vcpkg Configuration)
If your configuration names are too complex for vcpkg to guess correctly, you can assign this
property to Release
or Debug
to explicitly tell vcpkg what variant of libraries you want to
consume.
VcpkgEnableManifest
(Use Vcpkg Manifest)
This property must be set to true
in order to consume from a local vcpkg.json
file. If set to
false
, any local vcpkg.json
files will be ignored.
This currently defaults to false
, but will default to true
in the future.
VcpkgTriplet
(Triplet)
This property controls the triplet to consume libraries from, such as x64-windows-static
or
arm64-windows
.
If this is not explicitly set, vcpkg will deduce the correct triplet based on your Visual Studio
settings. vcpkg will only deduce triplets that use dynamic library linkage and dynamic CRT linkage;
if you want static dependencies or to use the static CRT (/MT
), you will need to set the triplet
manually.
You can see the automatically deduced triplet by setting your MSBuild verbosity to Normal or higher:
Shortcut: Ctrl+Q "build and run"
Tools -> Options -> Projects and Solutions -> Build and Run -> MSBuild project build output
verbosity
See also Triplets
VcpkgHostTriplet
(Host Triplet)
This can be set to a custom triplet to use for resolving host dependencies.
If unset, this will default to the "native" triplet (x64-windows).
See also Host dependencies.
VcpkgInstalledDir
(Installed Directory)
This property defines the location vcpkg will install and consume libraries from.
In manifest mode, this defaults to $(VcpkgManifestRoot)\vcpkg_installed\$(VcpkgTriplet)\
. In
classic mode, this defaults to $(VcpkgRoot)\installed\
.
VcpkgApplocalDeps
(App-locally deploy DLLs)
This property enables or disables detection and copying of dependent DLLs from the vcpkg installed
tree to the project output directory.
VcpkgXUseBuiltInApplocalDeps
(Use built-in app-local deployment)
This property, when enabled, uses vcpkg's experimental built-in app-local DLL deployment
implementation when app-locally deploying DLLs. This property will be removed and have no effect
when the built-in implementation is no longer experimental.
This property has no effect when $(VcpkgApplocalDeps)
is false.
Manifest mode configuration
To use manifests
(vcpkg.json
) with MSBuild, first you need to
use one of the integration methods above. Then, add a vcpkg.json above your
project file (such as in the root of your source repository) and set the property
VcpkgEnableManifest
to true
. You can set this property via the IDE in
Project Properties > Vcpkg > Use Vcpkg Manifest. You may need to
reload the IDE to see the vcpkg Property Page.
vcpkg will run during your project's build and install any listed dependencies to
vcpkg_installed/$(VcpkgTriplet)/
adjacent to the vcpkg.json
file; these libraries will then
automatically be included in and linked to your MSBuild projects.
Known issues
Visual Studio 2015 does not correctly track edits to the vcpkg.json
and
vcpkg-configuration.json
files, and will not respond to changes unless a .cpp
is edited.
VcpkgAdditionalInstallOptions
(Additional Options)
When using a manifest, this option specifies additional command line flags to pass to the underlying
vcpkg tool invocation. This can be used to access features that have not yet been exposed through
another option.
VcpkgManifestInstall
(Install Vcpkg Dependencies)
This property can be set to false
to disable automatic dependency restoration during project
build. Dependencies must be manually restored via the vcpkg command line separately.