Component-install: how to create the default package file without component name ?


I have a project, where headers etc. are installed into the “devel” component, and everything else in the default install component.
The name of the default component is “Unspecified”, so the package files get the name foo-1.0.0-x86_64-Unspecified.tar.gz and foo-1.0.0-x86_64-devel.tar.gz.
For the devel-package that is Ok, but for the main package I’d prefer to have no component name appear in the package file, i.e. foo-1.0.0-x86_64.tar.gz.
If I set CMAKE_INSTALL_DEFAULT_COMPONENT_NAME to “”, the package filename still contains “Unspecified”.

For rpm I can set CPACK_RPM_MAIN_COMPONENT to be the same as ${CMAKE_INSTALL_DEFAULT_COMPONENT_NAME}, and then the rpm package for the default component is simply named foo-1.0.0-x86_64.rpm.

Is there a way to achieve the same for the ARCHIVE generators ?
If not, would introducing a new variable CPACK_MAIN_COMPONENT which would have to be used by all generators, and which would be used to initialize CPACK_RPM_MAIN_COMPONENT) be a good idea ?


I think this sounds like a good feature request. CPack has grown quite organically over the years, so some things might not be as uniform as they should be.