[CMake] DEB and RPM Generation?

David Cristian auledoom at gmail.com
Thu Dec 1 19:31:26 EST 2011


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.

I'm using components and works ok with nsis as single package, but with
debian merge all components in one package, i read the links you mention
about Component Installation, the official documentation say CMAKE support
package per component creation everything excepts DEB, but
http://public.kitware.com/Bug/view.php?id=11655 says otherwise, i have the
last version installed.

But again thanks a lot. If isn't ready ill just have to wait, no problem.

2011/12/1 Eric Noulard <eric.noulard at gmail.com>

> 2011/12/1 David Cristian <auledoom at gmail.com>:
> > Hello devs!
> >
> > I've searh the net with no result, i have a project builds various apps
> and
> > libs, i managed to use cmake/cpack to build and create packages for win32
> > and debian and i have two questions.
> >
> > 1 First, it's posibible to build a deb package and rpm simultaneusly
> from a
> > CMAKELists.txt? Can I set more than one generator ?
>
> Yes it is, just set CPACK_GENERATOR
> with the list of generator you want:
>
> SET(CPACK_GENERATOR "TGZ;RPM;DEB")
>
> would create TGZ, RPM and DEB.
> Note however that:
>  - some generator suppose you have some tools installed
>    which not be available on the host platform.
>    e.g. CPackRPM requires "rpmbuild" command
>    which may not be installed on a debian-based distro.
>
>  - building an RPM on debian and installing it on
>    Fedora may not work (wrong dependencies or library version etc...).
>    It's usually safe to build the package
>    on the same kind of host you will be installing it.
>
>  - you may have to set the list of Generator depending
>    on the Platform (i.e. RPM Generator is not available on Windows)
>    something like:
>    if(WIN32)
>        set(CPACK_GENERATOR "NSIS;ZIP")
>    else()
>        set(CPACK_GENERATOR "TGZ;RPM;DEB")
>    endif()
>
> > 2. Can I include CPACK multiple times to generate various set of packages
> > (myproject.deb, myproject-data.deb, myprojectlibs.deb?
>
> Nope you can't currently do that:
> http://public.kitware.com/Bug/view.php?id=10751
>
> Currently you may build several package in the same build if you
> use COMPONENT installation:
>
> http://www.cmake.org/Wiki/CMake:Component_Install_With_CPack#Principles_of_CPack_Component_Packaging
>
>
> --
> Erk
> Membre de l'April - « promouvoir et défendre le logiciel libre » -
> http://www.april.org
>



-- 
"Seamos Realistas y Hagamos lo Imposible"
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20111201/3c5ca28e/attachment.htm>


More information about the CMake mailing list