Set up .csproj for bindings which automatically places .dll/.so/.dylib in output directory

This commit is contained in:
Jørgen Lund
2020-10-22 23:31:45 +02:00
parent 73ef1190c3
commit 824e51ded7
2 changed files with 30 additions and 1 deletions
+2
View File
@@ -39,3 +39,5 @@ set_target_properties(${CSHARP_BINDING_TARGET_NAME}
SWIG_FLAGS ${CSHARP_BINDINGS_NAMESPACE})
swig_link_libraries(${CSHARP_BINDING_TARGET_NAME} ${CSHARP_LIBRARIES} ${LIB_CORE_TARGET_NAME})
configure_file("CoatiSoftware.SourcetrailDB.csproj" "CoatiSoftware.SourcetrailDB.csproj" COPYONLY)
@@ -0,0 +1,27 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>
<ItemGroup Condition="'$(OS)' == 'Windows_NT'">
<Content Include="$(ProjectDir)/SourcetrailDB.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<Link>SourcetrailDB.dll</Link>
</Content>
</ItemGroup>
<ItemGroup Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::Linux)))'">
<Content Include="$(ProjectDir)/SourcetrailDB.so">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<Link>SourcetrailDB.so</Link>
</Content>
</ItemGroup>
<ItemGroup Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::OSX)))'">
<Content Include="$(ProjectDir)/SourcetrailDB.dylib">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<Link>SourcetrailDB.dylib</Link>
</Content>
</ItemGroup>
</Project>