<div class="gmail_quote">On Fri, Jun 19, 2009 at 3:04 PM, Tyler Roscoe <span dir="ltr">&lt;<a href="mailto:tyler@cryptio.net">tyler@cryptio.net</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="im">On Fri, Jun 19, 2009 at 02:07:30PM -0400, Iman Brouwer wrote:<br>
&gt; ADD_CUSTOM_TARGET( addTargets ${CMAKE_COMMAND} -DBUILD_EXTRA_TARGETS=ON<br>
&gt; ${CMAKE_SOURCE_DIR} )<br>
&gt; ADD_CUSTOM_TARGET( removeTargets ${CMAKE_COMMAND} -DBUILD_EXTRA_TARGETS=OFF<br>
&gt; ${CMAKE_SOURCE_DIR} )<br>
&gt;<br>
&gt; The &#39;extra targets&#39; are all added in IF( BUILD_EXTRA_TARGETS ) blocks.<br>
&gt;<br>
&gt; Both targets work in the sense that they seem to remove/add targets in<br>
&gt; visual studio after I close/open the IDE.<br>
&gt;<br>
&gt; But the automatic reloading of the IDE seems to happen only the first time:<br>
&gt; - If i build addTargets when the extra targets are not part of the solution,<br>
&gt; the IDE will reload, but if i then build removeTargets, the targets will not<br>
&gt; be removed until i close/open the IDE.<br>
<br>
</div>Does CMake delete the generated extra_targets.vcproj when you rerun<br>
cmake with -DBUILD_EXTRA_TARGETS=OFF? I would not be surprised if the<br>
.vcproj are left lying around.</blockquote><div><br>Thanks Tyler. I looked into this, and you&#39;re right, the *.vcproj files of the &#39;removed&#39; targets are still there. However, the references to the .vcproj files are removed from the .sln file. <br>
<br>I&#39;m not really sure what triggers the reload to happen correctly sometimes and not other times. For now, we just close/open visual studio. It&#39;s not that elegant but it&#39;s not a big problem either.<br><br>Iman<br>
<br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Perhaps VS is smart enough to notice when new files appear but not when<br>
existing files disappear?<br>
<br>
I tend to close/reopen VS when making CMake changes anyway because the<br>
reload macros are quite unreliable for me.<br>
<font color="#888888"><br>
tyler<br>
</font></blockquote></div><br>