On 12/04/2012 07:30 PM, James Bigler wrote:
> Is there something CMake can do to correct this error/bug with VS 2010?

I've narrowed this case down to a single hand-written test.vcxproj
file with no connection to CMake.  Here is a session:

 >echo Input 1 >in1.txt
 >echo Input 2 >in2.txt
 >echo Input 3 >in3.txt
 >msbuild test.vcxproj
 CustomBuild:
   CustomBuild in1.txt to out1.txt
   CustomBuild in2.txt to out2.txt
   CustomBuild out1.txt + out2.txt to out3.txt

 >msbuild test.vcxproj
 CustomBuild:
   All outputs are up-to-date.

 >echo Input 1 >in1.txt
 >msbuild test.vcxproj
 CustomBuild:
   CustomBuild in1.txt to out1.txt

 >msbuild test.vcxproj
 CustomBuild:
   CustomBuild out1.txt + out2.txt to out3.txt

 >msbuild test.vcxproj
 CustomBuild:
   All outputs are up-to-date.

 >echo Input 2 >in2.txt
 >msbuild test.vcxproj
 CustomBuild:
   CustomBuild in2.txt to out2.txt
   CustomBuild out1.txt + out2.txt to out3.txt

Note that the second case works correctly.  If I switch the order
of the CustomBuild elements for in1.txt and in2.txt in test.vcxproj
then the behavior switches to work correctly in the first case but
not the second.

Can you bring this up in a MS support forum?

-Brad
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003";>
  <ItemGroup Label="ProjectConfigurations">
    <ProjectConfiguration Include="Debug|Win32">
      <Configuration>Debug</Configuration>
      <Platform>Win32</Platform>
    </ProjectConfiguration>
  </ItemGroup>
  <PropertyGroup Label="Globals">
    <ProjectGuid>{9897183D-D7EC-E471-979C-9BA70FE6B905}</ProjectGuid>
  </PropertyGroup>
  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
    <ConfigurationType>Utility</ConfigurationType>
  </PropertyGroup>
  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
  <PropertyGroup>
    <_ProjectFileVersion>10.0.20506.1</_ProjectFileVersion>
    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Debug\</IntDir>
  </PropertyGroup>
  <ItemGroup>
    <CustomBuild Include="in1.txt">
      <Message Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">CustomBuild in1.txt to out1.txt</Message>
      <Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">type in1.txt &gt;out1.txt</Command>
      <Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">out1.txt</Outputs>
    </CustomBuild>
  </ItemGroup>
  <ItemGroup>
    <CustomBuild Include="in2.txt">
      <Message Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">CustomBuild in2.txt to out2.txt</Message>
      <Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">type in2.txt &gt;out2.txt</Command>
      <Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">out2.txt</Outputs>
    </CustomBuild>
  </ItemGroup>
  <ItemGroup>
    <CustomBuild Include="in3.txt">
      <Message Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">CustomBuild out1.txt + out2.txt to out3.txt</Message>
      <Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">type out1.txt out2.txt &gt;out3.txt 2&gt;NUL</Command>
      <Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">out3.txt</Outputs>
      <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">out1.txt;out2.txt</AdditionalInputs>
    </CustomBuild>
  </ItemGroup>
  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
</Project>

--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers

Reply via email to