<div>I think I managed to reproduce the problem, partially.</div><div><br></div><div>The file below contains a project which for me reproduces the problem when I use msbuild.</div><div>F7 (Build-&gt;BuildSolution) works (builds only once, then next time, it does nothing).</div>

<div><br></div><div>So there is something in the combination of CMake and msbuild which causes the problem.</div><div>We use Incredibuild, which uses msbuild, hence we get the problem also in Incredibuild.</div><div>I do not know the difference between F7 and msbuild though.</div>

<div><br></div><a href="http://rapidshare.com/files/439941435/DependencyBug.rar">http://rapidshare.com/files/439941435/DependencyBug.rar</a><div><br></div><div>Instructions:</div><div><br></div><div><span class="Apple-style-span" style="font-family: Verdana, Arial, Helvetica; font-size: 12px; color: rgb(51, 51, 51); -webkit-border-horizontal-spacing: 1px; -webkit-border-vertical-spacing: 1px; ">1. Unpack dep2.rar into a new empty directory<br>

2. install CMake (2.8.2 or later)<br><a href="http://www.cmake.org/files/v2.8/cmake-2.8.3-win32-x86.exe" target="_blank" style="color: rgb(0, 0, 0); text-decoration: none; font-family: Verdana, Tahoma; font-size: 11px; ">http://www.cmake.org/files/v2.8/cmake-2.8.3-win32-x86.exe</a><br>

3 go to the directory in a command prompt<br>4. execute: cmake .<br>5. msbuild DepBug.sln<br></span><span class="Apple-style-span" style="font-family: Verdana, Arial, Helvetica; font-size: 12px; color: rgb(51, 51, 51); -webkit-border-horizontal-spacing: 1px; -webkit-border-vertical-spacing: 1px; ">6. msbuild DepBug.sln &lt;&lt; Builds everything again from scratch.</span></div>

<div><span class="Apple-style-span" style="font-family: Verdana, Arial, Helvetica; font-size: 12px; color: rgb(51, 51, 51); -webkit-border-horizontal-spacing: 1px; -webkit-border-vertical-spacing: 1px; "><br></span></div>

<div><span class="Apple-style-span" style="font-family: Verdana, Arial, Helvetica; font-size: 12px; color: rgb(51, 51, 51); -webkit-border-horizontal-spacing: 1px; -webkit-border-vertical-spacing: 1px; "><br></span></div>

<div><span class="Apple-style-span" style="font-family: Verdana, Arial, Helvetica; font-size: 12px; color: rgb(51, 51, 51); -webkit-border-horizontal-spacing: 1px; -webkit-border-vertical-spacing: 1px; ">/A<br></span><div class="gmail_quote">

On Wed, Dec 29, 2010 at 1:26 PM, Anders Backman <span dir="ltr">&lt;<a href="mailto:andersb@cs.umu.se">andersb@cs.umu.se</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

Ok, Im already using the nightly build (from Tuesday I believe), as I discovered a bug in CMake yesterday.<div>I will bug M$ too :-)</div><div><br></div><div><font color="#888888">/A</font><div><div></div><div class="h5">

<br><br><div class="gmail_quote">On Wed, Dec 29, 2010 at 1:03 PM, David Cole <span dir="ltr">&lt;<a href="mailto:david.cole@kitware.com" target="_blank">david.cole@kitware.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">For Visual Studio generators, CMake does *NO* depedency analysis. It<br>
generates solution and project files such that Visual Studio can do<br>
all the dependency analysis and decide what to re-build when files<br>
change.<br>
<br>
My advice to you would be:<br>
- use only CMake 2.8.3 or newer (a nightly development build of CMake)<br>
with Visual Studio 10 -- CMake 2.8.2 and earlier had significant bugs<br>
related to VS10 that have since been resolved...<br>
- using a newer CMake, isolate the problem to a minimally reproducible<br>
case and then report a bug in the bug tracker about it including the<br>
steps to reproduce the problem<br>
<br>
Reply here again and point us to the bug.<br>
<br>
<br>
HTH,<br>
David<br>
<div><div></div><div><br>
<br>
On Wed, Dec 29, 2010 at 4:07 AM, Anders Backman &lt;<a href="mailto:andersb@cs.umu.se" target="_blank">andersb@cs.umu.se</a>&gt; wrote:<br>
&gt; Hi all.<br>
&gt; I have a problem where I have a project of C++ headers and source files<br>
&gt; which are built into a .lib .dll.<br>
&gt; Now this works just fine with CMake 2.8.x and VisualStudio 2008.<br>
&gt; I press F7 everything builds. I press F7 again, it is all built, nothing to<br>
&gt; be done.<br>
&gt; But now when I move over to vs2010, I get into problems where no matter how<br>
&gt; I build the project, it constantly want to rebuild everything.<br>
&gt; I have tried both &#39;msbuild project.sln&#39; from the command line, as well as<br>
&gt; build (F7) inside of VisualStudio  as well as using Incredibuild. The result<br>
&gt; is the same. If I press F7, it builds everything as it was not built before.<br>
&gt; I did some googling on the issue, and some suggest that there is a file in<br>
&gt; the project (header) which does not exist on disk, causing the problem.<br>
&gt; We do file(glob) on all files, so a file which is not found, should not be<br>
&gt; part of the project.<br>
&gt; Right now, it seems to be hard to reduce the problem. When I start from the<br>
&gt; full project, 107 files, it want to rebuild everything.<br>
&gt; When I reduce the problem, I can get down to one single file, still it wants<br>
&gt; to build it. Its a c file, and there is nothing special about it. I even<br>
&gt; managed to reduce that down to one function, no includes. still the same<br>
&gt; problem.<br>
&gt; If I copy the relevant files (a few cmakelists.txt and the directory<br>
&gt; structure, including the two files (.h .c) it builds as it should again.<br>
&gt; I tried to run cmake and generate vs2008 files, that works. Open them in<br>
&gt; vs2010, build, then that works (with the two files only).<br>
&gt;<br>
&gt; So anyway, before I put you all to sleep, as far as I know, there are two<br>
&gt; dependency parsers involved here:<br>
&gt; - CMake runs through source files and generates dependencies, right?<br>
&gt; - THen visual studio does the same (generating the External dependencies<br>
&gt; folder in the project). Now there is SOMETHING wrong in either one, or both<br>
&gt; or none related to VS2010.<br>
&gt; Does someone have any hints on how to debug this problem? I have spent<br>
&gt; substantial time, and I cant seem to get anywhere.<br>
&gt; I cant reduce it to something I can post on the list, as it just magically<br>
&gt; works when I want to rip it out.<br>
&gt; At one point, I had 3 cmakelists, each with about 3 lines. 2 source files<br>
&gt; (.h .c), I did clean on CMakeCache.txt between each cmake . run, loaded the<br>
&gt; project build and got the error. Fairly simple scene. But as soon as I try<br>
&gt; to move that to another dir, it fails.<br>
&gt; Thankful for any advice on the matter.<br>
&gt;<br>
&gt; --<br>
&gt;<br>
&gt;<br>
</div></div>&gt; _______________________________________________<br>
&gt; Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
&gt;<br>
&gt; Visit other Kitware open-source projects at<br>
&gt; <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
&gt;<br>
&gt; Please keep messages on-topic and check the CMake FAQ at:<br>
&gt; <a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
&gt;<br>
&gt; Follow this link to subscribe/unsubscribe:<br>
&gt; <a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br>
&gt;<br>
</blockquote></div><br><br clear="all"><br></div></div>-- <br><br>
</div>
</blockquote></div><br><br clear="all"><br>-- <br>__________________________________________<br>Anders Backman, CTO  Algoryx Simulation AB<br>Uminova Science Park, Box 7973,  SE-907 19 <br>Umeå,  Sweden<br><a href="mailto:anders@algoryx.se">anders@algoryx.se</a> <a href="http://www.algoryx.se">http://www.algoryx.se</a> <br>

Cell: +46-70-392 64 67<br>
</div>