diff --git a/docs/users/manifests.md b/docs/users/manifests.md index 8f62ea81b1..c5addbba73 100644 --- a/docs/users/manifests.md +++ b/docs/users/manifests.md @@ -15,7 +15,7 @@ rather than global to a system or user. In manifest mode, an installed tree is associated with a particular project rather than the vcpkg installation. The set of installed ports is controlled by editing the project's "manifest file", and the installed tree is placed in the project directory or build directory. -This mode acts more similarly to language package managers like Cargo, or npm. +This mode acts more similarly to language package managers like Cargo, or npm. We recommend using this manifest mode whenever possible, because it allows one to encode a project's dependencies explicitly in a project file, rather than in the documentation, making your project much easier to consume. @@ -351,3 +351,7 @@ This property must be set to true in order to consume from a local vcpkg.json fi This property can be set to "false" to disable automatic dependency restoration on project build. Dependencies can be manually restored via the vcpkg command line. +#### `VcpkgInstalledDirectory` (Installed Directory) + +This property defines the location where headers and binaries are consumed from. In manifest mode, this directory is created and populated based on your manifest. + diff --git a/scripts/buildsystems/msbuild/vcpkg-general.xml b/scripts/buildsystems/msbuild/vcpkg-general.xml index 0c32c4a846..49865e74e4 100644 --- a/scripts/buildsystems/msbuild/vcpkg-general.xml +++ b/scripts/buildsystems/msbuild/vcpkg-general.xml @@ -55,11 +55,8 @@ - - - - + + @@ -18,12 +18,12 @@ $(VcpkgRoot)\ $(VcpkgManifestRoot)\ - $([System.IO.Path]::Combine($(VcpkgRoot), 'installed')) - $([System.IO.Path]::Combine($(VcpkgManifestRoot), 'vcpkg_installed')) + $([System.IO.Path]::Combine($(VcpkgRoot), 'installed')) + $([System.IO.Path]::Combine($(VcpkgManifestRoot), 'vcpkg_installed')) $(VcpkgInstalledDir)\ - $([System.IO.Path]::Combine($(VcpkgInstalledDir), $(VcpkgTriplet))) - $(VcpkgCurrentInstalledDir)\ + <_ZVcpkgCurrentInstalledDir>$([System.IO.Path]::Combine($(VcpkgInstalledDir), $(VcpkgTriplet))) + <_ZVcpkgCurrentInstalledDir Condition="!$(_ZVcpkgCurrentInstalledDir.EndsWith('\'))">$(_ZVcpkgCurrentInstalledDir)\ Debug Release @@ -42,14 +42,14 @@ - %(AdditionalDependencies);$(VcpkgCurrentInstalledDir)$(VcpkgConfigSubdir)lib\*.lib - %(AdditionalLibraryDirectories);$(VcpkgCurrentInstalledDir)$(VcpkgConfigSubdir)lib;$(VcpkgCurrentInstalledDir)$(VcpkgConfigSubdir)lib\manual-link + %(AdditionalDependencies);$(_ZVcpkgCurrentInstalledDir)$(VcpkgConfigSubdir)lib\*.lib + %(AdditionalLibraryDirectories);$(_ZVcpkgCurrentInstalledDir)$(VcpkgConfigSubdir)lib;$(_ZVcpkgCurrentInstalledDir)$(VcpkgConfigSubdir)lib\manual-link - %(AdditionalIncludeDirectories);$(VcpkgCurrentInstalledDir)include + %(AdditionalIncludeDirectories);$(_ZVcpkgCurrentInstalledDir)include - %(AdditionalIncludeDirectories);$(VcpkgCurrentInstalledDir)include + %(AdditionalIncludeDirectories);$(_ZVcpkgCurrentInstalledDir)include @@ -61,7 +61,7 @@ - @@ -70,26 +70,30 @@ - <_VcpkgInstallManifestDependenciesInputs Include="$(VcpkgManifestRoot)vcpkg.json"/> - <_VcpkgInstallManifestDependenciesInputs Include="$(VcpkgManifestRoot)vcpkg-configuration.json" Condition="Exists('$(VcpkgManifestRoot)vcpkg-configuration.json')"/> + <_ZVcpkgInstallManifestDependenciesInputs Include="$(VcpkgManifestRoot)vcpkg.json"/> + <_ZVcpkgInstallManifestDependenciesInputs Include="$(VcpkgManifestRoot)vcpkg-configuration.json" Condition="Exists('$(VcpkgManifestRoot)vcpkg-configuration.json')"/> + Inputs="@(_ZVcpkgInstallManifestDependenciesInputs)" + Outputs="$(TLogLocation)VcpkgInstallManifest$(VcpkgTriplet).read.1u.tlog;$(VcpkgInstalledDir).msbuildstamp-$(VcpkgTriplet)"> <_VcpkgItemToDelete Include="$(TLogLocation)VcpkgInstallManifest*.read.1u.tlog" /> + <_VcpkgItemToDelete Include="$(VcpkgInstalledDir).msbuildstamp-*" /> + + @@ -100,7 +104,7 @@ Condition="'$(VcpkgEnabled)' == 'true' and '$(VcpkgApplocalDeps)' == 'true' and '$(LinkSkippedExecution)' != 'true'"> - <_VcpkgAppLocalPowerShellCommonArguments>-ExecutionPolicy Bypass -noprofile -File "$(MSBuildThisFileDirectory)applocal.ps1" "$(TargetPath)" "$(VcpkgCurrentInstalledDir)$(VcpkgConfigSubdir)bin" "$(TLogLocation)$(ProjectName).write.1u.tlog" "$(IntDir)vcpkg.applocal.log" + <_VcpkgAppLocalPowerShellCommonArguments>-ExecutionPolicy Bypass -noprofile -File "$(MSBuildThisFileDirectory)applocal.ps1" "$(TargetPath)" "$(_ZVcpkgCurrentInstalledDir)$(VcpkgConfigSubdir)bin" "$(TLogLocation)$(ProjectName).write.1u.tlog" "$(IntDir)vcpkg.applocal.log"