Browse Source

CPackDeb: set package control field per component

Markus Rickert 10 years ago
parent
commit
a45a4b2d86
1 changed files with 7 additions and 5 deletions
  1. 7 5
      Modules/CPackDeb.cmake

+ 7 - 5
Modules/CPackDeb.cmake

@@ -27,6 +27,7 @@
 # However as a handy reminder here comes the list of specific variables:
 #
 # .. variable:: CPACK_DEBIAN_PACKAGE_NAME
+#               CPACK_DEBIAN_<COMPONENT>_PACKAGE_NAME
 #
 #  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_}
   # automatic dependency discovery will be performed afterwards.
   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_}")
 
       # if set, overrides the global variable
@@ -704,10 +705,11 @@ function(cpack_deb_prepare_package_vars)
       endif()
     endforeach()
 
-    set(CPACK_DEB_PACKAGE_COMPONENT_PART_NAME "-${CPACK_DEB_PACKAGE_COMPONENT}")
-    string(TOLOWER "${CPACK_PACKAGE_NAME}${CPACK_DEB_PACKAGE_COMPONENT_PART_NAME}" CPACK_DEBIAN_PACKAGE_NAME)
-  else()
-    set(CPACK_DEB_PACKAGE_COMPONENT_PART_NAME "")
+    if(CPACK_DEBIAN_${_local_component_name}_PACKAGE_NAME)
+      string(TOLOWER "${CPACK_DEBIAN_${_local_component_name}_PACKAGE_NAME}" CPACK_DEBIAN_PACKAGE_NAME)
+    else()
+      string(TOLOWER "${CPACK_DEBIAN_PACKAGE_NAME}-${CPACK_DEB_PACKAGE_COMPONENT}" CPACK_DEBIAN_PACKAGE_NAME)
+    endif()
   endif()
 
   # Print out some debug information if we were asked for that