[CMake] CPack and user .spec file

Piotr Sipika piotr.sipika at gmail.com
Tue Jun 20 07:44:02 EDT 2017


Hello all,

I'm fairly new to CPack and, while I was able to successfully package
(RPM) standalone applications that use CMake, I'm having difficulties
with packaging an application using a custom .spec file.

I have an application repository that is built with CMake, but
requires additional/custom handling when packaging -- hence the need
for a custom .spec file. After running CMake and make to generate the
artifacts, 'make package' (CPack) tells me that the source tar.gz
isn't found. The  'Source' directive inside my .spec file contains a
name that is different from the name of the repository or the
application.

Can someone point me to best practices in this case?

Should I have a custom_command or custom_target defined inside my
CMakeLists.txt file which generates the source .tar.gz, or am I
missing a CPack configuration variable which correctly tells CPack to
tar-up the source directory.

Any/all help will be much appreciated.

Best,
Piotr


More information about the CMake mailing list