>
> 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.


Can this not be done from CMakeLists.txt by setting some additional CPACK_*
variables depending on the build environment?


> 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.
>

Not certain what exactly you're doing here - while creating binary packages
Source directive is not used (CPackRPM is always the build driver so the
build phase of rpm is skipped and instead the CPackRPM prepared/built files
are used directly). Are you trying to produce a binary or a source rpm?

If the answer is binary then you'll have to change your spec file. First
generate a spec file template by setting
CPACK_RPM_GENERATE_USER_BINARY_SPECFILE_TEMPLATE
[1]
<https://cmake.org/cmake/help/v3.6/module/CPackRPM.html#variable:CPACK_RPM_GENERATE_USER_BINARY_SPECFILE_TEMPLATE>
and then change it to suit your needs.

For examples you can look into CPack tests [2]
<https://github.com/Kitware/CMake/tree/master/Tests/RunCMake/CPack/tests>
(CUSTOM_BINARY_SPEC_FILE test is using a custom spec file).

Regards,

Domen

[1]
https://cmake.org/cmake/help/v3.6/module/CPackRPM.html#variable:CPACK_RPM_GENERATE_USER_BINARY_SPECFILE_TEMPLATE
[2] https://github.com/Kitware/CMake/tree/master/Tests/RunCMake/CPack/tests
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake

Reply via email to