CPackDeb: set package control field per component

This commit is contained in:
Markus Rickert 2015-11-08 23:44:00 +01:00 committed by Brad King
parent a60574f1bf
commit a45a4b2d86
1 changed files with 7 additions and 5 deletions

View File

@ -27,6 +27,7 @@
# However as a handy reminder here comes the list of specific variables: # However as a handy reminder here comes the list of specific variables:
# #
# .. variable:: CPACK_DEBIAN_PACKAGE_NAME # .. variable:: CPACK_DEBIAN_PACKAGE_NAME
# CPACK_DEBIAN_<COMPONENT>_PACKAGE_NAME
# #
# The Debian package summary # The Debian package summary
# #
@ -603,7 +604,7 @@ function(cpack_deb_prepare_package_vars)
# if per-component variable, overrides the global CPACK_DEBIAN_PACKAGE_${variable_type_} # if per-component variable, overrides the global CPACK_DEBIAN_PACKAGE_${variable_type_}
# automatic dependency discovery will be performed afterwards. # automatic dependency discovery will be performed afterwards.
if(CPACK_DEB_PACKAGE_COMPONENT) if(CPACK_DEB_PACKAGE_COMPONENT)
foreach(value_type_ DEPENDS RECOMMENDS SUGGESTS PREDEPENDS ENHANCES BREAKS CONFLICTS PROVIDES REPLACES SOURCE SECTION PRIORITY) foreach(value_type_ DEPENDS RECOMMENDS SUGGESTS PREDEPENDS ENHANCES BREAKS CONFLICTS PROVIDES REPLACES SOURCE SECTION PRIORITY NAME)
set(_component_var "CPACK_DEBIAN_${_local_component_name}_PACKAGE_${value_type_}") set(_component_var "CPACK_DEBIAN_${_local_component_name}_PACKAGE_${value_type_}")
# if set, overrides the global variable # if set, overrides the global variable
@ -704,10 +705,11 @@ function(cpack_deb_prepare_package_vars)
endif() endif()
endforeach() endforeach()
set(CPACK_DEB_PACKAGE_COMPONENT_PART_NAME "-${CPACK_DEB_PACKAGE_COMPONENT}") if(CPACK_DEBIAN_${_local_component_name}_PACKAGE_NAME)
string(TOLOWER "${CPACK_PACKAGE_NAME}${CPACK_DEB_PACKAGE_COMPONENT_PART_NAME}" CPACK_DEBIAN_PACKAGE_NAME) string(TOLOWER "${CPACK_DEBIAN_${_local_component_name}_PACKAGE_NAME}" CPACK_DEBIAN_PACKAGE_NAME)
else() else()
set(CPACK_DEB_PACKAGE_COMPONENT_PART_NAME "") string(TOLOWER "${CPACK_DEBIAN_PACKAGE_NAME}-${CPACK_DEB_PACKAGE_COMPONENT}" CPACK_DEBIAN_PACKAGE_NAME)
endif()
endif() endif()
# Print out some debug information if we were asked for that # Print out some debug information if we were asked for that