cpack restrict OS version package can be installed on
问题 I create packages for several OS versions including RHEL7 & RHEL8 (or mostly equally CentOS7 & 8). It is possible to install a package built for .el7. on .el8. but it will typically not work (for example due to undefined symbols etc). Ideally I would like to make the installation fail with an error message like "this package is only intend for RHEL7/CentOS7". How can I do this? More specifically how can I do this with CPack/CMake? Bonus points if you can also given an explanation suitable for