In a large C ++ project using CMake, it was decided to use CPack to create TGZ / DEB packages. The project's binary depends on a set of shared libraries: boost, tbb, pq, grpc ... They link dynamically.

Obviously, not all systems that install the DEB package will have the correct versions of SOs.

For a DEB package, you can easily install the necessary dependencies in the type string

libboost-filesystem-dev (>= 1.58), libtbb-dev, libc-ares-dev 

Problem 1

In apt are old versions of libraries. For example, the project uses protobuf 3.3.0, and in apt libprotobuf-dev is the latest 2.6.1. The same with libboost. For example, 1.65.0 is used, and in apt the last is 1.58.0.

What better way to do? Copy precompiled SO to deb package?

Problem 2:

For TGZ assemblies, you cannot specify dependencies explicitly, as for DEB.

What better way to do? Again, copy the precompiled SO to TGZ and configure RPATH for binary? Something like RPATH=../lib .

Potential solutions:

  1. copy precompiled SO inside the packages, install the RPATH binary on the folder with libs.
  2. in the case of DEB, you can make .deb packages for each dependency and add it to your PPA. But then it is not clear what to do with the TGZ.
  3. build everything statically. But this is undesirable, I hope, understandable for what reasons.

In response, I expect to see an explanation of how best to manage such dependencies for TGZ and DEB, and why.

Thank.

    0