Sorry I think we are not on the same page.<div><br></div><div>My custom target is: &quot;Foo&quot;</div><div>My C++ executable target is: &quot;Bar&quot;</div><div><br></div><div>I don&#39;t want Bar depend on Foo, because I do not want Foo&#39;s commands to execute when I build Bar. However, because Bar does not depend on Foo, Foo.vcproj will not be part of Bar.sln. I need a way to make sure that Foo.vcproj opens with Bar.sln without creating that dependency.</div>
<div><br></div><div>I hope this makes a little more sense.<br><br><div class="gmail_quote">On Wed, Apr 4, 2012 at 2:01 PM, David Cole <span dir="ltr">&lt;<a href="mailto:david.cole@kitware.com">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">Your original message said you didn&#39;t want to make it a dependency.<br>
So, why then use &quot;add_dependencies&quot; ...?<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
On Wed, Apr 4, 2012 at 3:00 PM, David Cole &lt;<a href="mailto:david.cole@kitware.com">david.cole@kitware.com</a>&gt; wrote:<br>
&gt; Well, add_dependencies means that the custom target will be built<br>
&gt; *before* the target that needs it. So it becomes part of &quot;ALL&quot; if the<br>
&gt; other target is part of &quot;ALL&quot;.<br>
&gt;<br>
&gt; I thought nothing depended on it, that&#39;s why I offered the leave out<br>
&gt; &quot;ALL&quot; advice. If something depends on it, then it&#39;s going to be<br>
&gt; executed before the thing that depends on it...<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; On Wed, Apr 4, 2012 at 2:35 PM, Robert Dailey &lt;<a href="mailto:rcdailey.lists@gmail.com">rcdailey.lists@gmail.com</a>&gt; wrote:<br>
&gt;&gt; I add the custom targets as a dependency with add_dependencies(), and I<br>
&gt;&gt; create the targets with add_custom_target(), I don&#39;t specify &quot;ALL&quot;.<br>
&gt;&gt;<br>
&gt;&gt; In my test with Visual Studio 2008, building the parent project results in<br>
&gt;&gt; these custom targets being built as well. According to your instruction,<br>
&gt;&gt; this should not happen, correct?<br>
&gt;&gt;<br>
&gt;&gt; On Wed, Apr 4, 2012 at 12:10 PM, David Cole &lt;<a href="mailto:david.cole@kitware.com">david.cole@kitware.com</a>&gt; wrote:<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Sure, just use add_custom_target without the &quot;ALL&quot; argument. If you<br>
&gt;&gt;&gt; don&#39;t use &quot;ALL&quot;, then the project is completely disconnected from<br>
&gt;&gt;&gt; ALL_BUILD and everything else, and will only be triggered when you<br>
&gt;&gt;&gt; explicitly build that target/project.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; HTH,<br>
&gt;&gt;&gt; David<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; On Wed, Apr 4, 2012 at 12:53 PM, Robert Dailey &lt;<a href="mailto:rcdailey.lists@gmail.com">rcdailey.lists@gmail.com</a>&gt;<br>
&gt;&gt;&gt; wrote:<br>
&gt;&gt;&gt; &gt; Hi,<br>
&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt; &gt; I have a custom target that just runs some commands that have nothing to<br>
&gt;&gt;&gt; &gt; do<br>
&gt;&gt;&gt; &gt; with building source. For convenience, when generating visual studio<br>
&gt;&gt;&gt; &gt; projects, I&#39;d like for that target to be included in the SLN generated<br>
&gt;&gt;&gt; &gt; by<br>
&gt;&gt;&gt; &gt; project() but I don&#39;t want to make it a dependency, since that would<br>
&gt;&gt;&gt; &gt; force<br>
&gt;&gt;&gt; &gt; it to build when I build any other project in the solution (I think).<br>
&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt; &gt; Is there a way to make a vcproj be included in a sln without it building<br>
&gt;&gt;&gt; &gt; as<br>
&gt;&gt;&gt; &gt; part of the dependency chain?<br>
&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt; &gt; Thanks in advance.<br>
&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt; &gt; --<br>
&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt; &gt; Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt; &gt; Visit other Kitware open-source projects at<br>
&gt;&gt;&gt; &gt; <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt; &gt; Please keep messages on-topic and check the CMake FAQ at:<br>
&gt;&gt;&gt; &gt; <a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt; &gt; Follow this link to subscribe/unsubscribe:<br>
&gt;&gt;&gt; &gt; <a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br>
&gt;&gt;<br>
&gt;&gt;<br>
</div></div></blockquote></div><br></div>