MantisBT - CMake
View Issue Details
0006847CMakeCPackpublic2008-04-17 21:302008-07-15 11:28
Douglas Gregor 
Bill Hoffman 
normalfeatureN/A
closedfixed 
CMake-2-6 
CMake-2-6 
0006847: CPack installers should allow users to select different components to install
CPack's generated installers currently install everything that the CMake "install" target installs. However, it is common for binary installers (especially on Windows and Mac OS X) to permit users to select/unselect specific components to be installed. For example, one might choose not to install the headers or .lib files when they come with an application.

The attached file contains a preliminary implementation for CPack that works with the NSIS installer, creating a separate "Components" page in the installation. The archive contains an example, a patch against CMake CVS, and the extra header I added that TortoiseCVS refuses to put in the patch :)
No tags attached.
has duplicate 0006835closed David Cole Multi-component packaging support 
patch CPack-components-update.patch (75,123) 2008-07-03 09:24
https://public.kitware.com/Bug/file/1575/CPack-components-update.patch
Issue History
2008-04-17 21:30Douglas GregorNew Issue
2008-04-17 21:30Douglas GregorFile Added: NSIS Component Install.zip
2008-04-18 10:59Douglas GregorFile Added: NSIS Component Install-v2.zip
2008-04-18 11:00Douglas GregorNote Added: 0011430
2008-04-18 12:48YuriNote Added: 0011432
2008-04-18 13:47Douglas GregorNote Added: 0011436
2008-04-19 14:21Douglas GregorFile Added: NSIS Component Install-v3.zip
2008-04-19 14:22Douglas GregorNote Added: 0011439
2008-04-19 18:57Douglas GregorFile Added: NSIS Component Install-v4.zip
2008-04-19 18:58Douglas GregorNote Added: 0011442
2008-05-22 22:20Douglas GregorFile Added: NSIS Component Install-v5.zip
2008-05-22 22:22Douglas GregorNote Added: 0012084
2008-05-22 22:53Brad KingStatusnew => assigned
2008-05-22 22:53Brad KingAssigned To => David Cole
2008-05-22 23:50Douglas GregorFile Added: NSIS Component Install-v6.zip
2008-05-22 23:50Douglas GregorNote Added: 0012086
2008-05-26 12:15Douglas GregorFile Added: NSIS Component Install-v7.zip
2008-05-26 12:15Douglas GregorNote Added: 0012109
2008-05-26 12:16Douglas GregorFile Deleted: NSIS Component Install.zip
2008-06-09 05:40Douglas GregorFile Added: CPack-Components.patch
2008-06-16 11:04Douglas GregorFile Deleted: CPack-Components.patch
2008-06-16 11:27Douglas GregorFile Added: CPack-Components.patch
2008-06-16 11:31Douglas GregorFile Deleted: NSIS Component Install-v7.zip
2008-06-16 11:31Douglas GregorFile Deleted: NSIS Component Install-v2.zip
2008-06-16 11:32Douglas GregorFile Deleted: NSIS Component Install-v3.zip
2008-06-16 11:32Douglas GregorFile Deleted: NSIS Component Install-v4.zip
2008-06-16 11:32Douglas GregorFile Deleted: NSIS Component Install-v5.zip
2008-06-16 11:32Douglas GregorFile Deleted: NSIS Component Install-v6.zip
2008-06-16 11:35Douglas GregorNote Added: 0012346
2008-06-16 11:46David ColeNote Added: 0012347
2008-06-16 14:00Douglas GregorNote Added: 0012348
2008-06-16 16:44Douglas GregorFile Deleted: CPack-Components.patch
2008-06-16 16:44Douglas GregorFile Added: CPack-Components.patch
2008-06-16 18:15Douglas GregorFile Deleted: CPack-Components.patch
2008-06-16 18:16Douglas GregorFile Added: CPack-Components.patch
2008-06-16 18:22Douglas GregorFile Deleted: CPack-Components.patch
2008-06-16 18:23Douglas GregorFile Added: CPack-Components.patch
2008-06-17 10:12David ColeNote Added: 0012358
2008-06-17 11:42David ColeStatusassigned => resolved
2008-06-17 11:42David ColeResolutionopen => fixed
2008-06-17 11:42David ColeNote Added: 0012360
2008-06-17 11:42David ColeAssigned ToDavid Cole => Bill Hoffman
2008-06-17 11:42David ColeStatusresolved => feedback
2008-06-17 11:42David ColeResolutionfixed => reopened
2008-06-17 11:42David ColeNote Added: 0012361
2008-06-17 12:46David ColeNote Added: 0012366
2008-06-17 13:38David ColeRelationship addedhas duplicate 0006835
2008-06-17 14:08David ColeNote Added: 0012373
2008-06-18 07:11David ColeNote Added: 0012393
2008-06-18 09:30David ColeNote Added: 0012398
2008-06-18 14:28David ColeNote Added: 0012406
2008-06-18 16:00David ColeNote Added: 0012410
2008-06-19 11:10David ColeNote Added: 0012417
2008-06-24 22:40Douglas GregorFile Added: CPack-component-interface.patch
2008-06-24 22:40Douglas GregorFile Added: ComponentExample.zip
2008-06-25 17:49Douglas GregorFile Deleted: CPack-component-interface.patch
2008-06-25 17:49Douglas GregorFile Deleted: CPack-Components.patch
2008-06-25 17:49Douglas GregorFile Deleted: ComponentExample.zip
2008-07-03 09:24Douglas GregorFile Added: CPack-components-update.patch
2008-07-15 11:28Douglas GregorStatusfeedback => closed
2008-07-15 11:28Douglas GregorNote Added: 0012705
2008-07-15 11:28Douglas GregorResolutionreopened => fixed
2008-07-15 11:28Douglas GregorFixed in Version => CMake-2-6

Notes
(0011430)
Douglas Gregor   
2008-04-18 11:00   
The "v2" patch here contains add/remove functionality.
(0011432)
Yuri   
2008-04-18 12:48   
Good idea. I filed similar request 0006835. If this syntax will be adopted It could be easily ported to other packaging tools like rpm. I just solver this problem from user's point of view, not developer's.

IMHO it is bad idea to store std::vector of raw pointer which should be deleted. Usually, I prefer put whole structure into container if I don't want polymorphic behavior.
(0011436)
Douglas Gregor   
2008-04-18 13:47   
Yes, I'm hoping that the syntax is flexible enough to work with other packaging tools. It certainly should work with Mac OS X's multi-package installs, and could be used to generate multiple RPMs (with dependencies, once that feature gets implemented).

As for the vector of raw pointers... the right way to deal with this would be to make the two std::map's contain instances of cmCPackComponent and cmPackComponentGroup, respectively, rather than pointers. The raw pointers in the vectors will be pointers into these maps. I should able to fix that for "v3".
(0011439)
Douglas Gregor   
2008-04-19 14:22   
The "v3" cleans up the code (as suggested by Yuri) and introduces two new features:
  - Inter-component dependencies can now be specified
  - Component descriptions can be specified
(0011442)
Douglas Gregor   
2008-04-19 18:58   
The "v4" patch introduces "installation types", which are pre-selected sets of components. As with all of the other features, installation types are entirely optional.
(0012084)
Douglas Gregor   
2008-05-22 22:22   
The "v5" patch simplifies the CPACK_COMPONENT_* variable naming scheme, by eliminating the (redundant) project name.
(0012086)
Douglas Gregor   
2008-05-22 23:50   
The "v6" patch adds the ability to provide a description for a component group (e.g., via CPACK_COMPONENT_GROUP_DEVELOPMENT_DESCRIPTION).
(0012109)
Douglas Gregor   
2008-05-26 12:15   
The "v7" patch adds support for newlines in the description of components.
(0012346)
Douglas Gregor   
2008-06-16 11:35   
The patch now includes complete support for both Windows installers (via NSIS) and Mac OS X installers (via PackageMaker), including component dependencies. There is a description and tutorial at http://www.cmake.org/Wiki/CMake:Component_Install_With_CPack [^]

All previous versions of this patch have been removed.
(0012347)
David Cole   
2008-06-16 11:46   
I am working on pushing this patch into CVS HEAD of the CMake source tree. I was working on v7 of the patch, but will now pick up this alternate version that you've uploaded...

I had to eliminate a bunch of tab characters (and replace them with spaces and then re-align the code to fit CMake's style...)

Would you mind submitting a patch that does not have any tab characters in it? And align the code according to CMake style? That would make it way less time consuming to integrate.

Thanks. Contact me directly at david.cole at kitware dot com if you have any other pending changes. Otherwise, I expect I can commit this patch in the next day or two.
(0012348)
Douglas Gregor   
2008-06-16 14:00   
Visual Studio seems to have uglified my sources. I'll clean up the formatting and remove the tabs, then update the patch.
(0012358)
David Cole   
2008-06-17 10:12   
I have pulled the latest patch from this issue and am working on merging it into CVS CMake right now...
(0012360)
David Cole   
2008-06-17 11:42   
Patch applied to CVS HEAD of CMake -- will assign to Bill to merge into CMake-2-6...


ENH: Add patch for feature request 0006847 - CPack components for NSIS and
PackageMaker installers. Thanks to Doug Gregor for all the hard work involved with implementing this patch! Also added new test CPackComponents that is conditionally executed only when NSIS or PackageMaker installer builders are
available.


/cvsroot/CMake/CMake/Modules/CPack.Info.plist.in,v <-- Modules/CPack.Info.plist.in
new revision: 1.6; previous revision: 1.5
/cvsroot/CMake/CMake/Modules/NSIS.template.in,v <-- Modules/NSIS.template.in
new revision: 1.27; previous revision: 1.26
/cvsroot/CMake/CMake/Modules/CPack.distribution.dist.in,v <-- Modules/CPack.distribution.dist.in
initial revision: 1.1
/cvsroot/CMake/CMake/Source/CPack/cmCPackGenerator.cxx,v <-- Source/CPack/cmCPackGenerator.cxx
new revision: 1.7; previous revision: 1.6
/cvsroot/CMake/CMake/Source/CPack/cmCPackGenerator.h,v <-- Source/CPack/cmCPackGenerator.h
new revision: 1.3; previous revision: 1.2
/cvsroot/CMake/CMake/Source/CPack/cmCPackNSISGenerator.cxx,v <-- Source/CPack/cmCPackNSISGenerator.cxx
new revision: 1.32; previous revision: 1.31
/cvsroot/CMake/CMake/Source/CPack/cmCPackNSISGenerator.h,v <-- Source/CPack/cmCPackNSISGenerator.h
new revision: 1.12; previous revision: 1.11
/cvsroot/CMake/CMake/Source/CPack/cmCPackPackageMakerGenerator.cxx,v <-- Source/CPack/cmCPackPackageMakerGenerator.cxx
new revision: 1.24; previous revision: 1.23
/cvsroot/CMake/CMake/Source/CPack/cmCPackPackageMakerGenerator.h,v <-- Source/CPack/cmCPackPackageMakerGenerator.h
new revision: 1.13; previous revision: 1.12
/cvsroot/CMake/CMake/Source/CPack/cmCPackComponentGroup.h,v <-- Source/CPack/cmCPackComponentGroup.h
initial revision: 1.1
/cvsroot/CMake/CMake/Tests/CMakeLists.txt,v <-- Tests/CMakeLists.txt
new revision: 1.53; previous revision: 1.52
/cvsroot/CMake/CMake/Tests/SimpleInstallS2/CMakeLists.txt,v <-- Tests/SimpleInstallS2/CMakeLists.txt
new revision: 1.99; previous revision: 1.98
/cvsroot/CMake/CMake/Tests/SimpleInstall/CMakeLists.txt,v <-- Tests/SimpleInstall/CMakeLists.txt
new revision: 1.100; previous revision: 1.99
/cvsroot/CMake/CMake/Tests/CPackComponents/CMakeLists.txt,v <-- Tests/CPackComponents/CMakeLists.txt
initial revision: 1.1
/cvsroot/CMake/CMake/Tests/CPackComponents/VerifyResult.cmake,v <-- Tests/CPackComponents/VerifyResult.cmake
initial revision: 1.1
/cvsroot/CMake/CMake/Tests/CPackComponents/mylib.cpp,v <-- Tests/CPackComponents/mylib.cpp
initial revision: 1.1
/cvsroot/CMake/CMake/Tests/CPackComponents/mylib.h,v <-- Tests/CPackComponents/mylib.h
initial revision: 1.1
/cvsroot/CMake/CMake/Tests/CPackComponents/mylibapp.cpp,v <-- Tests/CPackComponents/mylibapp.cpp
initial revision: 1.1
(0012361)
David Cole   
2008-06-17 11:42   
Bill, please apply to CMake-2-6 branch after a night on the dashboards...
(0012366)
David Cole   
2008-06-17 12:46   
These changes were also required to appease the continuous dashboards:
/cvsroot/CMake/CMake/Source/CPack/cmCPackGenerator.h,v <-- cmCPackGenerator.h
new revision: 1.4; previous revision: 1.3
/cvsroot/CMake/CMake/Source/CPack/cmCPackGenerator.cxx,v <-- cmCPackGenerator.cxx
new revision: 1.8; previous revision: 1.7
/cvsroot/CMake/CMake/Source/CPack/cmCPackNSISGenerator.cxx,v <-- cmCPackNSISGenerator.cxx
new revision: 1.33; previous revision: 1.32
(0012373)
David Cole   
2008-06-17 14:08   
And one more for HP:

/cvsroot/CMake/CMake/Source/CPack/cmCPackNSISGenerator.cxx,v <-- cmCPackNSISGenerator.cxx
new revision: 1.34; previous revision: 1.33
(0012393)
David Cole   
2008-06-18 07:11   
Another patch from Doug Gregor to address PackageMaker 3.0 issue... (allows the feature to work on Mac OSX 10.5 / Leopard):

/cvsroot/CMake/CMake/Modules/CPack.distribution.dist.in,v <-- Modules/CPack.distribution.dist.in
new revision: 1.2; previous revision: 1.1
/cvsroot/CMake/CMake/Source/CPack/cmCPackPackageMakerGenerator.cxx,v <-- Source/CPack/cmCPackPackageMakerGenerator.cxx
new revision: 1.25; previous revision: 1.24
/cvsroot/CMake/CMake/Source/CPack/cmCPackPackageMakerGenerator.h,v <-- Source/CPack/cmCPackPackageMakerGenerator.h
new revision: 1.14; previous revision: 1.13
(0012398)
David Cole   
2008-06-18 09:30   
This commit should address the "make based builds on Windows" Nightly dashboard test failures from last night...

/cvsroot/CMake/CMake/Tests/CPackComponents/VerifyResult.cmake,v <-- VerifyResult.cmake
new revision: 1.2; previous revision: 1.1
(0012406)
David Cole   
2008-06-18 14:28   
This commit should address the Win64 test failures. (They failed because NSIS is installed and FIND_PROGRAM finds it in the test verification script, but 64-bit CPack was not finding it and therefore not building the installer...)

BUG: Always look for the NSIS reg value in the 32-bit hive even in 64-bit builds of CPack.

/cvsroot/CMake/CMake/Source/CPack/cmCPackNSISGenerator.cxx,v <-- cmCPackNSISGenerator.cxx
new revision: 1.35; previous revision: 1.34
(0012410)
David Cole   
2008-06-18 16:00   
COMP: Eliminate compiler warning on 64-bit build.

/cvsroot/CMake/CMake/Source/CPack/cmCPackGenerator.cxx,v <-- cmCPackGenerator.cxx
new revision: 1.9; previous revision: 1.8
(0012417)
David Cole   
2008-06-19 11:10   
BUG: Avoid running the new CPackComponents test on Windows unless the NSIS installer is available.

/cvsroot/CMake/CMake/Tests/CMakeLists.txt,v <-- CMakeLists.txt
new revision: 1.54; previous revision: 1.53
(0012705)
Douglas Gregor   
2008-07-15 11:28   
This functionality will be available in CMake 2.6.1.