<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

  <!-- A target to build tsduck.dtv.names from all .names files -->

  <ItemGroup>
    <DtvNamesFiles Include="$(TSDuckRootDir)src\libtsduck\config\tsduck.dtv.skeleton.names;
                            $(TSDuckRootDir)src\libtsduck\base\**\*.names;
                            $(TSDuckRootDir)src\libtsduck\dtv\**\*.names"/>
  </ItemGroup>

  <Target Name="BuildDtvNames" Inputs="@(DtvNamesFiles)" Outputs="$(OutDir)tsduck.dtv.names">
    <Message Text="Building $(OutDir)tsduck.dtv.names" Importance="high"/>
    <MakeDir Directories="$(OutDir)" Condition="!Exists('$(OutDir)')"/>
    <Exec ConsoleToMSBuild='true'
          Command='python "$(TSDuckRootDir)scripts\build-dtv-names.py" "$(OutDir)tsduck.dtv.names" "$(TSDuckRootDir)src\libtsduck\config\tsduck.dtv.skeleton.names" "$(TSDuckRootDir)src\libtsduck\base" "$(TSDuckRootDir)src\libtsduck\dtv"'>
      <Output TaskParameter="ConsoleOutput" PropertyName="OutputOfExec"/>
    </Exec>
  </Target>

</Project>
