On Wed, Oct 5, 2011 at 3:45 PM, James Bigler <span dir="ltr"><<a href="mailto:jamesbigler@gmail.com">jamesbigler@gmail.com</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

<div><div></div><div class="h5">On Fri, Aug 19, 2011 at 10:41 AM, David Cole <span dir="ltr"><<a href="mailto:david.cole@kitware.com" target="_blank">david.cole@kitware.com</a>></span> wrote:<br><div class="gmail_quote">

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div><div></div><div>On Thu, Aug 18, 2011 at 4:56 PM, David Cole <<a href="mailto:david.cole@kitware.com" target="_blank">david.cole@kitware.com</a>> wrote:<br>
> On Thu, Aug 18, 2011 at 1:30 PM, David Cole <<a href="mailto:david.cole@kitware.com" target="_blank">david.cole@kitware.com</a>> wrote:<br>
>> On Tue, Aug 9, 2011 at 6:19 PM, James Bigler <<a href="mailto:jamesbigler@gmail.com" target="_blank">jamesbigler@gmail.com</a>> wrote:<br>
>>> I recently switched to 2.8.5 and noticed something strange.<br>
>>><br>
>>> I have several files that build into a Debug|Release agnostic place.  If I<br>
>>> build it in one then switch to the other the files don't regenerate, because<br>
>>> the build rule has been satisfied.<br>
>>><br>
>>> With CMake 2.8.5 and VS 2010 I noticed something strange.  It wanted to<br>
>>> build the files in both debug and release.  I then looked at the vsproj<br>
>>> files and I noticed this:<br>
>>><br>
>>>       <Outputs<br>
>>> Condition="'$(Configuration)|$(Platform)'=='RelWithDebInfo|Win32'">C:\code\build-32-vs10-c40\lib\myfile_build.txt;%(Outputs)</Outputs><br>
>>><br>
>>> %(Outputs)???  Why is that in there.  If I manually remove $(Outputs) then<br>
>>> it stops rebuilding my files.<br>
>>><br>
>>> James<br>
>>><br>
>>><br>
>>> _______________________________________________<br>
>>> cmake-developers mailing list<br>
>>> <a href="mailto:cmake-developers@cmake.org" target="_blank">cmake-developers@cmake.org</a><br>
>>> <a href="http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers" target="_blank">http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers</a><br>
>>><br>
>>><br>
>><br>
>> The "%(Attribute)" notation means inherit the value from the same<br>
>> element in my "parent". So for a file's attribute, it typically<br>
>> inherits the value from the same named attribute in the project.<br>
>><br>
>> In this case, I'm not entirely sure why it's there, but it's been<br>
>> there right from the very first commit adding the VS 10 generator to<br>
>> CMake: <a href="http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7491f529" target="_blank">http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7491f529</a><br>
>><br>
>> I can't think of the reason why it might be needed off the top of my<br>
>> head, so ... I'll try to remove it and see if all the tests pass. If<br>
>> they do, I suppose it should be ok to remove it. Does anybody else<br>
>> reading this thread have any other information?<br>
>><br>
>> Thanks,<br>
>> David<br>
>><br>
><br>
> I constructed a custom build command that runs a batch file and<br>
> outputs a text file solely via the VS10 IDE... and there was no<br>
> "%(Outputs)" in the vcxproj file. So I think it's safe to remove this.<br>
> I'll push a change that does that.<br>
><br>
> Thanks for the report,<br>
> David<br>
><br>
<br>
</div></div>This bug is quite possibly a report of the same thing, although, as<br>
noted in the bug, I could not reproduce the problem:<br>
<a href="http://public.kitware.com/Bug/view.php?id=12302" target="_blank">http://public.kitware.com/Bug/view.php?id=12302</a><br>
</blockquote></div><br></div></div>Drat!<br><br>This doesn't actually seem to help.  I'll see if I can create a smaller test program that illustrates the issue.<br><br>Does anyone know of a way to figure out why VS wants to build something similar to a "make -d"?<br>


<br>It would be really helpful to understand what is causing VS to rebuild stuff.<br><font color="#888888"><br>James<br>
</font></blockquote></div><br>I've been buried in this for the past day and I think I might know what is going on.  Unfortunately there doesn't appear to be an elegant solution to this other than perhaps filing a bug with Microsoft.<br>

<br>From my experimentation, it appears that custom build rules require being registered in the custombuild.command.1.tlog file that is put into the %(Intermediate Directory) location of the project.  Since this location is generally different for Debug and Release builds, each configuration needs to run *all* the custom build rules at least once to populate this file.  This the output from MSBuild when more detailed logging is enabled.<br>

<br>                     Forcing rebuild of all source files due to missing command tlog "D:\win7x64\bugs\cmake-extra-build\VS-2010\cat-file\Release\custombuild.command.1.tlog". (TaskId:14)<br><br>I'm not sure how to work around this aside from putting all non configuration dependent targets into a special project that has an intermediate directory that isn't %(Configuration) dependent.  That doesn't seem like a lot of fun.<br>

<br>Why MSBuild can't simply just populate the files without actually running the build commands if the dependencies are met seems like a little bit like a "missing feature", however it could be the mechanism to determine dependencies relies on that file being populated.<br>

<br>Unfortunately for me where I have *many* non-configuration dependent custom build rules I have to rebuild all the files for each configuration. :(<br><br>James<br>