[CMake] CPack: Detecting if to build DEB/RPM packages
freddie at witherden.org
Thu Jul 22 10:08:17 EDT 2010
On 22 Jul 2010, at 07:02, Rolf Eike Beer wrote:
> Am Thursday 22 July 2010 schrieb Freddie Witherden:
>> I wish to know how I can have CMake/CPack determine if it is possible to
>> build an RPM or DEB package on the system (so if all the required
>> utilities are installed) and if so to go ahead and package them.
> FIND_PROGRAM(rpmbuild) or things like that?
I'll try adding a check for `rpmbuild` to my CMakeLists before enabling RPM packages. This seems quite a nice solution as users should always get TGZ and DEB and RPM if possible. From what I gather producing DEBs has no associated dependencies.
This way they can choose which one they want to use and distribute others if they want.
Doing the checks in my CMakeLists file should also reduce the chance of a package failing to build when the user runs `make package`.
More information about the CMake