<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <ItemGroup Label="ProjectConfigurations">
    <ProjectConfiguration Include="Debug|x64">
      <Configuration>Debug</Configuration>
      <Platform>x64</Platform>
    </ProjectConfiguration>
    <ProjectConfiguration Include="Release|x64">
      <Configuration>Release</Configuration>
      <Platform>x64</Platform>
    </ProjectConfiguration>
  </ItemGroup>
  <PropertyGroup Label="Globals">
    <ProjectGuid>{EC87DC16-51CB-4229-845D-23840A3CC8CB}</ProjectGuid>
    <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
  </PropertyGroup>
  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
    <ConfigurationType>DynamicLibrary</ConfigurationType>
    <UseDebugLibraries>true</UseDebugLibraries>
    <PlatformToolset>v140</PlatformToolset>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
    <ConfigurationType>DynamicLibrary</ConfigurationType>
    <UseDebugLibraries>false</UseDebugLibraries>
    <PlatformToolset>v140</PlatformToolset>
  </PropertyGroup>
  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
  <Import Project="$(MSBuildThisFileDirectory)..\..\..\..\cpp\msbuild\ice.cpp11.props" />
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
    <OutDir>..\..\..\lib\$(Platform)\$(Configuration)\</OutDir>
    <TargetExt>.dll</TargetExt>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
    <OutDir>..\..\..\lib\$(Platform)\$(Configuration)\</OutDir>
    <TargetExt>.dll</TargetExt>
  </PropertyGroup>
  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
    <ClCompile>
      <PreprocessorDefinitions>MX_COMPAT_32;MATLAB_MEX_FILE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
      <AdditionalIncludeDirectories>..\..;$(MatlabHome)\extern\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
      <DisableSpecificWarnings>%(DisableSpecificWarnings);4100</DisableSpecificWarnings>
    </ClCompile>
  </ItemDefinitionGroup>
  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
    <ClCompile>
      <PreprocessorDefinitions>MX_COMPAT_32;MATLAB_MEX_FILE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
      <AdditionalIncludeDirectories>..\..;$(MatlabHome)\extern\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
      <DisableSpecificWarnings>%(DisableSpecificWarnings);4100</DisableSpecificWarnings>
    </ClCompile>
  </ItemDefinitionGroup>
  <ItemGroup>
    <ClCompile Include="x64\Release\icethunk.c">
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
    </ClCompile>
    <ClCompile Include="x64\Debug\icethunk.c">
      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
    </ClCompile>
  </ItemGroup>
  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
  <ImportGroup Label="ExtensionTargets">
  </ImportGroup>
  <Import Project="$(MSBuildThisFileDirectory)..\..\..\..\cpp\msbuild\ice.sign.targets" />
  <Target Name="MatlabHome" BeforeTargets="PrepareForBuild">
    <Error Text="Cannot detect a valid MATLAB installation" Condition="!Exists('$(MatlabHome)')" />
  </Target>
  <Target Name="MATLABPrototype" BeforeTargets="CLCompile">
    <MakeDir Directories="$(Platform)\$(Configuration)" />
    <Exec Command="cl /P /c ..\..\..\..\ice.h" WorkingDirectory="$(Platform)\$(Configuration)" Condition="!Exists('$(Platform)\$(Configuration)\ice.i') or $([System.IO.File]::GetLastWriteTime('..\..\ice.h').Ticks) &gt; $([System.IO.File]::GetLastWriteTime('$(Platform)\$(Configuration)\ice.i').Ticks)" />
    <Exec Command="perl &quot;$(MatlabHome)\toolbox\matlab\general\private\prototypes.pl&quot; ice.i -thunkfile=icethunk.c -outfile=iceproto.m" WorkingDirectory="$(Platform)\$(Configuration)" Condition="!Exists('$(Platform)\$(Configuration)\iceproto.m') or $([System.IO.File]::GetLastWriteTime('$(Platform)\$(Configuration)\ice.i').Ticks) &gt; $([System.IO.File]::GetLastWriteTime('$(Platform)\$(Configuration)\iceproto.m').Ticks)" />
    <Copy SourceFiles="$(Platform)\$(Configuration)\iceproto.m" DestinationFolder="$(OutDir)" SkipUnchangedFiles="true" />
  </Target>
  <Target Name="MATLABPrototypeClean" BeforeTargets="Clean">
    <Delete Files="$(Platform)\$(Configuration)\ice.i" />
    <Delete Files="$(Platform)\$(Configuration)\iceproto.m" />
    <Delete Files="$(Platform)\$(Configuration)\icethunk.c" />
  </Target>
</Project>