summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2016-09-26 13:06:39 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2016-09-26 13:06:39 (GMT)
commit4d6f0a55731e462a53feb0956484c104ab8c1018 (patch)
treec37b8f2a179ebe2c5228ab703b982401baaf2e04 /Modules
parent806017cab8c0dececc2bf61a4bf54c8cb031c8b6 (diff)
parent1ef45a30aae240a89893e86e2509d5400da9753f (diff)
downloadCMake-4d6f0a55731e462a53feb0956484c104ab8c1018.zip
CMake-4d6f0a55731e462a53feb0956484c104ab8c1018.tar.gz
CMake-4d6f0a55731e462a53feb0956484c104ab8c1018.tar.bz2
Merge topic 'revert-cpack-deb-package-description-fallback'
1ef45a30 Revert "CPack/DEB: Make package description variable precedence match RPM"
Diffstat (limited to 'Modules')
-rw-r--r--Modules/CPackDeb.cmake43
1 files changed, 21 insertions, 22 deletions
diff --git a/Modules/CPackDeb.cmake b/Modules/CPackDeb.cmake
index 423bb00..1a7b923 100644
--- a/Modules/CPackDeb.cmake
+++ b/Modules/CPackDeb.cmake
@@ -156,18 +156,16 @@
# * Default : :code:`CPACK_PACKAGE_CONTACT`
#
# .. variable:: CPACK_DEBIAN_PACKAGE_DESCRIPTION
-# CPACK_DEBIAN_<COMPONENT>_PACKAGE_DESCRIPTION
+# CPACK_COMPONENT_<COMPONENT>_DESCRIPTION
#
# The Debian package description
#
# * Mandatory : YES
# * Default :
#
-# - :variable:`CPACK_COMPONENT_<compName>_DESCRIPTION` (component based installers only) if set,
-# - :variable:`CPACK_PACKAGE_DESCRIPTION_FILE` if set to non default location,
-# - :variable:`CPACK_PACKAGE_DESCRIPTION_SUMMARY` if set,
-# - :variable:`CPACK_PACKAGE_DESCRIPTION_FILE` default value if set,
-# - or "no package description available"
+# - :variable:`CPACK_DEBIAN_PACKAGE_DESCRIPTION` if set or
+# - :variable:`CPACK_PACKAGE_DESCRIPTION_SUMMARY`
+#
#
# .. variable:: CPACK_DEBIAN_PACKAGE_SECTION
# CPACK_DEBIAN_<COMPONENT>_PACKAGE_SECTION
@@ -831,23 +829,24 @@ function(cpack_deb_prepare_package_vars)
endif()
# Description: (mandatory)
- if(CPACK_DEB_PACKAGE_COMPONENT)
- if(CPACK_DEBIAN_${_local_component_name}_PACKAGE_DESCRIPTION)
- set(CPACK_DEBIAN_PACKAGE_DESCRIPTION "${CPACK_DEBIAN_${_local_component_name}_PACKAGE_DESCRIPTION}")
- elseif(CPACK_COMPONENT_${_local_component_name}_DESCRIPTION)
- set(CPACK_DEBIAN_PACKAGE_DESCRIPTION "${CPACK_COMPONENT_${_local_component_name}_DESCRIPTION}")
+ if(NOT CPACK_DEB_PACKAGE_COMPONENT)
+ if(NOT CPACK_DEBIAN_PACKAGE_DESCRIPTION)
+ if(NOT CPACK_PACKAGE_DESCRIPTION_SUMMARY)
+ message(FATAL_ERROR "CPackDeb: Debian package requires a summary for a package, set CPACK_PACKAGE_DESCRIPTION_SUMMARY or CPACK_DEBIAN_PACKAGE_DESCRIPTION")
+ endif()
+ set(CPACK_DEBIAN_PACKAGE_DESCRIPTION ${CPACK_PACKAGE_DESCRIPTION_SUMMARY})
endif()
- endif()
-
- if(NOT CPACK_DEBIAN_PACKAGE_DESCRIPTION)
- if(CPACK_PACKAGE_DESCRIPTION_FILE AND NOT "${CPACK_PACKAGE_DESCRIPTION_FILE}" STREQUAL "${CMAKE_ROOT}/Templates/CPack.GenericDescription.txt")
- file(READ "${CPACK_PACKAGE_DESCRIPTION_FILE}" CPACK_DEBIAN_PACKAGE_DESCRIPTION)
- elseif(CPACK_PACKAGE_DESCRIPTION_SUMMARY)
- set(CPACK_DEBIAN_PACKAGE_DESCRIPTION "${CPACK_PACKAGE_DESCRIPTION_SUMMARY}")
- elseif(CPACK_PACKAGE_DESCRIPTION_FILE) # use default package description file content
- file(READ "${CPACK_PACKAGE_DESCRIPTION_FILE}" CPACK_DEBIAN_PACKAGE_DESCRIPTION)
- else()
- set(CPACK_DEBIAN_PACKAGE_DESCRIPTION "no package description available")
+ else()
+ set(component_description_var CPACK_COMPONENT_${_local_component_name}_DESCRIPTION)
+
+ # component description overrides package description
+ if(${component_description_var})
+ set(CPACK_DEBIAN_PACKAGE_DESCRIPTION ${${component_description_var}})
+ elseif(NOT CPACK_DEBIAN_PACKAGE_DESCRIPTION)
+ if(NOT CPACK_PACKAGE_DESCRIPTION_SUMMARY)
+ message(FATAL_ERROR "CPackDeb: Debian package requires a summary for a package, set CPACK_PACKAGE_DESCRIPTION_SUMMARY or CPACK_DEBIAN_PACKAGE_DESCRIPTION or ${component_description_var}")
+ endif()
+ set(CPACK_DEBIAN_PACKAGE_DESCRIPTION ${CPACK_PACKAGE_DESCRIPTION_SUMMARY})
endif()
endif()