[cmake-developers] [CPackDeb] Configure Debian package section per component

Markus Rickert rickert at fortiss.org
Sun Nov 8 07:26:33 EST 2015


Hi,

please find attached a patch to configure the section field of Debian 
packages individually for components.

In a project with multiple components, the section for the library 
itself is usually "libs", while the headers use "libdevel" and the 
documentation uses "doc".

While CPACK_DEBIAN_PACKAGE_SECTION can be used to configure the package 
section, there is currently no option to do this for a specific 
component. The attached patch adds a 
CPACK_DEBIAN_PACKAGE_<COMPONENT>_SECTION similar to 
CPACK_DEBIAN_<COMPONENT>_PACKAGE_DEPENDS etc.

Best regards,

Markus Rickert
-------------- next part --------------
From b0e999c416203068b0d8e0288913d8bbc7faabca Mon Sep 17 00:00:00 2001
From: Markus Rickert <rickert at fortiss.org>
Date: Sat, 7 Nov 2015 18:44:02 +0100
Subject: [PATCH] Configure Debian package section per component

---
 Modules/CPackDeb.cmake | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/Modules/CPackDeb.cmake b/Modules/CPackDeb.cmake
index 875a534..ef39a87 100644
--- a/Modules/CPackDeb.cmake
+++ b/Modules/CPackDeb.cmake
@@ -100,6 +100,7 @@
 #
 #
 # .. variable:: CPACK_DEBIAN_PACKAGE_SECTION
+# .. variable:: CPACK_DEBIAN_PACKAGE_<COMPONENT>_SECTION
 #
 #  * Mandatory : YES
 #  * Default   : 'devel'
@@ -593,7 +594,7 @@ function(cpack_deb_prepare_package_vars)
   # if per-component dependency, overrides the global CPACK_DEBIAN_PACKAGE_${dependency_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)
+    foreach(dependency_type_ DEPENDS RECOMMENDS SUGGESTS PREDEPENDS ENHANCES BREAKS CONFLICTS PROVIDES REPLACES SOURCE SECTION)
       set(_component_var "CPACK_DEBIAN_${_local_component_name}_PACKAGE_${dependency_type_}")
 
       # if set, overrides the global dependency
-- 
1.9.1



More information about the cmake-developers mailing list