Creating multiple monolithic packages (deb)

Hi all,
I need to create multiple standalone (self-contained, monolithic) debian packages, by “monolithic” I mean that the package contains everything it needs for the binaries to run.
The premise of cmake/cpack is that one file gets packaged into at most one component, which means I cannot use components for this.

  • binary1 (depends on
  • binary2 (depends on
    I would like binary1 in package1.deb and binary2 in package2.deb but I would like in both packages to that the debians can be installed and run by themselves.

I realize this can be solved to some extent with package dependencies (package in a separate package), but my real-world situation is more complicated and the common “core” cannot be cut as cleanly.

Right now I am doing multiple cmake/cpack iterations in the same directory to achieve this:

  • configure and build binary1
  • create package1 (no components)
  • configure and build binary2
  • create package2 (no components)
    but it seems clumsy.

Is there a better way to accomplish this?
Any suggestions/comments/advice greatly appreciated.

The ParaView superbuild has a project per package that does its own CPack thing and is more-or-less just a series of install() commands to pull from the unified install tree all of the ExternalProject calls install to. You can do the same thing from the build tree (though you miss things like target knowledge as the package projects are just working with files).