[CMake] Under Visual Studio , allow developers to hit "F7" to run the INSTALL target

aaron.meadows at thomsonreuters.com aaron.meadows at thomsonreuters.com
Wed Feb 8 10:33:14 EST 2012


I had a hard time following these questions.  It sounds like you're
asking the following:

 

1)     Can you set things up so that F7 does a full build and then
automatically does the INSTALL target build?

2)     Can you set things up so that you can build a sub project and
have it install just that sub project automatically?

 

Assuming those are your questions, I'm guessing there isn't a good way
to do that automatically.  Barring any better suggestions from more
experienced CMaketeers, I would probably look into creating a function
that adds a post build step to a project which will perform the
installation of the project.  Then doing a build all would cause each
project to individually build and install, and building a single
subproject would cause that subproject to build and install (thus
solving 1 and 2 together).  That doesn't seem ideal (certainly, I
wouldn't want my build to automatically install all the time, which is
probably why the INSTALL project is excluded by default.).  Depending on
what you are doing, you might want that auto install behavior to only be
tied to a "Release" build, or possibly introduce and "Release and
Install" that does both.

 

 

Aaron Meadows

 

From: cmake-bounces at cmake.org [mailto:cmake-bounces at cmake.org] On Behalf
Of david_bjornbak at agilent.com
Sent: Tuesday, February 07, 2012 1:48 PM
To: cmake at cmake.org
Subject: [CMake] Under Visual Studio , allow developers to hit "F7" to
run the INSTALL target

 

Developers on our team have found issues with the difference between
"INSTALL" and the default build or "F7" build all under Visual Studio.
My question is, there's a reasonable way to configure cmake or Visual
Studio to run the INSTALL target when you hit "F7" or use the default
"Build Solution" functionality to run INSTALL.

 

We're working a fairly large project and the default setting of having
INSTALL dependent on ALL or separating out the two targets makes sense
when you're building the entire project.

 

However, we allow developers to build sub projects and it makes sense if
these sub project just install quickly into a larger pre-built
installation directory.  The confusion currently is, they run ALL_BUILD
or "F7" and the build finishes and they forget to run "INSTALL".
Particularly we, had developers that worked formally on smaller
non-Cmake Visual Studio projects and not Linux so, they're not used to
the make all and then make install defacto standard.


This request is similar as the following on "Selecting INSTALL target in
Visual Studio Configuration by default"  but, I wanted to see if anyone
had any other suggestions on this topic.


http://www.cmake.org/pipermail/cmake/2011-April/044025.html

 

++David->Bjornbak;

 


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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20120208/a837420b/attachment-0001.htm>


More information about the CMake mailing list