Some CMake modernizations
For now just 2 things primarily aimed for downstream distributions
- Add support for CMake 4.0 (and later, at least 3 years support)
- Use
GNUInstallDirsmore
A few other things I would recommend
- Add a CMake workflow testing 3 versions of CMake (lowest policy, highest policy, and latest/latest-rc). jwlawson/actions-setup-cmake could be used, but there are various other options (I have a strong suspicion that CMake 2.6 is not actually buildable in fact)
- Moving away from
find_libraryand other such constructs - Phasing out
cpack. All distros use direct CMake build without cpack commands
Hi @LecrisUT . Could you please fix the issue with building in Alpine container. It works without your changes: https://github.com/accel-ppp/accel-ppp/actions/runs/14639922657/job/41079694185 , but fails with your changes: https://github.com/accel-ppp/accel-ppp/actions/runs/14639808282/job/41079428962?pr=237
The same issue with gentoo container: your PR fails on gentoo container build: https://github.com/accel-ppp/accel-ppp/actions/runs/14639808282/job/41079430298?pr=237
Hi @LecrisUT . Could you please fix the issue with building in Alpine container. It works without your changes: https://github.com/accel-ppp/accel-ppp/actions/runs/14639922657/job/41079694185 , but fails with your changes: https://github.com/accel-ppp/accel-ppp/actions/runs/14639808282/job/41079428962?pr=237
Ah, yes, I know this issue, and it is only fixed recently in CMake 4.1. Basically CMAKE_INSTALL_SYSCONFDIR does not expand to an absolute path, even though it is supposed to when a special CMAKE_INSTALL_PREFIX is passed. This is generally something that downstream packagers should address. If you can contact the downstream packagers about this in advance it would be great. I am already handling this on Fedora/RHEL side.
Ah, yes, I know this issue, and it is only fixed recently in CMake 4.1. Basically
CMAKE_INSTALL_SYSCONFDIRdoes not expand to an absolute path, even though it is supposed to when a specialCMAKE_INSTALL_PREFIXis passed. This is generally something that downstream packagers should address. If you can contact the downstream packagers about this in advance it would be great. I am already handling this on Fedora/RHEL side.
Do you know any workaround to fix it on alpine and gentoo? we can't accept your changes if it breaks CI on alpine. BTW, it works fine on Alpine VM (https://github.com/accel-ppp/accel-ppp/actions/runs/14639808267/job/41079909787 ) so looks like it's possible to fix the build in container
Do you know any workaround to fix it on alpine and gentoo?
Yes, the fix is straightforward, just specify those paths manually until CMake4.1 is the minimum supported. It should be working right now.