MantisBT - CMake
View Issue Details
0002827CMakeCMakepublic2006-02-03 12:382006-08-31 10:47
David Cole 
Bill Hoffman 
lowfeaturealways
closedfixed 
 
 
0002827: Visual Studio generators should not produce an INSTALL target if there are no install commands
I think CMake should only add an INSTALL target in generated Visual Studio projects (and other IDEs) if there are actually any files that end up needing to be installed...

Similar to the way there is only a RUN_TESTS target if any tests get added.

Currently, if no tests are added, there is no RUN_TESTS target. Similarly, if no files or targets need installing, there should be no INSTALL target.
No tags attached.
Issue History

Notes
(0004808)
Brad King   
2006-08-29 16:12   
This is a tricky change. The RUN_TESTS target is actually enabled by the ENABLE_TESTING command which the user must explicitly call at the top of the project. The INSTALL target would have to be magically enabled at the top of a project if any INSTALL* commands are invoked anywhere in the tree. No command does something like this right now, and we don't want an ENABLE_INSTALL command.
(0004810)
Brad King   
2006-08-29 17:00   
Okay, we can just create a member variable in cmGlobalGenerator that records whether any installation targets have been specified. That can be tested before adding the install target.
(0004817)
Brad King   
2006-08-31 10:47   
The following changes implement this feature:

/cvsroot/CMake/CMake/Source/cmGlobalGenerator.cxx,v <-- cmGlobalGenerator.cxx
new revision: 1.151; previous revision: 1.150
/cvsroot/CMake/CMake/Source/cmGlobalGenerator.h,v <-- cmGlobalGenerator.h
new revision: 1.66; previous revision: 1.65
/cvsroot/CMake/CMake/Source/cmInstallCommand.cxx,v <-- cmInstallCommand.cxx
new revision: 1.16; previous revision: 1.15
/cvsroot/CMake/CMake/Source/cmInstallFilesCommand.cxx,v <-- cmInstallFilesCommand.cxx
new revision: 1.22; previous revision: 1.21
/cvsroot/CMake/CMake/Source/cmInstallProgramsCommand.cxx,v <-- cmInstallProgramsCommand.cxx
new revision: 1.15; previous revision: 1.14
/cvsroot/CMake/CMake/Source/cmInstallTargetsCommand.cxx,v <-- cmInstallTargetsCommand.cxx
new revision: 1.14; previous revision: 1.13