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
From b0e999c416203068b0d8e0288913d8bbc7faabca Mon Sep 17 00:00:00 2001
From: Markus Rickert <rick...@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

-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers

Reply via email to