CPack Debian: Package has no dependencies


I want to generate a .deb package and have dpkg installed (on my arch linux system). My code looks something like that:



I don’t understand two things here (which might be the cause of my problem):

  1. Do I need the COMPONENT variables like CPACK_DEBIAN_<COMP>_PACKAGE_SHLIBDEPS? I do use components, but don’t generate different packages.

  2. What is the difference between CPACK_DEBIAN_PACKAGE_SHLIBDEPS and CPACK_DEBIAN_PACKAGE_GENERATE_SHLIBS. I’ve read the documentation, but I don’t really understand the difference

My actual problem though is that with the current configuration no dependencies are generated. Cmake tells me CPACK_DEBIAN_PACKAGE_DEPENDS not set, the package will have no dependencies.. But shouldn’t dependencies are determined automatically by using dpkg-shlibdeps.

There is also no dependency line in Deb/Controll. But at least something like libstdc should always be found I assumed?

What did I do wrong?

Found out that I can run with debug output:

CPack: Create package using DEB
CPack: Install projects
CPack: - Install project: BeansServer []
CPack: -   Install component: Beans
CPack: Create package
CPackDeb Debug: dpkg-shlibdeps --version output is 'Debian dpkg-shlibdeps version 1.20.9.

This is free software; see the GNU General Public License version 2 or
later for copying conditions. There is NO warranty.'
CPackDeb Debug: dpkg-shlibdeps version is <1.20.9>
CPackDeb: - Generating dependency list
CPackDeb Debug: dpkg-shlibdeps warnings 
dpkg-shlibdeps: warning: package could avoid a useless dependency if ./opt/BeansServer/bin/BeansServer was not linked against (it uses none of the library's symbols)
dpkg-shlibdeps: warning: package could avoid a useless dependency if ./opt/BeansServer/bin/BeansServer was not linked against (it uses none of the library's symbols)

CPackDeb Debug: Found dependency:  from output 
-- CPACK_DEBIAN_PACKAGE_DEPENDS not set, the package will have no dependencies

Also there is a shlibs file now. But there is still no depends line in the control file. And I think there should be one, right?

1 Like

Okay it seems it just doesn’t work very well on arch, but only on debian based distro.

There is one problem left though. I want to ship Qt6 as part of the package as the library isn’t available in the package manager. On my Debian I therefore have installed Qt6 somewhere in my home directory and included it with CMAKE_PREFIX_PATH. Apart from libraries it contains also all dependencies in the same directory.

To copy the dependencies I do the following with the hint to the Qt6 library

install(TARGETS BeansServer COMPONENT Beans

This will install everything properly. It issues a warning though, but as Qt6 is in a local directory, this seems to be right?
I also set the RPATH accordingly so all dependencies are found.

But when generating the deb I get errors like these:

CPackDeb: dpkg-shlibdeps: 'dpkg-shlibdeps: error: cannot find library needed by
  (ELF format: 'elf64-x86-64' abi: '0201003e00000000'; RPATH:

So first of all all the libraries:,, are from QT and are installed probably through the command above.
But it seems when analyzing it searches in the RPATH of this library. The RPATH is wrong though, the above directory /home/qt/icu_install/lib doesn’t even exist.
Instead it should search in my defined RPATH (for BeansServer), where it would find the library.

What can I do about it?