vcpkg/scripts/buildsystems/msbuild/vcpkg.targets
2016-10-28 18:58:39 -07:00

59 lines
3.6 KiB
XML

<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition="'$(Platform)|$(ApplicationType)|$(ApplicationTypeRevision)' == 'Win32||'">
<VcpkgEnabled Condition="'$(VcpkgEnabled)' == ''">true</VcpkgEnabled>
<VcpkgTriplet Condition="'$(VcpkgTriplet)' == ''">x86-windows</VcpkgTriplet>
</PropertyGroup>
<PropertyGroup Condition="'$(Platform)|$(ApplicationType)|$(ApplicationTypeRevision)' == 'Win32|Windows Store|10.0'">
<VcpkgEnabled Condition="'$(VcpkgEnabled)' == ''">true</VcpkgEnabled>
<VcpkgTriplet Condition="'$(VcpkgTriplet)' == ''">x86-uwp</VcpkgTriplet>
</PropertyGroup>
<PropertyGroup Condition="'$(Platform)|$(ApplicationType)|$(ApplicationTypeRevision)' == 'x64||'">
<VcpkgEnabled Condition="'$(VcpkgEnabled)' == ''">true</VcpkgEnabled>
<VcpkgTriplet Condition="'$(VcpkgTriplet)' == ''">x64-windows</VcpkgTriplet>
</PropertyGroup>
<PropertyGroup Condition="'$(Platform)|$(ApplicationType)|$(ApplicationTypeRevision)' == 'x64|Windows Store|10.0'">
<VcpkgEnabled Condition="'$(VcpkgEnabled)' == ''">true</VcpkgEnabled>
<VcpkgTriplet Condition="'$(VcpkgTriplet)' == ''">x64-uwp</VcpkgTriplet>
</PropertyGroup>
<PropertyGroup Condition="'$(Platform)|$(ApplicationType)|$(ApplicationTypeRevision)' == 'arm|Windows Store|10.0'">
<VcpkgEnabled Condition="'$(VcpkgEnabled)' == ''">true</VcpkgEnabled>
<VcpkgTriplet Condition="'$(VcpkgTriplet)' == ''">arm-uwp</VcpkgTriplet>
</PropertyGroup>
<PropertyGroup Condition="'$(VcpkgEnabled)' == 'true'">
<VcpkgConfiguration Condition="'$(VcpkgConfiguration)' == ''">$(Configuration)</VcpkgConfiguration>
<!-- Expected to ..\..\..\ over scripts\buildsystems\msbuild -->
<VcpkgRoot Condition="'$(VcpkgRoot)' == ''">$(MSBuildThisFileDirectory)..\..\..\installed\$(VcpkgTriplet)\</VcpkgRoot>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(VcpkgEnabled)' == 'true'">
<Link>
<AdditionalDependencies Condition="'$(VcpkgConfiguration)' == 'Debug'">$(VcpkgRoot)debug\lib\*.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies Condition="'$(VcpkgConfiguration)' == 'Release'">$(VcpkgRoot)lib\*.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
<ClCompile>
<AdditionalIncludeDirectories>$(VcpkgRoot)include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
</ItemDefinitionGroup>
<Target Name="AppLocalFromInstalled" AfterTargets="CopyFilesToOutputDirectory" BeforeTargets="CopyLocalFilesOutputGroup" Condition="'$(VcpkgEnabled)' == 'true' and '$(OutputType)' == 'exe'">
<WriteLinesToFile
File="$(TLogLocation)$(ProjectName).write.1u.tlog"
Lines="^$(OutputPath)$(TargetName).$(OutputType);" Encoding="Unicode"/>
<Exec Condition="'$(VcpkgConfiguration)' == 'Debug'"
Command="powershell.exe -ExecutionPolicy Unrestricted -noprofile -File %22$(MSBuildThisFileDirectory)applocal.ps1%22 %22$(OutputPath)$(TargetName).$(OutputType)%22 %22$(VcpkgRoot)debug\bin%22 %22$(TLogLocation)$(ProjectName).write.1u.tlog%22"
ConsoleToMSBuild="true">
<Output TaskParameter="ConsoleOutput" ItemName="ReferenceCopyLocalPaths" />
</Exec>
<Exec Condition="'$(VcpkgConfiguration)' == 'Release'"
Command="powershell.exe -ExecutionPolicy Unrestricted -noprofile -File %22$(MSBuildThisFileDirectory)applocal.ps1%22 %22$(OutputPath)$(TargetName).$(OutputType)%22 %22$(VcpkgRoot)bin%22 %22$(TLogLocation)$(ProjectName).write.1u.tlog%22"
ConsoleToMSBuild="true">
<Output TaskParameter="ConsoleOutput" ItemName="ReferenceCopyLocalPaths" />
</Exec>
</Target>
</Project>