0

A debian package is built using CMake/CPack (CPACK_GENERATOR = "DEB")

The built package contains an executable and some shared objects.

One of the shared objects has a dependency on libjpeg.so.62, which should be installed in the system. Is it possible to configure CMake to install libjepeg automatically via apt, when my product is installed by running sudo apt install ./my.deb?

wrf
  • 56
  • 4
  • 3
    Use [`CPACK_DEBIAN_PACKAGE_DEPENDS`](https://cmake.org/cmake/help/latest/cpack_gen/deb.html#variable:CPACK_DEBIAN_PACKAGE_DEPENDS) or the appropriate component based version. – fabian May 02 '22 at 16:32
  • CPACK_DEBIAN_PACKAGE_DEPENDS was the solution. Thanks a lot! – wrf May 03 '22 at 09:06
  • And JFYI... CMake (or CPack to be precise) knows nothing about `apt` ;-) (or any other way a user might try to install a built package ;-) -- resolving dependencies is a task for the package manager. Specifying dependencies is a task for a package author/developer ;-) so CPack can produce one which going to depend on another... – zaufi Jun 22 '22 at 22:50

0 Answers0