# Creating multiple monolithic packages (deb)

**URL:** https://discourse.cmake.org/t/creating-multiple-monolithic-packages-deb/9457
**Category:** Usage
**Tags:** cpack:deb
**Created:** [November 17, 2023, 9:51pm UTC](https://discourse.cmake.org/t/creating-multiple-monolithic-packages-deb/9457 "2023-11-17T21:51:48Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![mirni](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/m/cdc98d/32.png) [@mirni](https://discourse.cmake.org/u/mirni)
#### Post date: [November 17, 2023, 9:51pm UTC](https://discourse.cmake.org/t/creating-multiple-monolithic-packages-deb/9457/1 "2023-11-17T21:51:48Z")

</div>

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.  
Example:

- libCore.so
- binary1 (depends on libCore.so)
- binary2 (depends on libCore.so)  
I would like binary1 in package1.deb and binary2 in package2.deb but I would like libCore.so 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 libCore.so 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.  
Miro

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.cmake.org/u/ben.boeckel)
#### Post date: [November 19, 2023, 2:46am UTC](https://discourse.cmake.org/t/creating-multiple-monolithic-packages-deb/9457/2 "2023-11-19T02:46:58Z")

</div>

The [ParaView superbuild](https://gitlab.kitware.com/paraview/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).
