[CMake] More than one package source for a project.

Eric Noulard eric.noulard at gmail.com
Fri Jun 15 03:48:16 EDT 2012


2012/6/15 Doug <douglas.linder at gmail.com>:
> Oddly, I was just doing that last night. Here's an example:
> https://github.com/shadowmint/cmake-multi-install
>
> If you run:
> mkdir build
> cd build
> cmake ..
> cmake -G DEB
>
> It'll build two debian packages.
> If you want RPMs I suspect you'll have to add:
>
>  set(CPACK_RPM_COMPONENT_INSTALL ON)
>
> ...but you get the idea.
> No idea why this isn't in the wiki. It keeps turning up as a question...

It is in the wiki:
http://www.cmake.org/Wiki/CMake:Component_Install_With_CPack#CPack_Generator_specific_behavior

but you are right it keeps popping-up :-]

> Also, it doesn't work on all the pack builders.

This is explained in the Wiki as well, some CPack generator are
component-aware other are not.
If you want to have a look at "COMPONENT" related CPack variable you can try:

cpack --help-variable-list | grep -i COMPONENT

in particular:
$ cpack --help-variable "CPACK_<GENNAME>_COMPONENT_INSTALL"
  CPACK_<GENNAME>_COMPONENT_INSTALL
       Enable/Disable component install for CPack generator <GENNAME>.

         Each CPack Generator (RPM, DEB, ARCHIVE, NSIS, DMG, etc...)
has a legacy
         default behavior. e.g. RPM builds monolithic whereas NSIS
builds component.
         One can change the default behavior by setting this variable
to 0/1 or OFF/ON.

The current documentation does not say which generators supports COMPONENT
install.
The doc may be fixed, as usual patch are welcomed,
and documentation patches may sometimes be more than welcomed.


-- 
Erk
Le gouvernement représentatif n'est pas la démocratie --
http://www.le-message.org


More information about the CMake mailing list