Skip to content

Commit

Permalink
Configure directory where msbuild will copy CefSharp files (#1753)
Browse files Browse the repository at this point in the history
* Reflect correct target directory in msbuild message for x64 files on AnyCPU platform

* Introduce $(CefSharpTargetDir) msbuild property to make it easily overridable
  • Loading branch information
intrueder authored and amaitland committed Aug 19, 2016
1 parent 79f3844 commit 2f69165
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 37 deletions.
54 changes: 29 additions & 25 deletions NuGet/CefSharp.Common.targets
Original file line number Diff line number Diff line change
Expand Up @@ -4,50 +4,54 @@
<Error Text="$(MSBuildThisFileName) will work out of the box if you specify platform (x86 / x64). For AnyCPU Support see https://github.com/cefsharp/CefSharp/issues/1714" />
</Target>

<PropertyGroup>
<CefSharpTargetDir Condition=" '$(CefSharpTargetDir)' == '' ">$(TargetDir)</CefSharpTargetDir>
</PropertyGroup>

<Target Name="CefSharpCopyLibs86" BeforeTargets="AfterBuild" Condition="'$(Platform)' == 'x86'">
<ItemGroup>
<CefSharpBinaries Include="$(MSBuildThisFileDirectory)..\CefSharp\x86\*.*" />
</ItemGroup>

<Message Importance="high" Text="Copying cef.redist x86 binaries" />
<Copy SourceFiles="@(CefBinaries32)" DestinationFolder="$(TargetDir)" SkipUnchangedFiles="true" />
<Copy SourceFiles="@(CefBinaries32)" DestinationFolder="$(CefSharpTargetDir)" SkipUnchangedFiles="true" />
<Message Importance="high" Text="Copying cef.redist x86 pak files" />
<Copy SourceFiles="@(CefPakFiles32)" DestinationFolder="$(TargetDir)" SkipUnchangedFiles="true" />
<Copy SourceFiles="@(CefPakFiles32)" DestinationFolder="$(CefSharpTargetDir)" SkipUnchangedFiles="true" />
<Message Importance="high" Text="Copying cef.redist x86 locales " />
<Copy SourceFiles="@(CefLocales32)" DestinationFolder="$(TargetDir)\locales" SkipUnchangedFiles="true" />
<Copy SourceFiles="@(CefLocales32)" DestinationFolder="$(CefSharpTargetDir)\locales" SkipUnchangedFiles="true" />

<Message Importance="high" Text="-- CefSharp.Common.targets: Copying files from $(MSBuildThisFileDirectory)..\CefSharp\x86 to $(TargetDir)" />
<Copy SourceFiles="@(CefSharpBinaries)" DestinationFolder="$(TargetDir)" SkipUnchangedFiles="true" />
<Message Importance="high" Text="-- CefSharp.Common.targets: Copying files from $(MSBuildThisFileDirectory)..\CefSharp\x86 to $(CefSharpTargetDir)" />
<Copy SourceFiles="@(CefSharpBinaries)" DestinationFolder="$(CefSharpTargetDir)" SkipUnchangedFiles="true" />
</Target>

<Target Name="CefSharpCopyLibsWin32" BeforeTargets="AfterBuild" Condition="'$(Platform)' == 'Win32'">
<ItemGroup>
<CefSharpBinaries Include="$(MSBuildThisFileDirectory)..\CefSharp\x86\*.*" />
</ItemGroup>
<Message Importance="high" Text="Copying cef.redist x86 binaries" />
<Copy SourceFiles="@(CefBinaries32)" DestinationFolder="$(TargetDir)" SkipUnchangedFiles="true" />
<Copy SourceFiles="@(CefBinaries32)" DestinationFolder="$(CefSharpTargetDir)" SkipUnchangedFiles="true" />
<Message Importance="high" Text="Copying cef.redist x86 pak files" />
<Copy SourceFiles="@(CefPakFiles32)" DestinationFolder="$(TargetDir)" SkipUnchangedFiles="true" />
<Copy SourceFiles="@(CefPakFiles32)" DestinationFolder="$(CefSharpTargetDir)" SkipUnchangedFiles="true" />
<Message Importance="high" Text="Copying cef.redist x86 locales " />
<Copy SourceFiles="@(CefLocales32)" DestinationFolder="$(TargetDir)\locales" SkipUnchangedFiles="true" />
<Copy SourceFiles="@(CefLocales32)" DestinationFolder="$(CefSharpTargetDir)\locales" SkipUnchangedFiles="true" />

<Message Importance="high" Text="-- CefSharp.Common.targets: Copying files from $(MSBuildThisFileDirectory)..\CefSharp\x86 to $(TargetDir)" />
<Copy SourceFiles="@(CefSharpBinaries)" DestinationFolder="$(TargetDir)" SkipUnchangedFiles="true" />
<Message Importance="high" Text="-- CefSharp.Common.targets: Copying files from $(MSBuildThisFileDirectory)..\CefSharp\x86 to $(CefSharpTargetDir)" />
<Copy SourceFiles="@(CefSharpBinaries)" DestinationFolder="$(CefSharpTargetDir)" SkipUnchangedFiles="true" />
</Target>

<Target Name="CefSharpCopyLibs64" BeforeTargets="AfterBuild" Condition="'$(Platform)' == 'x64'">
<ItemGroup>
<CefSharpBinaries Include="$(MSBuildThisFileDirectory)..\CefSharp\x64\*.*" />
</ItemGroup>
<Message Importance="high" Text="Copying cef.redist x64 binaries" />
<Copy SourceFiles="@(CefBinaries64)" DestinationFolder="$(TargetDir)" SkipUnchangedFiles="true" />
<Copy SourceFiles="@(CefBinaries64)" DestinationFolder="$(CefSharpTargetDir)" SkipUnchangedFiles="true" />
<Message Importance="high" Text="Copying cef.redist x64 pak files" />
<Copy SourceFiles="@(CefPakFiles64)" DestinationFolder="$(TargetDir)" SkipUnchangedFiles="true" />
<Copy SourceFiles="@(CefPakFiles64)" DestinationFolder="$(CefSharpTargetDir)" SkipUnchangedFiles="true" />
<Message Importance="high" Text="Copying cef.redist x64 locales " />
<Copy SourceFiles="@(CefLocales64)" DestinationFolder="$(TargetDir)\locales" SkipUnchangedFiles="true" />
<Copy SourceFiles="@(CefLocales64)" DestinationFolder="$(CefSharpTargetDir)\locales" SkipUnchangedFiles="true" />

<Message Importance="high" Text="-- CefSharp.Common.targets: Copying files from $(MSBuildThisFileDirectory)..\CefSharp\x64 to $(TargetDir)" />
<Copy SourceFiles="@(CefSharpBinaries)" DestinationFolder="$(TargetDir)" SkipUnchangedFiles="true" />
<Message Importance="high" Text="-- CefSharp.Common.targets: Copying files from $(MSBuildThisFileDirectory)..\CefSharp\x64 to $(CefSharpTargetDir)" />
<Copy SourceFiles="@(CefSharpBinaries)" DestinationFolder="$(CefSharpTargetDir)" SkipUnchangedFiles="true" />
</Target>

<Target Name="CefSharpCopyLibsAnyCPU" BeforeTargets="AfterBuild" Condition="'$(Platform)' == 'AnyCPU'">
Expand All @@ -56,22 +60,22 @@
<CefSharpBinaries64 Include="$(MSBuildThisFileDirectory)..\CefSharp\x64\*.*" />
</ItemGroup>

<Copy SourceFiles="@(CefBinaries32)" DestinationFolder="$(TargetDir)\x86" SkipUnchangedFiles="true" />
<Copy SourceFiles="@(CefBinaries32)" DestinationFolder="$(CefSharpTargetDir)\x86" SkipUnchangedFiles="true" />
<Message Importance="high" Text="Copying cef.redist x86 pak files" />
<Copy SourceFiles="@(CefPakFiles32)" DestinationFolder="$(TargetDir)\x86" SkipUnchangedFiles="true" />
<Copy SourceFiles="@(CefPakFiles32)" DestinationFolder="$(CefSharpTargetDir)\x86" SkipUnchangedFiles="true" />
<Message Importance="high" Text="Copying cef.redist x86 locales " />
<Copy SourceFiles="@(CefLocales32)" DestinationFolder="$(TargetDir)\x86\locales" SkipUnchangedFiles="true" />
<Copy SourceFiles="@(CefLocales32)" DestinationFolder="$(CefSharpTargetDir)\x86\locales" SkipUnchangedFiles="true" />

<Message Importance="high" Text="Copying cef.redist x64 binaries" />
<Copy SourceFiles="@(CefBinaries64)" DestinationFolder="$(TargetDir)\x64" SkipUnchangedFiles="true" />
<Copy SourceFiles="@(CefBinaries64)" DestinationFolder="$(CefSharpTargetDir)\x64" SkipUnchangedFiles="true" />
<Message Importance="high" Text="Copying cef.redist x64 pak files" />
<Copy SourceFiles="@(CefPakFiles64)" DestinationFolder="$(TargetDir)\x64" SkipUnchangedFiles="true" />
<Copy SourceFiles="@(CefPakFiles64)" DestinationFolder="$(CefSharpTargetDir)\x64" SkipUnchangedFiles="true" />
<Message Importance="high" Text="Copying cef.redist x64 locales " />
<Copy SourceFiles="@(CefLocales64)" DestinationFolder="$(TargetDir)\x64\locales" SkipUnchangedFiles="true" />
<Copy SourceFiles="@(CefLocales64)" DestinationFolder="$(CefSharpTargetDir)\x64\locales" SkipUnchangedFiles="true" />

<Message Importance="high" Text="-- CefSharp.Common.targets: Copying files from $(MSBuildThisFileDirectory)..\CefSharp\x86 to $(TargetDir)\x86" />
<Copy SourceFiles="@(CefSharpBinaries32)" DestinationFolder="$(TargetDir)\x86" SkipUnchangedFiles="true" />
<Message Importance="high" Text="-- CefSharp.Common.targets: Copying files from $(MSBuildThisFileDirectory)..\CefSharp\x64 to $(TargetDir)" />
<Copy SourceFiles="@(CefSharpBinaries64)" DestinationFolder="$(TargetDir)\x64" SkipUnchangedFiles="true" />
<Message Importance="high" Text="-- CefSharp.Common.targets: Copying files from $(MSBuildThisFileDirectory)..\CefSharp\x86 to $(CefSharpTargetDir)\x86" />
<Copy SourceFiles="@(CefSharpBinaries32)" DestinationFolder="$(CefSharpTargetDir)\x86" SkipUnchangedFiles="true" />
<Message Importance="high" Text="-- CefSharp.Common.targets: Copying files from $(MSBuildThisFileDirectory)..\CefSharp\x64 to $(CefSharpTargetDir)\x64" />
<Copy SourceFiles="@(CefSharpBinaries64)" DestinationFolder="$(CefSharpTargetDir)\x64" SkipUnchangedFiles="true" />
</Target>
</Project>
12 changes: 8 additions & 4 deletions NuGet/CefSharp.OffScreen.targets
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<CefSharpTargetDir Condition=" '$(CefSharpTargetDir)' == '' ">$(TargetDir)</CefSharpTargetDir>
</PropertyGroup>

<Target Name="CefSharpCopyOffScreenAnyCPU" BeforeTargets="AfterBuild" Condition="'$(Platform)' == 'AnyCPU'">
<ItemGroup>
<CefSharpBinaries32 Include="$(MSBuildThisFileDirectory)..\CefSharp\x86\*.*" />
<CefSharpBinaries64 Include="$(MSBuildThisFileDirectory)..\CefSharp\x64\*.*" />
</ItemGroup>

<Message Importance="high" Text="-- CefSharp.OffScreen.targets: Copying files from $(MSBuildThisFileDirectory)..\CefSharp\x86 to $(TargetDir)\x86" />
<Copy SourceFiles="@(CefSharpBinaries32)" DestinationFolder="$(TargetDir)\x86" SkipUnchangedFiles="true" />
<Message Importance="high" Text="-- CefSharp.OffScreen.targets: Copying files from $(MSBuildThisFileDirectory)..\CefSharp\x64 to $(TargetDir)" />
<Copy SourceFiles="@(CefSharpBinaries64)" DestinationFolder="$(TargetDir)\x64" SkipUnchangedFiles="true" />
<Message Importance="high" Text="-- CefSharp.OffScreen.targets: Copying files from $(MSBuildThisFileDirectory)..\CefSharp\x86 to $(CefSharpTargetDir)\x86" />
<Copy SourceFiles="@(CefSharpBinaries32)" DestinationFolder="$(CefSharpTargetDir)\x86" SkipUnchangedFiles="true" />
<Message Importance="high" Text="-- CefSharp.OffScreen.targets: Copying files from $(MSBuildThisFileDirectory)..\CefSharp\x64 to $(CefSharpTargetDir)\x64" />
<Copy SourceFiles="@(CefSharpBinaries64)" DestinationFolder="$(CefSharpTargetDir)\x64" SkipUnchangedFiles="true" />
</Target>
</Project>
12 changes: 8 additions & 4 deletions NuGet/CefSharp.WinForms.targets
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<CefSharpTargetDir Condition=" '$(CefSharpTargetDir)' == '' ">$(TargetDir)</CefSharpTargetDir>
</PropertyGroup>

<Target Name="CefSharpCopyWinFormsAnyCPU" BeforeTargets="AfterBuild" Condition="'$(Platform)' == 'AnyCPU'">
<ItemGroup>
<CefSharpBinaries32 Include="$(MSBuildThisFileDirectory)..\CefSharp\x86\*.*" />
<CefSharpBinaries64 Include="$(MSBuildThisFileDirectory)..\CefSharp\x64\*.*" />
</ItemGroup>

<Message Importance="high" Text="-- CefSharp.WinForms.targets: Copying files from $(MSBuildThisFileDirectory)..\CefSharp\x86 to $(TargetDir)\x86" />
<Copy SourceFiles="@(CefSharpBinaries32)" DestinationFolder="$(TargetDir)\x86" SkipUnchangedFiles="true" />
<Message Importance="high" Text="-- CefSharp.WinForms.targets: Copying files from $(MSBuildThisFileDirectory)..\CefSharp\x64 to $(TargetDir)" />
<Copy SourceFiles="@(CefSharpBinaries64)" DestinationFolder="$(TargetDir)\x64" SkipUnchangedFiles="true" />
<Message Importance="high" Text="-- CefSharp.WinForms.targets: Copying files from $(MSBuildThisFileDirectory)..\CefSharp\x86 to $(CefSharpTargetDir)\x86" />
<Copy SourceFiles="@(CefSharpBinaries32)" DestinationFolder="$(CefSharpTargetDir)\x86" SkipUnchangedFiles="true" />
<Message Importance="high" Text="-- CefSharp.WinForms.targets: Copying files from $(MSBuildThisFileDirectory)..\CefSharp\x64 to $(CefSharpTargetDir)\x64" />
<Copy SourceFiles="@(CefSharpBinaries64)" DestinationFolder="$(CefSharpTargetDir)\x64" SkipUnchangedFiles="true" />
</Target>
</Project>
12 changes: 8 additions & 4 deletions NuGet/CefSharp.Wpf.targets
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<CefSharpTargetDir Condition=" '$(CefSharpTargetDir)' == '' ">$(TargetDir)</CefSharpTargetDir>
</PropertyGroup>

<Target Name="CefSharpCopyWpfAnyCPU" BeforeTargets="AfterBuild" Condition="'$(Platform)' == 'AnyCPU'">
<ItemGroup>
<CefSharpBinaries32 Include="$(MSBuildThisFileDirectory)..\CefSharp\x86\*.*" />
<CefSharpBinaries64 Include="$(MSBuildThisFileDirectory)..\CefSharp\x64\*.*" />
</ItemGroup>

<Message Importance="high" Text="-- CefSharp.Wpf.targets: Copying files from $(MSBuildThisFileDirectory)..\CefSharp\x86 to $(TargetDir)\x86" />
<Copy SourceFiles="@(CefSharpBinaries32)" DestinationFolder="$(TargetDir)\x86" SkipUnchangedFiles="true" />
<Message Importance="high" Text="-- CefSharp.Wpf.targets: Copying files from $(MSBuildThisFileDirectory)..\CefSharp\x64 to $(TargetDir)" />
<Copy SourceFiles="@(CefSharpBinaries64)" DestinationFolder="$(TargetDir)\x64" SkipUnchangedFiles="true" />
<Message Importance="high" Text="-- CefSharp.Wpf.targets: Copying files from $(MSBuildThisFileDirectory)..\CefSharp\x86 to $(CefSharpTargetDir)\x86" />
<Copy SourceFiles="@(CefSharpBinaries32)" DestinationFolder="$(CefSharpTargetDir)\x86" SkipUnchangedFiles="true" />
<Message Importance="high" Text="-- CefSharp.Wpf.targets: Copying files from $(MSBuildThisFileDirectory)..\CefSharp\x64 to $(CefSharpTargetDir)\x64" />
<Copy SourceFiles="@(CefSharpBinaries64)" DestinationFolder="$(CefSharpTargetDir)\x64" SkipUnchangedFiles="true" />
</Target>
</Project>

0 comments on commit 2f69165

Please sign in to comment.