When using CMake / CPack to build packages, there are CPACK_DEBIAN_PACKAGE_DEPENDS
and CPACK_RPM_PACKAGE_REQUIRES
to hold a list of packages the resulting .deb / .rpm should depend on.
The distinction is helpful, as package naming shemes differ between distributions. (Example: Distros using .deb
s add the major version of libicu to the package name -- i.e., libicu60
-- whereas distros using .rpm
s don't.)
However, there are differences between .rpm
-distros as well, most notably between SuSE and RedHat. For example, SuSE names Boost packages libboost_system1.56.0
etc., whereas RedHat uses boost-system
.
Is there an ideomatic way to either
- maintain
CPACK_RPM_PACKAGE_REQUIRES
in a distro-agnostic way, or - detect the particular distribution / package naming pattern?
I know ways to figure out the distribution "the hard way" (parsing uname
, checking files in /etc
and so on) and then "hardcode" the individual package names into CPACK_RPM_PACKAGE_REQUIRES
; I was wondering if CMake / CPack offered a more idiomatic way to approach the issue.