Re: [CMake] Under Visual Studio , allow developers to hit F7 to run the INSTALL target
Yuri, Your suggestion is close to what I’m looking for. What I need is a easy way to not this as the “Startup Project” , I need to change the property of the INSTALL target itself. By default, the INSTALL target is not in the “all” or if you open the properties on the Solution , you will find the “Build” selection for INSTALL is not selected. I’m trying to avoid changing Cmake’s C++ for this issue, even for an optional setting. It’s not a great practice to try to run INSTALL no matter what but, I’m getting a strong opinion from users that traditionally work under Visual Studio only stating it’s Ok to run INSTALL and just watch over build errors. ++David-Bjornbak; From: Yuri Timenkov [mailto:y...@timenkov.ru] Sent: Wednesday, February 08, 2012 7:27 PM To: BJORNBAK,DAVID (A-Sonoma,ex1) Cc: cmake@cmake.org Subject: Re: [CMake] Under Visual Studio , allow developers to hit F7 to run the INSTALL target I use a special macro for such purposes, something like this: Sub Install() Dim prj As Project Dim sb As SolutionBuild = DTE.Solution.SolutionBuild Dim prjs As Projects = DTE.Solution.Projects For Each prj In prjs If prj.Name = INSTALL Then sb.BuildProject(sb.ActiveConfiguration.Namehttp://sb.ActiveConfiguration.Name, prj.UniqueName) Exit For End If Next End Sub Good thing is that you can put it on toolbar or bind to hot key and run it separately (while keeping active project you're debugging). On Tue, Feb 7, 2012 at 11:47 PM, david_bjorn...@agilent.commailto:david_bjorn...@agilent.com wrote: 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; -- Powered by www.kitware.comhttp://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 -- 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
Re: [CMake] Under Visual Studio , allow developers to hit F7 to run the INSTALL target
I dug into CMake’s C++ code and found there’s a generic setting named EXCLUDE_FROM_ALL that most “targets” use to decide if a project should be under the default build but, there’s particular target type named “GLOBAL_TARGET” does use this setting and it’s always excluded from all. Based on what I’m reading in the CMake’s C++, the safest place to make a optional change is right at the point where it’s generating Visual Studio files. The other logic spot in in a function cmGlobalGenerator::CreateGlobalTarget but, changes here will create a larger ripple effect on what will most likely go wrong with this type of tinkering. The following is the spot in the code I have in mind changing and picking up both an optional setting and the current “target name” being “INSTALL” Let me know if there’s a better way to allow Visual Studio developers to hit “F7” and have the “INSTALL” target/vs project run for them. This current C++ will be a private patch for my team but, I prefer if we can have a more public optional setting for this request. bool cmGlobalVisualStudio7Generator::IsPartOfDefaultBuild(const char* project, cmTarget* target) { if(target-GetPropertyAsBool(EXCLUDE_FROM_DEFAULT_BUILD)) { return false; } // if it is a utilitiy target then only make it part of the // default build if another target depends on it int type = target-GetType(); if (type == cmTarget::GLOBAL_TARGET) { return false; } if(type == cmTarget::UTILITY) { return this-IsDependedOn(project, target); } // default is to be part of the build return true; } The return false after type == cmTarget::GLOBAL_TARGET will become if ( strcmp(target-GetName(),INSTALL) == 0SOME_OPTIONAL_SETTING ) return true; else return false; } ++David-Bjornbak; From: Yuri Timenkov [mailto:y...@timenkov.ru] Sent: Wednesday, February 08, 2012 7:27 PM To: BJORNBAK,DAVID (A-Sonoma,ex1) Cc: cmake@cmake.org Subject: Re: [CMake] Under Visual Studio , allow developers to hit F7 to run the INSTALL target I use a special macro for such purposes, something like this: Sub Install() Dim prj As Project Dim sb As SolutionBuild = DTE.Solution.SolutionBuild Dim prjs As Projects = DTE.Solution.Projects For Each prj In prjs If prj.Name = INSTALL Then sb.BuildProject(sb.ActiveConfiguration.Namehttp://sb.ActiveConfiguration.Name, prj.UniqueName) Exit For End If Next End Sub Good thing is that you can put it on toolbar or bind to hot key and run it separately (while keeping active project you're debugging). On Tue, Feb 7, 2012 at 11:47 PM, david_bjorn...@agilent.commailto:david_bjorn...@agilent.com wrote: 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; -- Powered by www.kitware.comhttp://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 -- 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
Re: [CMake] Under Visual Studio , allow developers to hit F7 to run the INSTALL target
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-boun...@cmake.org [mailto:cmake-boun...@cmake.org] On Behalf Of david_bjorn...@agilent.com Sent: Tuesday, February 07, 2012 1:48 PM To: cmake@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.-- 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
Re: [CMake] Under Visual Studio , allow developers to hit F7 to run the INSTALL target
What I'm asking for is 1) or Can you set things up so that F7 does a full build and then automatically does the INSTALL target build? Developers in my team have expressed a need to hit F7 during they're day to day work and the resulting being the INSTALL target. This is not a general change I would adopt for our automated build processes and I can see the need for an individual developer using Visual Studio having this functionality e.g. hit F7 and have the INSTALL target fire off. A post build step appears to be the only present option for this request. The other alternative is to alter CMake's C++ code and change the dependency and behavior or the generator for Visual Studio. ++David-Bjornbak; From: aaron.mead...@thomsonreuters.com [mailto:aaron.mead...@thomsonreuters.com] Sent: Wednesday, February 08, 2012 7:33 AM To: BJORNBAK,DAVID (A-Sonoma,ex1); cmake@cmake.org Subject: RE: [CMake] Under Visual Studio , allow developers to hit F7 to run the INSTALL target 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-boun...@cmake.org [mailto:cmake-boun...@cmake.org] On Behalf Of david_bjorn...@agilent.com Sent: Tuesday, February 07, 2012 1:48 PM To: cmake@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. -- 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
Re: [CMake] Under Visual Studio , allow developers to hit F7 to run the INSTALL target
I wonder if you could do something like: set_target_properties(INSTALL PROPERTIES EXCLUDE_FROM_DEFAULT_BUILD 0 ) Aaron Meadows From: david_bjorn...@agilent.com [mailto:david_bjorn...@agilent.com] Sent: Wednesday, February 08, 2012 9:44 AM To: Meadows, Aaron C.; cmake@cmake.org Subject: RE: [CMake] Under Visual Studio , allow developers to hit F7 to run the INSTALL target What I'm asking for is 1) or Can you set things up so that F7 does a full build and then automatically does the INSTALL target build? Developers in my team have expressed a need to hit F7 during they're day to day work and the resulting being the INSTALL target. This is not a general change I would adopt for our automated build processes and I can see the need for an individual developer using Visual Studio having this functionality e.g. hit F7 and have the INSTALL target fire off. A post build step appears to be the only present option for this request. The other alternative is to alter CMake's C++ code and change the dependency and behavior or the generator for Visual Studio. ++David-Bjornbak; From: aaron.mead...@thomsonreuters.com [mailto:aaron.mead...@thomsonreuters.com] Sent: Wednesday, February 08, 2012 7:33 AM To: BJORNBAK,DAVID (A-Sonoma,ex1); cmake@cmake.org Subject: RE: [CMake] Under Visual Studio , allow developers to hit F7 to run the INSTALL target 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-boun...@cmake.org [mailto:cmake-boun...@cmake.org] On Behalf Of david_bjorn...@agilent.com Sent: Tuesday, February 07, 2012 1:48 PM To: cmake@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. 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.-- 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
Re: [CMake] Under Visual Studio , allow developers to hit F7 to run the INSTALL target
I've tried similar techniques with ADD_DEPENDENCIES to ALL_BUILD and the trouble with this, within a single project these targets are not generated yet and you would have to change CMake's C++ code to change this type of behavior. CMake Error at CMakeLists.txt:231 (set_target_properties): set_target_properties Can not find target to add properties to: INSTALL You might be able to export the target but, I don't believe you can export and import INSTALL and ALL_BUILD targets in a reasonable manner. ++David-Bjornbak; From: aaron.mead...@thomsonreuters.com [mailto:aaron.mead...@thomsonreuters.com] Sent: Wednesday, February 08, 2012 7:55 AM To: BJORNBAK,DAVID (A-Sonoma,ex1); cmake@cmake.org Subject: RE: [CMake] Under Visual Studio , allow developers to hit F7 to run the INSTALL target I wonder if you could do something like: set_target_properties(INSTALL PROPERTIES EXCLUDE_FROM_DEFAULT_BUILD 0 ) Aaron Meadows From: david_bjorn...@agilent.com [mailto:david_bjorn...@agilent.com] Sent: Wednesday, February 08, 2012 9:44 AM To: Meadows, Aaron C.; cmake@cmake.org Subject: RE: [CMake] Under Visual Studio , allow developers to hit F7 to run the INSTALL target What I'm asking for is 1) or Can you set things up so that F7 does a full build and then automatically does the INSTALL target build? Developers in my team have expressed a need to hit F7 during they're day to day work and the resulting being the INSTALL target. This is not a general change I would adopt for our automated build processes and I can see the need for an individual developer using Visual Studio having this functionality e.g. hit F7 and have the INSTALL target fire off. A post build step appears to be the only present option for this request. The other alternative is to alter CMake's C++ code and change the dependency and behavior or the generator for Visual Studio. ++David-Bjornbak; From: aaron.mead...@thomsonreuters.commailto:aaron.mead...@thomsonreuters.com [mailto:aaron.mead...@thomsonreuters.com]mailto:[mailto:aaron.mead...@thomsonreuters.com] Sent: Wednesday, February 08, 2012 7:33 AM To: BJORNBAK,DAVID (A-Sonoma,ex1); cmake@cmake.orgmailto:cmake@cmake.org Subject: RE: [CMake] Under Visual Studio , allow developers to hit F7 to run the INSTALL target 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-boun...@cmake.orgmailto:cmake-boun...@cmake.org [mailto:cmake-boun...@cmake.org]mailto:[mailto:cmake-boun...@cmake.org] On Behalf Of david_bjorn...@agilent.commailto:david_bjorn...@agilent.com Sent: Tuesday, February 07, 2012 1:48 PM To: cmake@cmake.orgmailto:cmake@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
Re: [CMake] Under Visual Studio , allow developers to hit F7 to run the INSTALL target
Ah, that makes sense. Wonder how hard it would be to add a Pseudo-target to CMake for the targets it will build, and allow the scripts to set some properties on them which would be imported later as they are created... Aaron Meadows From: david_bjorn...@agilent.com [mailto:david_bjorn...@agilent.com] Sent: Wednesday, February 08, 2012 10:14 AM To: Meadows, Aaron C.; cmake@cmake.org Subject: RE: [CMake] Under Visual Studio , allow developers to hit F7 to run the INSTALL target I've tried similar techniques with ADD_DEPENDENCIES to ALL_BUILD and the trouble with this, within a single project these targets are not generated yet and you would have to change CMake's C++ code to change this type of behavior. CMake Error at CMakeLists.txt:231 (set_target_properties): set_target_properties Can not find target to add properties to: INSTALL You might be able to export the target but, I don't believe you can export and import INSTALL and ALL_BUILD targets in a reasonable manner. ++David-Bjornbak; From: aaron.mead...@thomsonreuters.com [mailto:aaron.mead...@thomsonreuters.com] Sent: Wednesday, February 08, 2012 7:55 AM To: BJORNBAK,DAVID (A-Sonoma,ex1); cmake@cmake.org Subject: RE: [CMake] Under Visual Studio , allow developers to hit F7 to run the INSTALL target I wonder if you could do something like: set_target_properties(INSTALL PROPERTIES EXCLUDE_FROM_DEFAULT_BUILD 0 ) Aaron Meadows From: david_bjorn...@agilent.com [mailto:david_bjorn...@agilent.com] Sent: Wednesday, February 08, 2012 9:44 AM To: Meadows, Aaron C.; cmake@cmake.org Subject: RE: [CMake] Under Visual Studio , allow developers to hit F7 to run the INSTALL target What I'm asking for is 1) or Can you set things up so that F7 does a full build and then automatically does the INSTALL target build? Developers in my team have expressed a need to hit F7 during they're day to day work and the resulting being the INSTALL target. This is not a general change I would adopt for our automated build processes and I can see the need for an individual developer using Visual Studio having this functionality e.g. hit F7 and have the INSTALL target fire off. A post build step appears to be the only present option for this request. The other alternative is to alter CMake's C++ code and change the dependency and behavior or the generator for Visual Studio. ++David-Bjornbak; From: aaron.mead...@thomsonreuters.com [mailto:aaron.mead...@thomsonreuters.com] Sent: Wednesday, February 08, 2012 7:33 AM To: BJORNBAK,DAVID (A-Sonoma,ex1); cmake@cmake.org Subject: RE: [CMake] Under Visual Studio , allow developers to hit F7 to run the INSTALL target 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-boun...@cmake.org [mailto:cmake-boun...@cmake.org] On Behalf Of david_bjorn...@agilent.com Sent: Tuesday, February 07, 2012 1:48 PM To: cmake@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
Re: [CMake] Under Visual Studio , allow developers to hit F7 to run the INSTALL target
I use a special macro for such purposes, something like this: Sub Install() Dim prj As Project Dim sb As SolutionBuild = DTE.Solution.SolutionBuild Dim prjs As Projects = DTE.Solution.Projects For Each prj In prjs If prj.Name = INSTALL Then sb.BuildProject(sb.ActiveConfiguration.Name, prj.UniqueName) Exit For End If Next End Sub Good thing is that you can put it on toolbar or bind to hot key and run it separately (while keeping active project you're debugging). On Tue, Feb 7, 2012 at 11:47 PM, david_bjorn...@agilent.com wrote: 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; ** ** -- 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 -- 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