<?xml version="1.0" encoding="utf-8"?>
<!--
    Copyright 1991-2016 Amebis
    Copyright 2016 GÉANT

    This file is part of GÉANTLink.

    GÉANTLink is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    GÉANTLink is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with GÉANTLink. If not, see <http://www.gnu.org/licenses/>.
-->
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <ItemGroup>
    <PropertyPageSchema Include="$(MSBuildThisFileDirectory)$(MSBuildThisFileName).xml" />
    <AvailableItemName Include="POCompile">
      <Targets>POCompile</Targets>
    </AvailableItemName>
  </ItemGroup>
  <UsingTask TaskName="POCompile" TaskFactory="XamlTaskFactory" AssemblyName="Microsoft.Build.Tasks.v4.0">
    <Task>$(MSBuildThisFileDirectory)$(MSBuildThisFileName).xml</Task>
  </UsingTask>
  <Target
    Name="POCompile"
    BeforeTargets="$(POCompileBeforeTargets)"
    AfterTargets="$(POCompileAfterTargets)"
    DependsOnTargets="$(POCompilationDependsOn)"
    Inputs="@(POCompile);$(MSBuildProjectFile)"
    Outputs="%(POCompile.OutputFile)"
  >
    <ItemGroup Condition="'@(SelectedFiles)' != ''">
      <POCompile Remove="@(POCompile)" Condition="'%(Identity)' != '@(SelectedFiles)'" />
    </ItemGroup>
    <MakeDir Directories="$([System.IO.Path]::GetDirectoryName('%(POCompile.OutputFile)'))"/>
    <POCompile
      Condition="'@(POCompile)' != '' and '%(POCompile.ExcludedFromBuild)' != 'true'"
      Inputs="@(POCompile)"
      OperationMode="%(POCompile.OperationMode)"
      Strict="%(POCompile.Strict)"
      CheckFormat="%(POCompile.CheckFormat)"
      CheckHeader="%(POCompile.CheckHeader)"
      CheckDomain="%(POCompile.CheckDomain)"
      CheckCompat="%(POCompile.CheckCompat)"
      CheckAccel="%(POCompile.CheckAccel)"
      OutputFile="%(POCompile.OutputFile)"
      UseFuzzy="%(POCompile.UseFuzzy)"
      Alignment="%(POCompile.Alignment)"
      Endianess="%(POCompile.Endianess)"
      AdditionalOptions="%(POCompile.AdditionalOptions)"
      CommandLineTemplate="%(POCompile.CommandLineTemplate)" />
  </Target>
  <Target Name="POCompilationClean">
    <Delete Files="%(POCompile.OutputFile)" ContinueOnError="true" />
  </Target>
  <PropertyGroup>
    <CleanDependsOn>POCompilationClean;$(CleanDependsOn);</CleanDependsOn>
  </PropertyGroup>
</Project>