[CMake] CPack DEB Packaging: Automate dependency resolution

Eric Noulard eric.noulard at gmail.com
Sat Nov 1 08:11:57 EDT 2008


2008/11/1 David Graf <david.graf at 28msec.com>:
> Hello
>
> Currently in my project, I provide all dependencies for DEB packaging in
> CPack by setting the variable CPACK_DEBIAN_PACKAGE_DEPENDS. Is there a
> possibility to automate this process (similar to the behavior of the CPack
> RPM packaging mechanism)?

Just to note that _currently_ CPack RPM does NOT handle "automatic"
dependencies.
With a pending feature request one may _MANUALLY_ add dependency:
http://public.kitware.com/Bug/view.php?id=7904

then more dependencies are set-up _AUTOMATICALLY_ by "rpmbuild"
which is the tool called by CPack RPM generator for generating RPM.
I don't even know whether if those dependencies are exhaustive or not...

To be clear, CPack RPM generator does not do _anything_ for
automatic dependencies handling.

> As far as I understood it correctly, such a mechanism must be implemented
> with the Linux tool 'objdump' to get the dependencies of shared libraries. I
> already thought about implementing my own script to get these dependencies
> of my shared libraries automatically. But first, I wanted to make sure that
> I do not reinvent the wheel. Especially because I found the following entry
> in 'CPackDeb.cmake' next to the dependency section:  ' TODO: automate
> 'objdump -p | grep NEEDED'.

I don't really know how if one can expect to find the _PACKAGE_ name
from a "NEEDED" objdump section.

This kind of "automatically" looking for dependencies may
be linked with the "GetPrerequisites" discussion
http://www.cmake.org/pipermail/cmake/2008-October/024883.html

The purpose and action is different but the goal is somehow the same:

1) find "external" shared lib dependency of your targets
2) either include those target in your installer (GetPrerequisite)
    or find the package (DEB or RPM) which may include the required lib/exe
    in order to update the DEPENDS (debian) or Requires (RPM) of the package.

-- 
Erk


More information about the CMake mailing list