CPack support for per-component summary
I'm missing a common per-component package summary.
The similar variable for description already exists: CPACK_COMPONENT_<COMP>_DESCRIPTION
To support both RPM and DEB generators, I have to do this today:
cmake_minimum_required(VERSION 3.14)
project(test LANGUAGES NONE)
set(CPACK_COMPONENTS_ALL foo bar)
set(CPACK_PACKAGE_CONTACT foo@bar)
set(CPACK_DEB_COMPONENT_INSTALL ON)
set(CPACK_RPM_COMPONENT_INSTALL ON)
# workaround for older versions of CMake, not needed for CMake 3.22 but doesn't hurt
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY IGNORE)
set(FOO_SUMMARY "The foo summary")
set(CPACK_COMPONENT_FOO_DESCRIPTION "The detailed description of foo...")
set(CPACK_DEBIAN_FOO_DESCRIPTION "${FOO_SUMMARY}\n${CPACK_COMPONENT_FOO_DESCRIPTION}")
set(CPACK_RPM_FOO_PACKAGE_SUMMARY "${FOO_SUMMARY}")
set(BAR_SUMMARY "The bar summary")
set(CPACK_COMPONENT_BAR_DESCRIPTION "The detailed description of bar...")
set(CPACK_DEBIAN_BAR_DESCRIPTION "${BAR_SUMMARY}\n${CPACK_COMPONENT_BAR_DESCRIPTION}")
set(CPACK_RPM_BAR_PACKAGE_SUMMARY "${BAR_SUMMARY}")
include(CPack)
The above code could become more concise and easier to discover. Finding out how to set CPACK_DEBIAN_FOO_DESCRIPTION to achieve the expected result (summary on the first line of DEB description) wasn't at all clear or intuitive.
For example, this could do the job if CPACK_COMPONENT_<COMP>_SUMMARY
was supported:
cmake_minimum_required(VERSION 3.22)
project(test LANGUAGES NONE)
set(CPACK_COMPONENTS_ALL foo bar)
set(CPACK_PACKAGE_CONTACT foo@bar)
set(CPACK_DEB_COMPONENT_INSTALL ON)
set(CPACK_RPM_COMPONENT_INSTALL ON)
set(CPACK_COMPONENT_FOO_SUMMARY "The foo summary")
set(CPACK_COMPONENT_FOO_DESCRIPTION "The detailed description of foo...")
set(CPACK_COMPONENT_BAR_SUMMARY "The bar summary")
set(CPACK_COMPONENT_BAR_DESCRIPTION "The detailed description of bar...")
include(CPack)