[CMake] Using CPack to include shared libraries in rpms

Eric Noulard eric.noulard at gmail.com
Sat Feb 20 10:15:07 EST 2010


2010/2/20 Hendrik Sattler <post at hendrik-sattler.de>:
> Am Samstag 20 Februar 2010 01:27:20 schrieb Robert Knapke:
>> My CMake project links a boost python shared library when builiding the
>> libraries and executables.  I am using CPack to make an rpm of my project,
>> but the boost python shared library is not included in the rpm.  So when
>>  the user tries to install the rpm, it asks for this boost python shared
>>  library.  However, I do not want to make the user download and compile
>>  boost.  Is there a way to include this library in the rpm using CPack?

You may find documentation about CPackRPM
on the Wiki:
http://www.cmake.org/Wiki/CMake:CPackPackageGenerators#RPM_.28Unix_Only.29

and from the command line (since CMake 2.8.0):

cmake --help-module CPackRPM

> At least for RPM and DEB, you do _not_ include foreign libraries in a package!
> Boost should be available pre-compiled as RPM. If not, ship it as additional
> RPM package.

Hendrik is right it is not a good idea to embed third party shared
libraries in your RPM/DEB.
DEB and RPM are meant to handle dependencies between appropriate
version of RPMs.

Try to run the following command:

rpm -qp --requires <your_CPack_generated.rpm>

and you'll find the requirements for the generated RPMs.

Most of the time RPM installing tools (yum, urpmi, zypper etc...)
[the same is true for apt-xxx/aptitude/synaptic etc...]
may find the missing RPMs in standard "repositories".

If they don't try to find for yourself with appropriate RPM search engines:
http://rpm.pbone.net/
http://www.rpmfind.net/
...


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


More information about the CMake mailing list