cpack: how to generate a deb package with dependencies ?

Hi,

when generating a rpm file using cpack, the rpm tools automatically scan the files which go into the rpm and generate the dependency info from that.
Now I tried the same with deb, it tells me that CPACK_DEBIAN_PACKAGE_DEPENDS is empty, so the resulting package will have no dependencies.
So, do I have to collect the package names manually ? Or is there some way to enable automatic dependencies for deb files ?

Thanks
Alex

Not sure but I think this was not the historical behavior for CPack Deb because the generator was not relying on debian packaging tools.

Could you try to set CPACK_DEBIAN_PACKAGE_SHLIBDEPS to ON.
see:
https://cmake.org/cmake/help/latest/cpack_gen/deb.html#variable:CPACK_DEBIAN_PACKAGE_SHLIBDEPS

You have CPACK_DEBIAN_PACKAGE_DEPENDS too but this one is for “manual deps specs”.

This will only work if dpkg-shlibdeps command is available.
i.e. if you are building on debian based distro.