CPackDeb: set section control field per component

This commit is contained in:
Markus Rickert 2015-11-08 22:10:12 +01:00 committed by Domen Vrankar
parent f071d8ebd4
commit 47182ab876
1 changed files with 8 additions and 7 deletions

View File

@ -100,6 +100,7 @@
#
#
# .. variable:: CPACK_DEBIAN_PACKAGE_SECTION
# CPACK_DEBIAN_<COMPONENT>_PACKAGE_SECTION
#
# * Mandatory : YES
# * Default : 'devel'
@ -590,18 +591,18 @@ function(cpack_deb_prepare_package_vars)
# You should set: DEBIAN_PACKAGE_DEPENDS
# TODO: automate 'objdump -p | grep NEEDED'
# if per-component dependency, overrides the global CPACK_DEBIAN_PACKAGE_${dependency_type_}
# if per-component variable, overrides the global CPACK_DEBIAN_PACKAGE_${variable_type_}
# automatic dependency discovery will be performed afterwards.
if(CPACK_DEB_PACKAGE_COMPONENT)
foreach(dependency_type_ DEPENDS RECOMMENDS SUGGESTS PREDEPENDS ENHANCES BREAKS CONFLICTS PROVIDES REPLACES SOURCE)
set(_component_var "CPACK_DEBIAN_${_local_component_name}_PACKAGE_${dependency_type_}")
foreach(value_type_ DEPENDS RECOMMENDS SUGGESTS PREDEPENDS ENHANCES BREAKS CONFLICTS PROVIDES REPLACES SOURCE SECTION)
set(_component_var "CPACK_DEBIAN_${_local_component_name}_PACKAGE_${value_type_}")
# if set, overrides the global dependency
# if set, overrides the global variable
if(DEFINED ${_component_var})
set(CPACK_DEBIAN_PACKAGE_${dependency_type_} "${${_component_var}}")
set(CPACK_DEBIAN_PACKAGE_${value_type_} "${${_component_var}}")
if(CPACK_DEBIAN_PACKAGE_DEBUG)
message("CPackDeb Debug: component '${_local_component_name}' ${dependency_type_} "
"dependencies set to '${CPACK_DEBIAN_PACKAGE_${dependency_type_}}'")
message("CPackDeb Debug: component '${_local_component_name}' ${value_type_} "
"value set to '${CPACK_DEBIAN_PACKAGE_${value_type_}}'")
endif()
endif()
endforeach()