[CMake] How to change default target in solution?

aaron.meadows at thomsonreuters.com aaron.meadows at thomsonreuters.com
Fri Mar 11 12:44:44 EST 2011


Sorry, the .sln is what I meant by "the solution file generated by
CMake".  Thanks for catching that, it wasn't clear the way I wrote it.
=D  English fail!  

When I was smashing around in the solution file to try and get ALL_BUILD
to be the default project but also have it stored in the
PREDEFINED_TARGETS_FOLDER, I couldn't make sense of the choices it made
based on the ordering.

Really, Default Project doesn't make much sense in any case beyond the
most simple development effort.  I was trying to find someone that knew
why it's such a big requirement to have ALL_BUILD set as the default.
That was apparently the reason the change for Solution Folders which put
ALL_BUILD in the PREDEFINED_TARGETS_FOLDER was reverted.  As the author
of that patch commented, ALL_BUILD doesn't even do anything if you "run"
it in the debugger, so why is it such a big deal to have it the Default
Project?

Aaron C. Meadows 

-----Original Message-----
From: cmake-bounces at cmake.org [mailto:cmake-bounces at cmake.org] On Behalf
Of Bill Hoffman
Sent: Friday, March 11, 2011 10:23 AM
To: cmake at cmake.org
Subject: Re: [CMake] How to change default target in solution?

On 3/11/2011 9:56 AM, aaron.meadows at thomsonreuters.com wrote:
> You can't.
>
> The default target is stored in the .suo file.  That file is generated
> by visual studio when it loads the solution file.  The rules that
Visual
> studio uses for chosing the default target are not published and don't
> seem to make a lot of sense.  The reason that ALL_BUILD is marked as
the
> default target has to do with the order of projects listed in the
> solution file generated by CMake.  That order is no adjustable in
CMake,
> and other factors can change the behavior.
>
> I had a conversation on the list this week about it already, with
> regards to the project folders and getting ALL_BUILD to be placed in
the
> default cmake projects folder.  I played around with the generated
> solution file, forcing ALL_BUILD into that folder manually, and it
then
> chose the INSTALL target as the default, even though all I had done
was
> add a refrence to the ALL_BUILD project in the folder grouping.
Weird.
>
> You'll just have to chose the default target manually after loading
the
> solution.
>

Actually, I think that VS picks the default target based on the order 
that it shows up in the .sln file.  I have never gotten around to 
verifying this or seeing if there was a way to add a property that would

do the re-order.  But, if this does work, it might actually be possible 
to implement this.

-Bill
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at:
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

This email was sent to you by Thomson Reuters, the global news and information company.
Any views expressed in this message are those of the individual sender, except where the sender specifically states them to be the views of Thomson Reuters.




More information about the CMake mailing list