[CMake] Support for multiple components in cpack (reloaded)

Eric Noulard eric.noulard at gmail.com
Sat Aug 21 08:21:36 EDT 2010


2010/8/21 Eric Noulard <eric.noulard at gmail.com>:
[...]
> They change the number and the contents of the generated packages:
>    3.a) CPACK_COMPONENTS_ALL_GROUPS_IN_ONE_PACKAGE=1
>          means you want to get a single package whose content
>          is the merge of all components GROUPS
>
>    3.b) CPACK_COMPONENTS_ALL_IN_ONE_PACKAGE=1
>           means you want to get a single package whose content
>           is the merge of all COMPONENTS
>
>     3.c) CPACK_COMPONENTS_IGNORE_GROUPS
>           means you want to get 1 package per COMPONENT
>           (the default is 1 package per GROUP)
>

.... argh push ENTER too fast...

The difference between 3.a) and 3.b) may not be obvious but
one should know that COMPONENT install will install components
which are specified in CPACK_COMPONENTS_ALL
(component which are not specified there won't be installed at all in any case)
BUT some component may NOT BELONG TO ANY GROUP.

In this case 3.b will include the "orphan" component whereas 3.a will NOT.

last but not least there exist a special component "automatically" generated
by CPack the component is named "Unspecified" and contains all
INSTALLed file/targets/... which do not specify COMPONENT.

If "Unspecified" is contained in CPACK_COMPONENTS_ALL then again
3.b will include the "Unspecified" component whereas 3.a will NOT.

3.c should always include ALL COMPONENTS specified in CPACK_COMPONENTS_ALL.

Note that there is existing feature of CPack which would just make
CPack "ignore" the component stuff this is CPACK_MONOLITHIC_INSTALL.
The CPACK_MONOLITHIC_INSTALL has a different objective because:

* CPACK_MONOLITHIC_INSTALL is used AT CMake time
  whereas 3.a, 3.b and 3.c may be used AT CPack time.
  Thus if you use CPACK_MONOLITHIC_INSTALL all the CPack time
  component stuff will be ignored.

* One other difference is the fact that CPack time component control variable
  may let you package only a chosen portion of the INSTALLed things
  CPACK_MONOLITHIC_INSTALL cannot do that.

Any feedback on this stuff is welcomed.

After that I will go on for RPM and DEB component support which will
be similar but may be more difficult because it has to support
inter-component dependencies which is just not handled at all
for Archive Generators.

-- 
Erk
Membre de l'April - « promouvoir et défendre le logiciel libre » -
http://www.april.org


More information about the CMake mailing list