Home › Forums › Software Development › InteractionLib, how to use it properly? › Reply To: InteractionLib, how to use it properly?
02/08/2020 at 09:43 #18560
Participant
Ok @grant-rogers, I’ve found the missing parts. They were all hidden in the project file: Tobii.InteractionLib.Wpf.SampleApp.csproj
I’m not sure if the missing fields can be set up via Visual Studio’s GUI, I couldn’t find them there. I’ve edited my .csproj file directly to add the missing stuff. I believe the crucials were these:
<PropertyGroup>
<IsWindows>false</IsWindows>
<IsOSX>false</IsOSX>
<IsLinux>false</IsLinux>
<IsWindows Condition="'$(OS)' == 'Windows_NT'">true</IsWindows>
</PropertyGroup>
<PropertyGroup Condition="'$(MSBuildRuntimeType)' == 'Core'">
<IsWindows Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::Windows)))' == 'true'">true</IsWindows>
<IsOSX Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::OSX)))' == 'true'">true</IsOSX>
<IsLinux Condition="'$([System.Runtime.InteropServices.RuntimeInformation]::IsOSPlatform($([System.Runtime.InteropServices.OSPlatform]::Linux)))' == 'true'">true</IsLinux>
</PropertyGroup>
<PropertyGroup>
<LibPath>../../../lib/$(Platform)</LibPath>
<LibPath Condition="'$(BuildLibPath)' != ''">$(BuildLibPath)</LibPath>
</PropertyGroup>
…and these:
<ItemGroup Condition="$(IsWindows)">
<NativeDlls Include="$(LibPath)/tobii_interaction_lib_c.dll" />
<NativeDlls Include="$(LibPath)/tobii_interaction_lib.dll" />
<NativeDlls Include="$(LibPath)/tobii_stream_engine.dll" />
</ItemGroup>
<ItemGroup Condition="$(IsOSX)">
<NativeDlls Include="$(LibPath)/libtobii_interaction_lib_c.dylib" />
<NativeDlls Include="$(LibPath)/libtobii_interaction_lib.dylib" />
<NativeDlls Include="$(LibPath)/libtobii_stream_engine.dylib" />
</ItemGroup>
<ItemGroup Condition="$(IsLinux)">
<NativeDlls Include="$(LibPath)/libtobii_interaction_lib_c.so" />
<NativeDlls Include="$(LibPath)/libtobii_interaction_lib.so" />
<NativeDlls Include="$(LibPath)/libtobii_stream_engine.so" />
</ItemGroup>
<Target Name="AfterBuild">
<Copy SourceFiles="@(NativeDlls)" DestinationFolder="$(OutputPath)" SkipUnchangedFiles="true" />
</Target>
So now with these things in my .csproj file I can successfully build and run the app. All good. Thank you for participation!