Skip to content

Commit 35f3a57

Browse files
committed
MSBuild - change from using $(SolutionDir) to $MSBuildThisFileDirectory
- Changes to make CefSharp easier to use as a git submodule - BrowserSubProcess now builds for net6.0-windows for use with WinForms example
1 parent e439cd0 commit 35f3a57

11 files changed

+19
-19
lines changed

Diff for: CefSharp.AfterBuild.targets

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
<Target Name="CefSharpCopyBrowserSubprocess" AfterTargets="AfterBuild">
1111
<ItemGroup>
1212
<!-- We only need the .exe and .pdb but I don't know how to express that easily with MSBuild... -->
13-
<SubProcessFiles Include="$(SolutionDir)CefSharp.BrowserSubprocess\bin.netcore\$(Platform)\$(Configuration)\$(TargetFramework)\CefSharp.BrowserSubprocess.*" />
13+
<SubProcessFiles Include="$(MSBuildThisFileDirectory)CefSharp.BrowserSubprocess\bin.netcore\$(Platform)\$(Configuration)\$(TargetFramework)\CefSharp.BrowserSubprocess.*" />
1414
</ItemGroup>
15-
<Message Importance="high" Text="Copying $(SolutionDir)CefSharp.BrowserSubprocess\bin.netcore\$(Platform)\$(Configuration)\$(TargetFramework)\CefSharp.BrowserSubprocess.* to $(TargetDir)" />
15+
<Message Importance="high" Text="Copying $(MSBuildThisFileDirectory)CefSharp.BrowserSubprocess\bin.netcore\$(Platform)\$(Configuration)\$(TargetFramework)\CefSharp.BrowserSubprocess.* to $(TargetDir)" />
1616
<Copy SourceFiles="@(SubProcessFiles)" DestinationFolder="$(TargetDir)" />
1717
</Target>
1818

Diff for: CefSharp.Core.Runtime.RefAssembly/CefSharp.Core.Runtime.RefAssembly.netcore.csproj

+5-5
Original file line numberDiff line numberDiff line change
@@ -54,19 +54,19 @@
5454
Haven't found a nice way to determine the Platform (resolves as AnyCPU)
5555
-->
5656
<Choose>
57-
<When Condition="Exists('$(SolutionDir)CefSharp.Core.Runtime\bin.netcore\x64\$(Configuration)\CefSharp.Core.Runtime.dll')">
57+
<When Condition="Exists('$(MSBuildThisFileDirectory)..\CefSharp.Core.Runtime\bin.netcore\x64\$(Configuration)\CefSharp.Core.Runtime.dll')">
5858
<PropertyGroup>
59-
<IntermediateTargetPath>$(SolutionDir)CefSharp.Core.Runtime\bin.netcore\x64\$(Configuration)\CefSharp.Core.Runtime.dll</IntermediateTargetPath>
59+
<IntermediateTargetPath>$(MSBuildThisFileDirectory)..\CefSharp.Core.Runtime\bin.netcore\x64\$(Configuration)\CefSharp.Core.Runtime.dll</IntermediateTargetPath>
6060
</PropertyGroup>
6161
</When>
62-
<When Condition="Exists('$(SolutionDir)CefSharp.Core.Runtime\bin.netcore\arm64\$(Configuration)\CefSharp.Core.Runtime.dll')">
62+
<When Condition="Exists('$(MSBuildThisFileDirectory)..\CefSharp.Core.Runtime\bin.netcore\arm64\$(Configuration)\CefSharp.Core.Runtime.dll')">
6363
<PropertyGroup>
64-
<IntermediateTargetPath>$(SolutionDir)CefSharp.Core.Runtime\bin.netcore\arm64\$(Configuration)\CefSharp.Core.Runtime.dll</IntermediateTargetPath>
64+
<IntermediateTargetPath>$(MSBuildThisFileDirectory)..\CefSharp.Core.Runtime\bin.netcore\arm64\$(Configuration)\CefSharp.Core.Runtime.dll</IntermediateTargetPath>
6565
</PropertyGroup>
6666
</When>
6767
<Otherwise>
6868
<PropertyGroup>
69-
<IntermediateTargetPath>$(SolutionDir)CefSharp.Core.Runtime\bin.netcore\win32\$(Configuration)\CefSharp.Core.Runtime.dll</IntermediateTargetPath>
69+
<IntermediateTargetPath>$(MSBuildThisFileDirectory)..\CefSharp.Core.Runtime\bin.netcore\win32\$(Configuration)\CefSharp.Core.Runtime.dll</IntermediateTargetPath>
7070
</PropertyGroup>
7171
</Otherwise>
7272
</Choose>

Diff for: CefSharp.Native.props

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<Target Name="CefSharpCopyBrowserSubprocess" AfterTargets="AfterBuild">
44
<ItemGroup>
55
<!-- We only need the .exe and .pdb but I don't know how to express that easily with MSBuild... -->
6-
<SubProcessFiles Include="$(SolutionDir)\CefSharp.BrowserSubprocess\bin\$(Platform)\$(Configuration)\CefSharp.BrowserSubprocess.*" />
6+
<SubProcessFiles Include="$(MSBuildThisFileDirectory)\CefSharp.BrowserSubprocess\bin\$(Platform)\$(Configuration)\CefSharp.BrowserSubprocess.*" />
77
</ItemGroup>
88
<Copy SourceFiles="@(SubProcessFiles)" DestinationFolder="$(OutDir)" />
99
</Target>

Diff for: CefSharp.OffScreen.Example/CefSharp.OffScreen.Example.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,5 @@
3535
<Page Remove="bin.netcore\**" />
3636
<Page Remove="obj.netcore\**" />
3737
</ItemGroup>
38-
<Import Project="$(SolutionDir)\CefSharp.Native.props" />
38+
<Import Project="$(MSBuildThisFileDirectory)..\CefSharp.Native.props" />
3939
</Project>

Diff for: CefSharp.OffScreen.Example/CefSharp.OffScreen.Example.netcore.csproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?xml version="1.0" encoding="utf-8"?>
1+
<?xml version="1.0" encoding="utf-8"?>
22
<Project>
33
<!-- Note: We cannot use the recommended style of specifying <Project Sdk=...> because we need
44
to set BaseIntermediateOutputPath and BaseOutputPath before the SDK props are imported. -->
@@ -55,6 +55,6 @@
5555
<Compile Remove="obj/**/*.*" />
5656
</ItemGroup>
5757

58-
<Import Project="$(SolutionDir)\CefSharp.AfterBuild.targets" />
58+
<Import Project="$(MSBuildThisFileDirectory)..\CefSharp.AfterBuild.targets" />
5959
<Import Project="Sdk.targets" Sdk="Microsoft.NET.Sdk" />
6060
</Project>

Diff for: CefSharp.Test/CefSharp.Test.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,5 +66,5 @@
6666
<ItemGroup>
6767
<Content Include="xunit.runner.json" CopyToOutputDirectory="PreserveNewest" />
6868
</ItemGroup>
69-
<Import Project="$(SolutionDir)\CefSharp.Native.props" />
69+
<Import Project="$(MSBuildThisFileDirectory)..\CefSharp.Native.props" />
7070
</Project>

Diff for: CefSharp.Test/CefSharp.Test.netcore.csproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?xml version="1.0" encoding="utf-8"?>
1+
<?xml version="1.0" encoding="utf-8"?>
22
<Project>
33
<!-- Note: We cannot use the recommended style of specifying <Project Sdk=...> because we need
44
to set BaseIntermediateOutputPath and BaseOutputPath before the SDK props are imported. -->
@@ -59,6 +59,6 @@
5959
<Content Include="xunit.runner.json" CopyToOutputDirectory="PreserveNewest" />
6060
</ItemGroup>
6161

62-
<Import Project="$(SolutionDir)\CefSharp.AfterBuild.targets" />
62+
<Import Project="$(MSBuildThisFileDirectory)..\CefSharp.AfterBuild.targets" />
6363
<Import Project="Sdk.targets" Sdk="Microsoft.NET.Sdk.WindowsDesktop" />
6464
</Project>

Diff for: CefSharp.WinForms.Example/CefSharp.WinForms.Example.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,5 +44,5 @@
4444
<Page Remove="bin.netcore\**" />
4545
<Page Remove="obj.netcore\**" />
4646
</ItemGroup>
47-
<Import Project="$(SolutionDir)\CefSharp.Native.props" />
47+
<Import Project="$(MSBuildThisFileDirectory)..\CefSharp.Native.props" />
4848
</Project>

Diff for: CefSharp.WinForms.Example/CefSharp.WinForms.Example.netcore.csproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?xml version="1.0" encoding="utf-8"?>
1+
<?xml version="1.0" encoding="utf-8"?>
22
<Project>
33
<!-- Note: We cannot use the recommended style of specifying <Project Sdk=...> because we need
44
to set BaseIntermediateOutputPath and BaseOutputPath before the SDK props are imported. -->
@@ -62,6 +62,6 @@
6262
<Compile Remove="obj/**/*.*" />
6363
</ItemGroup>
6464

65-
<Import Project="$(SolutionDir)\CefSharp.AfterBuild.targets" />
65+
<Import Project="$(MSBuildThisFileDirectory)..\CefSharp.AfterBuild.targets" />
6666
<Import Project="Sdk.targets" Sdk="Microsoft.NET.Sdk.WindowsDesktop" />
6767
</Project>

Diff for: CefSharp.Wpf.Example/CefSharp.Wpf.Example.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,5 +43,5 @@
4343
<Page Remove="bin.netcore\**" />
4444
<Page Remove="obj.netcore\**" />
4545
</ItemGroup>
46-
<Import Project="$(SolutionDir)\CefSharp.Native.props" />
46+
<Import Project="$(MSBuildThisFileDirectory)..\CefSharp.Native.props" />
4747
</Project>

Diff for: CefSharp.Wpf.Example/CefSharp.Wpf.Example.netcore.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,6 @@
5757
<Compile Remove="obj/**/*.*" />
5858
</ItemGroup>
5959

60-
<Import Project="$(SolutionDir)\CefSharp.AfterBuild.targets" />
60+
<Import Project="$(MSBuildThisFileDirectory)..\CefSharp.AfterBuild.targets" />
6161
<Import Project="Sdk.targets" Sdk="Microsoft.NET.Sdk.WindowsDesktop" />
6262
</Project>

0 commit comments

Comments
 (0)