<span style>Does it make sense to make a feature request for this?</span><div><font color="#222222" face="arial, sans-serif"><br></font></div><div><font color="#222222" face="arial, sans-serif">(Sorry for the double-email David, I forgot to CC the list)<br>
</font><br><div class="gmail_quote">On Mon, Apr 9, 2012 at 7:11 AM, David Cole <span dir="ltr"><<a href="mailto:david.cole@kitware.com">david.cole@kitware.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">On Sun, Apr 8, 2012 at 10:42 PM, Robert Dailey <<a href="mailto:rcdailey.lists@gmail.com">rcdailey.lists@gmail.com</a>> wrote:<br>
> I guess there isn't a way to do this, seeing as how there is an absence of<br>
> responses after I clarified? :)<br>
><br>
<br>
</div>Correct.<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
><br>
> On Thu, Apr 5, 2012 at 10:31 AM, Robert Dailey <<a href="mailto:rcdailey.lists@gmail.com">rcdailey.lists@gmail.com</a>><br>
> wrote:<br>
>><br>
>> Thanks for the help guys.<br>
>><br>
>> I didn't realize it would be relevant, but I guess the order in which I<br>
>> call things matters. For example, ignoring the directory structure I use,<br>
>> the general order of my commands are as follows:<br>
>><br>
>> # This is done in the Root CMakeLists.txt<br>
>> add_custom_target( Foo ... )<br>
>><br>
>> # Several nested subdirectories down...<br>
>> project( Bar )<br>
>> add_executable( Bar )<br>
>><br>
>> I guess this order has an affect? I assume all of the add_*() commands<br>
>> need to occur *after* the project() call to be implicitly added to that<br>
>> solution. Unfortunately my structure cannot change, so that's why I was<br>
>> trying to use dependencies to get the job done.<br>
>><br>
>><br>
>> On Thu, Apr 5, 2012 at 8:58 AM, David Cole <<a href="mailto:david.cole@kitware.com">david.cole@kitware.com</a>> wrote:<br>
>>><br>
>>> This all assumes everything is in the same CMakeLists.txt.<br>
>>><br>
>>> I suspect since Robert is not already seeing the proper behavior that<br>
>>> he has complex cross-directory target and library distribution, but<br>
>>> wants to see them all in the sub-directory sln files, too... (maybe?)<br>
>>><br>
>>><br>
>>> On Wed, Apr 4, 2012 at 9:48 PM, Fraser Hutchison<br>
>>> <<a href="mailto:fraser.hutchison@gmail.com">fraser.hutchison@gmail.com</a>> wrote:<br>
>>> > David's original answer does what you require.<br>
>>> ><br>
>>> > Simply include add_custom_target(Foo ...) and don't include<br>
>>> > add_dependencies(Bar Foo).<br>
>>> ><br>
>>> > If your project is also called Bar, then Bar.sln will include<br>
>>> > Foo.vcproj and<br>
>>> > Bar.vcproj, but Foo will not be built when invoking "Build Solution".<br>
>>> ><br>
>>> > Cheers,<br>
>>> ><br>
>>> > Fraser.<br>
>>> ><br>
>>> ><br>
>>> ><br>
>>> ><br>
>>> > On 04/04/2012 21:33, Robert Dailey wrote:<br>
>>> ><br>
>>> > Sorry I think we are not on the same page.<br>
>>> ><br>
>>> > My custom target is: "Foo"<br>
>>> > My C++ executable target is: "Bar"<br>
>>> ><br>
>>> > I don't want Bar depend on Foo, because I do not want Foo's commands to<br>
>>> > execute when I build Bar. However, because Bar does not depend on Foo,<br>
>>> > Foo.vcproj will not be part of Bar.sln. I need a way to make sure that<br>
>>> > Foo.vcproj opens with Bar.sln without creating that dependency.<br>
>>> ><br>
>>> > I hope this makes a little more sense.<br>
>>> ><br>
>>> > On Wed, Apr 4, 2012 at 2:01 PM, David Cole <<a href="mailto:david.cole@kitware.com">david.cole@kitware.com</a>><br>
>>> > wrote:<br>
>>> >><br>
>>> >> Your original message said you didn't want to make it a dependency.<br>
>>> >> So, why then use "add_dependencies" ...?<br>
>>> >><br>
>>> >><br>
>>> >> On Wed, Apr 4, 2012 at 3:00 PM, David Cole <<a href="mailto:david.cole@kitware.com">david.cole@kitware.com</a>><br>
>>> >> wrote:<br>
>>> >> > Well, add_dependencies means that the custom target will be built<br>
>>> >> > *before* the target that needs it. So it becomes part of "ALL" if<br>
>>> >> > the<br>
>>> >> > other target is part of "ALL".<br>
>>> >> ><br>
>>> >> > I thought nothing depended on it, that's why I offered the leave out<br>
>>> >> > "ALL" advice. If something depends on it, then it's going to be<br>
>>> >> > executed before the thing that depends on it...<br>
>>> >> ><br>
>>> >> ><br>
>>> >> ><br>
>>> >> > On Wed, Apr 4, 2012 at 2:35 PM, Robert Dailey<br>
>>> >> > <<a href="mailto:rcdailey.lists@gmail.com">rcdailey.lists@gmail.com</a>><br>
>>> >> > wrote:<br>
>>> >> >> I add the custom targets as a dependency with add_dependencies(),<br>
>>> >> >> and I<br>
>>> >> >> create the targets with add_custom_target(), I don't specify "ALL".<br>
>>> >> >><br>
>>> >> >> In my test with Visual Studio 2008, building the parent project<br>
>>> >> >> results<br>
>>> >> >> in<br>
>>> >> >> these custom targets being built as well. According to your<br>
>>> >> >> instruction,<br>
>>> >> >> this should not happen, correct?<br>
>>> >> >><br>
>>> >> >> On Wed, Apr 4, 2012 at 12:10 PM, David Cole<br>
>>> >> >> <<a href="mailto:david.cole@kitware.com">david.cole@kitware.com</a>><br>
>>> >> >> wrote:<br>
>>> >> >>><br>
>>> >> >>> Sure, just use add_custom_target without the "ALL" argument. If<br>
>>> >> >>> you<br>
>>> >> >>> don't use "ALL", then the project is completely disconnected from<br>
>>> >> >>> ALL_BUILD and everything else, and will only be triggered when you<br>
>>> >> >>> explicitly build that target/project.<br>
>>> >> >>><br>
>>> >> >>><br>
>>> >> >>> HTH,<br>
>>> >> >>> David<br>
>>> >> >>><br>
>>> >> >>><br>
>>> >> >>> On Wed, Apr 4, 2012 at 12:53 PM, Robert Dailey<br>
>>> >> >>> <<a href="mailto:rcdailey.lists@gmail.com">rcdailey.lists@gmail.com</a>><br>
>>> >> >>> wrote:<br>
>>> >> >>> > Hi,<br>
>>> >> >>> ><br>
>>> >> >>> > I have a custom target that just runs some commands that have<br>
>>> >> >>> > nothing to<br>
>>> >> >>> > do<br>
>>> >> >>> > with building source. For convenience, when generating visual<br>
>>> >> >>> > studio<br>
>>> >> >>> > projects, I'd like for that target to be included in the SLN<br>
>>> >> >>> > generated<br>
>>> >> >>> > by<br>
>>> >> >>> > project() but I don't want to make it a dependency, since that<br>
>>> >> >>> > would<br>
>>> >> >>> > force<br>
>>> >> >>> > it to build when I build any other project in the solution (I<br>
>>> >> >>> > think).<br>
>>> >> >>> ><br>
>>> >> >>> > Is there a way to make a vcproj be included in a sln without it<br>
>>> >> >>> > building<br>
>>> >> >>> > as<br>
>>> >> >>> > part of the dependency chain?<br>
>>> >> >>> ><br>
>>> >> >>> > Thanks in advance.<br>
>>> >> >>> ><br>
>>> >> >>> > --<br>
>>> >> >>> ><br>
>>> >> >>> > Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
>>> >> >>> ><br>
>>> >> >>> > Visit other Kitware open-source projects at<br>
>>> >> >>> > <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
>>> >> >>> ><br>
>>> >> >>> > Please keep messages on-topic and check the CMake FAQ at:<br>
>>> >> >>> > <a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
>>> >> >>> ><br>
>>> >> >>> > Follow this link to subscribe/unsubscribe:<br>
>>> >> >>> > <a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br>
>>> >> >><br>
>>> >> >><br>
>>> ><br>
>>> ><br>
>>> ><br>
>>> ><br>
>>> > --<br>
>>> ><br>
>>> > Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
>>> ><br>
>>> > Visit other Kitware open-source projects at<br>
>>> > <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
>>> ><br>
>>> > Please keep messages on-topic and check the CMake FAQ at:<br>
>>> > <a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
>>> ><br>
>>> > Follow this link to subscribe/unsubscribe:<br>
>>> > <a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br>
>><br>
>><br>
><br>
</div></div></blockquote></div><br></div>