summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEdoardo Bortolozzo <edoardo.bortolozzo@thinkquantum.com>2024-10-03 08:35:37 (GMT)
committerBrad King <brad.king@kitware.com>2024-10-03 12:52:14 (GMT)
commit443a06807c2c49d6a4bd7e2f4bbd7f77791c41a4 (patch)
treee39e9e02a094a30fb3d1424ee51a38a780cf8507
parent823e0a3a6187f02c06b86c32d6966eff25b9abc8 (diff)
downloadCMake-443a06807c2c49d6a4bd7e2f4bbd7f77791c41a4.zip
CMake-443a06807c2c49d6a4bd7e2f4bbd7f77791c41a4.tar.gz
CMake-443a06807c2c49d6a4bd7e2f4bbd7f77791c41a4.tar.bz2
CPackDeb: always treat PACKAGE_DEPENDS as a list
Remove some edge cases where if CPACK_DEBIAN_PACKAGE_DEPENDS is a list it would not be expanded on all components leaving some with ';'(s) in the Depends field of the control file. Same goes for using CPACK_DEBIAN_PACKAGE_SHLIBDEPS.
-rw-r--r--Help/cpack_gen/deb.rst11
-rw-r--r--Modules/Internal/CPack/CPackDeb.cmake3
2 files changed, 12 insertions, 2 deletions
diff --git a/Help/cpack_gen/deb.rst b/Help/cpack_gen/deb.rst
index a4063d9..15f94dc 100644
--- a/Help/cpack_gen/deb.rst
+++ b/Help/cpack_gen/deb.rst
@@ -182,11 +182,22 @@ List of CPack DEB generator specific variables:
only the automatically discovered dependencies will be set for this
component.
+ .. versionchanged:: 3.31
+
+ The variable is always expanded as a list. Before it was expanded only
+ if used in cooperation with :variable:`CPACK_DEB_COMPONENT_INSTALL`,
+ :variable:`CPACK_DEBIAN_PACKAGE_SHLIBDEPS` or
+ :variable:`CPACK_DEBIAN_<COMPONENT>_PACKAGE_SHLIBDEPS`.
+ This meant that if a component had no shared libraries discovered
+ (e.g. a package composed only of scripts) you had to join the list
+ by yourself to obtain a valid Depends field.
+
Example:
.. code-block:: cmake
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libc6 (>= 2.3.1-6), libc6 (< 2.4)")
+ list(APPEND CPACK_DEBIAN_PACKAGE_DEPENDS cmake)
.. variable:: CPACK_DEBIAN_ENABLE_COMPONENT_DEPENDS
diff --git a/Modules/Internal/CPack/CPackDeb.cmake b/Modules/Internal/CPack/CPackDeb.cmake
index 2b58ab1..98e6d18 100644
--- a/Modules/Internal/CPack/CPackDeb.cmake
+++ b/Modules/Internal/CPack/CPackDeb.cmake
@@ -589,7 +589,6 @@ function(cpack_deb_prepare_package_vars)
list(JOIN COMPONENT_DEPENDS ", " COMPONENT_DEPENDS)
if(COMPONENT_DEPENDS)
list(PREPEND CPACK_DEBIAN_PACKAGE_DEPENDS ${COMPONENT_DEPENDS})
- list(JOIN CPACK_DEBIAN_PACKAGE_DEPENDS ", " CPACK_DEBIAN_PACKAGE_DEPENDS)
endif()
endif()
endif()
@@ -599,9 +598,9 @@ function(cpack_deb_prepare_package_vars)
# Append automatically discovered dependencies .
if(CPACK_DEBIAN_PACKAGE_AUTO_DEPENDS)
list(APPEND CPACK_DEBIAN_PACKAGE_DEPENDS ${CPACK_DEBIAN_PACKAGE_AUTO_DEPENDS})
- list(JOIN CPACK_DEBIAN_PACKAGE_DEPENDS ", " CPACK_DEBIAN_PACKAGE_DEPENDS)
endif()
+ list(JOIN CPACK_DEBIAN_PACKAGE_DEPENDS ", " CPACK_DEBIAN_PACKAGE_DEPENDS)
if(NOT CPACK_DEBIAN_PACKAGE_DEPENDS)
message(STATUS "CPACK_DEBIAN_PACKAGE_DEPENDS not set, the package will have no dependencies.")
endif()