One way that might work would be to configure a header file that contains a string representing the options of interest.<div><br></div><div>Then include that header file in *all* source files that you want to rebuild.</div>
<div><br></div><div>When you change options in CMake and configure the header, it will only change if something has changed, and then it will trigger a rebuild of the source files that include it. For this to work reliably you&#39;d have to include that header in every source file in a given library or executable.</div>
<div><br></div><div>I realize the downside of this approach, but it may work for your situation better than saying &quot;tell your developers to clean&nbsp;and rebuild&nbsp;everything when they change an ADD_DEFINITION&quot;....</div>
<div><br></div><div><br></div><div>HTH,</div><div>David</div><div><br></div><div><br><div class="gmail_quote">On Wed, Dec 10, 2008 at 12:25 AM, Philip Lowman <span dir="ltr">&lt;<a href="mailto:philip@yhbt.com">philip@yhbt.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="Ih2E3d">On Tue, Dec 9, 2008 at 1:08 PM, Philip Lowman <span dir="ltr">&lt;<a href="mailto:philip@yhbt.com" target="_blank">philip@yhbt.com</a>&gt;</span> wrote:<br>
</div><div class="gmail_quote"><div class="Ih2E3d"><blockquote class="gmail_quote" style="border-left:1px solid rgb(204, 204, 204);margin:0pt 0pt 0pt 0.8ex;padding-left:1ex">
This is a known problem. &nbsp;Visual Studio has no way of knowing that the<br>
compiler flags changed in a project file CMake is writing to.<br>
<br>
I would love to see a patch for this for CMake 2.8.</blockquote></div><div><br>One thought I had here was to have the &quot;vcbuild&quot; command clean any affected projects.&nbsp; This would have the advantage of isolating CMake from implementing any Visual Studio specific mods (i.e. delete these object files to force a recompilation, etc.).&nbsp; This would have some downsides though.<br>

<br>1. The easiest implementation would just be to perform the clean if a project file changes.&nbsp; This would result in more cleaning then necessary as changing source files (for example) shouldn&#39;t cause a rebuild.&nbsp; Certain project modifications like adding a source file to a target shouldn&#39;t cause a clean of that target.<br>

<br>2. Perhaps the biggest gotcha of all, &quot;cleaning&quot; a target would wipe out any binaries/libraries already generated.&nbsp; This is far different from the behavior of CMake&#39;s Makefile generator which simply causes targets to be rebuilt on the next &quot;make&quot;.<br>

<br>Anyone have any ideas for fixing this?&nbsp; I&#39;ve been bit by this one before (forgetting to rebuild everything when I change a preprocessor definition at the global scope).<br><br></div></div><br>-- <br><font color="#888888">Philip Lowman<br>


</font><br>_______________________________________________<br>
CMake mailing list<br>
<a href="mailto:CMake@cmake.org">CMake@cmake.org</a><br>
<a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br></blockquote></div><br></div>