<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <!-- MSBuild hurts and I can't find a foolproof way to detect platform. -->
  <PropertyGroup>
    <OS Condition="'$(OS)' == ''">Windows_NT</OS>
  </PropertyGroup>
  <Choose>
    <When Condition="'$(OS)' != 'Unix'">
      <PropertyGroup>
        <ActualOS>Windows</ActualOS>
      </PropertyGroup>
    </When>
    <!-- Folders that *probably* only exist on MacOS and not Linux. -->
    <When Condition="Exists('/Volumes') And Exists('/System') And Exists('/Library')" >
      <PropertyGroup>
        <ActualOS>MacOS</ActualOS>
      </PropertyGroup>
    </When>
    <When Condition="$([MSBuild]::IsOSPlatform('FreeBSD'))">
      <PropertyGroup>
        <ActualOS>FreeBSD</ActualOS>
      </PropertyGroup>
    </When>
    <Otherwise>
      <PropertyGroup>
        <ActualOS>Linux</ActualOS>
      </PropertyGroup>
    </Otherwise>
  </Choose>
  <PropertyGroup>
    <TargetOS Condition="'$(TargetOS)' == ''">$(ActualOS)</TargetOS>
    <Python>python3</Python>
    <Python Condition="'$(ActualOS)' == 'Windows'">py -3</Python>
    <UseSystemSqlite Condition="'$(TargetOS)' == 'FreeBSD'">True</UseSystemSqlite>
    <IsFreedesktop Condition="'$(TargetOS)' == 'FreeBSD' Or '$(TargetOS)' == 'Linux'">True</IsFreedesktop>
  </PropertyGroup>
</Project>
