[CMake] DEB and RPM Generation?

Eric Noulard eric.noulard at gmail.com
Fri Dec 2 02:47:45 EST 2011


2011/12/2 David Cristian <auledoom at gmail.com>:
> Thanks for your quick response!
>
> I'll have all this things in consideration, specially wrong dependencies and
> libs version.
> I'll plan to test packages on vbox for others distros, my project isn't big
> or complex (just a few dependencies), and I'll guess binary libs
> compatibility isn't and issue between minor versions.

Most of the time cross-packaging (packaging one one distro for
another) works for simple project.
Binary lib-x.y dep is usually ok for 'y' until one distro does x=x+1.

My opinion w.r.t. cross-packaging is that unless you don't want your
user to have the source
it's better to invest time in order to have a fully automatized
package build procedure
than trying to cross-package yourself.
This way your users build their own package on their target system.

> I'm using components and works ok with nsis as single package, but with
> debian merge all components in one package,

This is the default backward compatible behavior.
RPM, DEB and Archive generators (TGZ, ZIP, TBZ2, ...)
are all component-aware but you have to tell them to do component
packaging by setting

CPACK_<GENNAME>_COMPONENT_INSTALL to ON

i..e
set(CPACK_DEB_COMPONENT_INSTALL ON) will tell CPackDEB to generate
several deb packages
depending on the components specification.

Unlike NSIS those generators do generate *several* files/packages so
that you have to tell them
how you want to gather components into package files.

see the description here:
http://www.cmake.org/Wiki/CMake:Component_Install_With_CPack#Controlling_Differents_Ways_of_packaging_components

You can set those CPACK_xxxx specific variables either in your
CMakeLists.txt or in a
CPACK_PROJECT_CONFIG_FILE
see:
http://www.cmake.org/Wiki/CMake:CPackPackageGenerators#Overall_usage_.28common_to_all_generators.29

CPack project config file may be necessary for Archive Generators which share
the CPACK_ARCHIVE_COMPONENT_INSTALL variable.
i.e. setting it to true will make *ALL* Archive generators produce
component packages.

If you want a monolithic for ZIP and component package for TGZ then you have
to set CPACK_ARCHIVE_COMPONENT_INSTALL selectively (depending on the
generator actual name)
in a CPack project config file.

> i read the links you mention about Component Installation,
> the official documentation say CMAKE support
> package per component creation everything excepts DEB,

where did you read that, what do you mean by "official documentation" ?
If this is the Wiki page:
http://www.cmake.org/Wiki/CMake:Component_Install_With_CPack#CPack_Generator_specific_behavior
it is out-dated (for DEB) I'll update it.
> but http://public.kitware.com/Bug/view.php?id=11655 says otherwise,

This one was closed for 2.8.5.

> i have the last version installed.

By last version you mean 2.8.6 ?


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


More information about the CMake mailing list