Re: [CMake] Forcing project to be included in a solution?

2012-04-11 Thread Robert Dailey
I have created a feature request for this here: http://public.kitware.com/Bug/view.php?id=13122 On Mon, Apr 9, 2012 at 1:45 PM, Robert Dailey wrote: > A lot of people on my team do not want to open the "global" project > though. It includes everything, even the parts they don't want to build. > M

Re: [CMake] Forcing project to be included in a solution?

2012-04-09 Thread Robert Dailey
A lot of people on my team do not want to open the "global" project though. It includes everything, even the parts they don't want to build. Mostly it's a clutter issue, I think. For example, there may be 200 projects but they only care about 100 of those (all dependencies included). The other 100

Re: [CMake] Forcing project to be included in a solution?

2012-04-09 Thread Michael Jackson
Is it possible for you to add a "project(...)" command in your most outer CMakeLists.txt file? I do this all the time where I have a project that has lots of sub-projects like yours, even git-submodules, and I have a single .sln file that has ALL the various projects that CMake has found. --- M

Re: [CMake] Forcing project to be included in a solution?

2012-04-09 Thread Robert Dailey
Does it make sense to make a feature request for this? (Sorry for the double-email David, I forgot to CC the list) On Mon, Apr 9, 2012 at 7:11 AM, David Cole wrote: > On Sun, Apr 8, 2012 at 10:42 PM, Robert Dailey > wrote: > > I guess there isn't a way to do this, seeing as how there is an abs

Re: [CMake] Forcing project to be included in a solution?

2012-04-09 Thread David Cole
On Sun, Apr 8, 2012 at 10:42 PM, Robert Dailey wrote: > I guess there isn't a way to do this, seeing as how there is an absence of > responses after I clarified? :) > Correct. > > On Thu, Apr 5, 2012 at 10:31 AM, Robert Dailey > wrote: >> >> Thanks for the help guys. >> >> I didn't realize it

Re: [CMake] Forcing project to be included in a solution?

2012-04-08 Thread Robert Dailey
I guess there isn't a way to do this, seeing as how there is an absence of responses after I clarified? :) On Thu, Apr 5, 2012 at 10:31 AM, Robert Dailey wrote: > Thanks for the help guys. > > I didn't realize it would be relevant, but I guess the order in which I > call things matters. For examp

Re: [CMake] Forcing project to be included in a solution?

2012-04-05 Thread Robert Dailey
Thanks for the help guys. I didn't realize it would be relevant, but I guess the order in which I call things matters. For example, ignoring the directory structure I use, the general order of my commands are as follows: # This is done in the Root CMakeLists.txt add_custom_target( Foo ... ) # Se

Re: [CMake] Forcing project to be included in a solution?

2012-04-05 Thread David Cole
This all assumes everything is in the same CMakeLists.txt. I suspect since Robert is not already seeing the proper behavior that he has complex cross-directory target and library distribution, but wants to see them all in the sub-directory sln files, too... (maybe?) On Wed, Apr 4, 2012 at 9:48 P

Re: [CMake] Forcing project to be included in a solution?

2012-04-04 Thread Fraser Hutchison
David's original answer does what you require. Simply include |add_custom_target(Foo ...)| and don't include |add_dependencies(Bar Foo)|. If your project is also called Bar, then Bar.sln will include Foo.vcproj and Bar.vcproj, but Foo will not be built when invoking "Build Solution". Cheers

Re: [CMake] Forcing project to be included in a solution?

2012-04-04 Thread Robert Dailey
Sorry I think we are not on the same page. My custom target is: "Foo" My C++ executable target is: "Bar" I don't want Bar depend on Foo, because I do not want Foo'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

Re: [CMake] Forcing project to be included in a solution?

2012-04-04 Thread David Cole
Your original message said you didn't want to make it a dependency. So, why then use "add_dependencies" ...? On Wed, Apr 4, 2012 at 3:00 PM, David Cole wrote: > Well, add_dependencies means that the custom target will be built > *before* the target that needs it. So it becomes part of "ALL" if t

Re: [CMake] Forcing project to be included in a solution?

2012-04-04 Thread David Cole
Well, add_dependencies means that the custom target will be built *before* the target that needs it. So it becomes part of "ALL" if the other target is part of "ALL". I thought nothing depended on it, that's why I offered the leave out "ALL" advice. If something depends on it, then it's going to b

Re: [CMake] Forcing project to be included in a solution?

2012-04-04 Thread Robert Dailey
I add the custom targets as a dependency with add_dependencies(), and I create the targets with add_custom_target(), I don't specify "ALL". In my test with Visual Studio 2008, building the parent project results in these custom targets being built as well. According to your instruction, this shoul

Re: [CMake] Forcing project to be included in a solution?

2012-04-04 Thread David Cole
Sure, just use add_custom_target without the "ALL" argument. If you don't use "ALL", then the project is completely disconnected from ALL_BUILD and everything else, and will only be triggered when you explicitly build that target/project. HTH, David On Wed, Apr 4, 2012 at 12:53 PM, Robert Daile

[CMake] Forcing project to be included in a solution?

2012-04-04 Thread Robert Dailey
Hi, I have a custom target that just runs some commands that have nothing to do with building source. For convenience, when generating visual studio projects, I'd like for that target to be included in the SLN generated by project() but I don't want to make it a dependency, since that would force