[CMake] CPack RPM generator not using CPACK_RPM_<component>_XXX variables

Andrew Helten ahelten at tenable.com
Tue Feb 2 12:53:47 EST 2016


I have the CPack RPM component packager partly working in that it creates
separate RPMs for my two components (soon to be more, but two for now).
However, the RPMs are not quite right because the packager completely
ignores all of my CPACK_RPM_<component>_XXX variables, such
as, CPACK_RPM_<component>_PACKAGE_PREFIX. The debug output from CPack
doesn't provide an answer. Here is a small example snippet of my
CMakeLists.txt for component "blah1" and "blah2":


set(CPACK_GENERATOR "RPM")
set(CPACK_RPM_BLAH1_USER_BINARY_SPECFILE
"${CMAKE_CURRENT_SOURCE_DIR}/install/SPECS/blah1.spec.in")
set(CPACK_RPM_BLAH1_PACKAGE_PREFIX "${CMAKE_INSTALL_PREFIX}/blah1")
set(CPACK_RPM_BLAH2_PACKAGE_PREFIX "${CMAKE_INSTALL_PREFIX}/blah2")
set(CPACK_RPM_COMPONENT_INSTALL ON)
set(CPACK_COMPONENTS_ALL blah1 blah2)
include(CPack)

What I want this to do is install blah1 in something like /opt/blah1 and
install blah2 in /opt/blah2 and use a custom binary spec for component
blah1. It does none of these things and instead puts both blah1 and blah2
in CPACK_PACKAGING_INSTALL_PREFIX and uses a GENERATED binary spec file for
both blah1 and blah2.

Thanks for any help,
Andy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20160202/04eb20e2/attachment.html>


More information about the CMake mailing list