CMake: Determine version for CPack during generation time
This allows for easier usage of CPack to generate local packages with proper version rather than the default dummy version 0.1.1, which could cause conflics with for example the distro-provided package which is probably at a higher version and thus wants to overwrite the cpack-generated one.
I'm not familiar with CPack, how exactly would I use/test this?
Me neither. After building (cmake --build . , manually make, ...), I run cpack -G DEB -D CPACK_PACKAGE_CONTACT="local <[email protected]>" in the build directory to generate a .deb package to install. I add CPACK_PACKAGE_CONTACT because otherwise it fails when building the deb . It takes quite a long time and creates a dolphin-emu-5.0.21666-Linux.deb file that I can then install with sudo apt install ./dolphin-emu-5.0.21666-Linux.deb.
I have updated this to move the version generation to a new CMake file. With the new version scheme, it generates a file like dolphin-emu-2409.0.46-Linux.deb which seems correct.