summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Help/release/dev/cpack-deb-imporvements.rst19
-rw-r--r--Modules/CPackDMG.cmake2
-rw-r--r--Modules/CPackDeb.cmake106
-rw-r--r--Modules/CPackIFW.cmake53
-rw-r--r--Modules/ExternalProject.cmake2
-rw-r--r--Source/CMakeVersion.cmake2
-rw-r--r--Source/CPack/IFW/cmCPackIFWPackage.cxx11
-rw-r--r--Source/CPack/IFW/cmCPackIFWPackage.h3
-rw-r--r--Source/CPack/cmCPackDebGenerator.cxx8
-rw-r--r--Tests/CPackComponentsDEB/CMakeLists.txt2
-rw-r--r--Tests/CPackComponentsDEB/MyLibCPackConfig-components-depend1.cmake.in1
-rw-r--r--Tests/CPackComponentsDEB/MyLibCPackConfig-components-depend2.cmake.in1
-rw-r--r--Tests/CPackComponentsForAll/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/CPack/CUSTOM_NAMES.cmake (renamed from Tests/RunCMake/CPack/RPM_CUSTOM_NAMES.cmake)4
-rw-r--r--Tests/RunCMake/CPack/DEB/COMPONENTS_EMPTY_DIR-specifics.cmake1
-rw-r--r--Tests/RunCMake/CPack/DEB/CUSTOM_NAMES-ExpectedFiles.cmake9
-rw-r--r--Tests/RunCMake/CPack/DEB/CUSTOM_NAMES-specifics.cmake6
-rw-r--r--Tests/RunCMake/CPack/DEB/DEPENDENCIES-ExpectedFiles.cmake10
-rw-r--r--Tests/RunCMake/CPack/DEB/DEPENDENCIES-specifics.cmake2
-rw-r--r--Tests/RunCMake/CPack/DEB/EMPTY_DIR-specifics.cmake1
-rw-r--r--Tests/RunCMake/CPack/DEB/MINIMAL-specifics.cmake1
-rw-r--r--Tests/RunCMake/CPack/DEB/PER_COMPONENT_FIELDS-specifics.cmake1
-rw-r--r--Tests/RunCMake/CPack/DEB_EXTRA.cmake1
-rw-r--r--Tests/RunCMake/CPack/DEB_GENERATE_SHLIBS.cmake1
-rw-r--r--Tests/RunCMake/CPack/DEB_GENERATE_SHLIBS_LDCONFIG.cmake1
-rw-r--r--Tests/RunCMake/CPack/RPM/CUSTOM_NAMES-ExpectedFiles.cmake (renamed from Tests/RunCMake/CPack/RPM/RPM_CUSTOM_NAMES-ExpectedFiles.cmake)0
-rw-r--r--Tests/RunCMake/CPack/RPM/CUSTOM_NAMES-specifics.cmake5
-rw-r--r--Tests/RunCMake/CPack/RPM/CUSTOM_NAMES-stderr.txt3
-rw-r--r--Tests/RunCMake/CPack/RPM/RPM_CUSTOM_NAMES-stderr.txt3
-rw-r--r--Tests/RunCMake/CPack/RunCMakeTest.cmake2
30 files changed, 195 insertions, 69 deletions
diff --git a/Help/release/dev/cpack-deb-imporvements.rst b/Help/release/dev/cpack-deb-imporvements.rst
index 4fd35b8..63312b5 100644
--- a/Help/release/dev/cpack-deb-imporvements.rst
+++ b/Help/release/dev/cpack-deb-imporvements.rst
@@ -11,17 +11,22 @@ cpack-deb-imporvements
* The :module:`CPackDeb` module learned how to generate dependencies between
Debian packages if multi-component setup is used and
:variable:`CPACK_COMPONENT_<compName>_DEPENDS` variables are set.
- This breaks compatibility with previous versions.
+ For backward compatibility this feature is disabled by default. See
+ :variable:`CPACK_DEBIAN_ENABLE_COMPONENT_DEPENDS`.
-* The :module:`CPackDeb` module learned how to set the package release number
- (``DebianRevisionNumber`` in package file name). See
- :variable:`CPACK_DEBIAN_PACKAGE_RELEASE`.
-
-* The :module:`CPackDeb` module now generates properly-named Debian packages::
+* The :module:`CPackDeb` module learned how to set custom package file names
+ including how to generate properly-named Debian packages::
<PackageName>_<VersionNumber>-<DebianRevisionNumber>_<DebianArchitecture>.deb
- This breaks compatibility with previous versions.
+ For backward compatibility this feature is disabled by default. See
+ :variable:`CPACK_DEBIAN_FILE_NAME` and
+ :variable:`CPACK_DEBIAN_<COMPONENT>_FILE_NAME`.
+
+* The :module:`CPackDeb` module learned how to set the package release number
+ (``DebianRevisionNumber`` in package file name when used in combination with
+ ``DEB-DEFAULT`` value set by :variable:`CPACK_DEBIAN_FILE_NAME`). See
+ :variable:`CPACK_DEBIAN_PACKAGE_RELEASE`.
* The :module:`CPackDeb` module learned how to set the package architecture
per-component. See :variable:`CPACK_DEBIAN_<COMPONENT>_PACKAGE_ARCHITECTURE`.
diff --git a/Modules/CPackDMG.cmake b/Modules/CPackDMG.cmake
index e34f8cd..1959f22 100644
--- a/Modules/CPackDMG.cmake
+++ b/Modules/CPackDMG.cmake
@@ -19,7 +19,7 @@
#
# The disk image format. Common values are UDRO (UDIF read-only), UDZO (UDIF
# zlib-compressed) or UDBZ (UDIF bzip2-compressed). Refer to hdiutil(1) for
-# more information on other available formats.
+# more information on other available formats. Defaults to UDZO.
#
# .. variable:: CPACK_DMG_DS_STORE
#
diff --git a/Modules/CPackDeb.cmake b/Modules/CPackDeb.cmake
index d93d924..ebeb387 100644
--- a/Modules/CPackDeb.cmake
+++ b/Modules/CPackDeb.cmake
@@ -42,6 +42,32 @@
#
# See https://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-Source
#
+# .. variable:: CPACK_DEBIAN_FILE_NAME
+# CPACK_DEBIAN_<COMPONENT>_FILE_NAME
+#
+# Package file name.
+#
+# * Mandatory : YES
+# * Default : ``<CPACK_PACKAGE_FILE_NAME>[-<component>].deb``
+#
+# This may be set to ``DEB-DEFAULT`` to allow CPackDeb to generate package file
+# name by itself in deb format::
+#
+# <PackageName>_<VersionNumber>-<DebianRevisionNumber>_<DebianArchitecture>.deb
+#
+# Alternatively provided package file name must end with ".deb" suffix.
+#
+# .. note::
+#
+# Preferred setting of this variable is ``DEB-DEFAULT`` but for backward
+# compatibility with CPackDeb in CMake prior to version 3.6 this feature
+# is disabled by default.
+#
+# .. note::
+#
+# By using non default filenames duplicate names may occur. Duplicate files
+# get overwritten and it is up to the packager to set the variables in a
+# manner that will prevent such errors.
#
# .. variable:: CPACK_DEBIAN_PACKAGE_VERSION
#
@@ -100,6 +126,13 @@
#
# set(CPACK_DEBIAN_PACKAGE_DEPENDS "libc6 (>= 2.3.1-6), libc6 (< 2.4)")
#
+# .. variable:: CPACK_DEBIAN_ENABLE_COMPONENT_DEPENDS
+#
+# Sets inter component dependencies if listed with
+# :variable:`CPACK_COMPONENT_<compName>_DEPENDS` variables.
+#
+# * Mandatory : NO
+# * Default : -
#
# .. variable:: CPACK_DEBIAN_PACKAGE_MAINTAINER
#
@@ -466,6 +499,17 @@ if(NOT UNIX)
message(FATAL_ERROR "CPackDeb.cmake may only be used under UNIX.")
endif()
+function(cpack_deb_variable_fallback OUTPUT_VAR_NAME)
+ set(FALLBACK_VAR_NAMES ${ARGN})
+
+ foreach(variable_name IN LISTS FALLBACK_VAR_NAMES)
+ if(${variable_name})
+ set(${OUTPUT_VAR_NAME} "${${variable_name}}" PARENT_SCOPE)
+ break()
+ endif()
+ endforeach()
+endfunction()
+
function(get_component_package_name var component)
string(TOUPPER "${component}" component_upcase)
if(CPACK_DEBIAN_${component_upcase}_PACKAGE_NAME)
@@ -713,20 +757,23 @@ function(cpack_deb_prepare_package_vars)
endif()
endif()
endforeach()
- set(COMPONENT_DEPENDS "")
- foreach (_PACK ${CPACK_COMPONENT_${_local_component_name}_DEPENDS})
- get_component_package_name(_PACK_NAME "${_PACK}")
+
+ if(CPACK_DEBIAN_ENABLE_COMPONENT_DEPENDS)
+ set(COMPONENT_DEPENDS "")
+ foreach (_PACK ${CPACK_COMPONENT_${_local_component_name}_DEPENDS})
+ get_component_package_name(_PACK_NAME "${_PACK}")
+ if(COMPONENT_DEPENDS)
+ set(COMPONENT_DEPENDS "${_PACK_NAME} (= ${CPACK_DEBIAN_PACKAGE_VERSION}), ${COMPONENT_DEPENDS}")
+ else()
+ set(COMPONENT_DEPENDS "${_PACK_NAME} (= ${CPACK_DEBIAN_PACKAGE_VERSION})")
+ endif()
+ endforeach()
if(COMPONENT_DEPENDS)
- set(COMPONENT_DEPENDS "${_PACK_NAME} (= ${CPACK_DEBIAN_PACKAGE_VERSION}), ${COMPONENT_DEPENDS}")
- else()
- set(COMPONENT_DEPENDS "${_PACK_NAME} (= ${CPACK_DEBIAN_PACKAGE_VERSION})")
- endif()
- endforeach()
- if(COMPONENT_DEPENDS)
- if(CPACK_DEBIAN_PACKAGE_DEPENDS)
- set(CPACK_DEBIAN_PACKAGE_DEPENDS "${COMPONENT_DEPENDS}, ${CPACK_DEBIAN_PACKAGE_DEPENDS}")
- else()
- set(CPACK_DEBIAN_PACKAGE_DEPENDS "${COMPONENT_DEPENDS}")
+ if(CPACK_DEBIAN_PACKAGE_DEPENDS)
+ set(CPACK_DEBIAN_PACKAGE_DEPENDS "${COMPONENT_DEPENDS}, ${CPACK_DEBIAN_PACKAGE_DEPENDS}")
+ else()
+ set(CPACK_DEBIAN_PACKAGE_DEPENDS "${COMPONENT_DEPENDS}")
+ endif()
endif()
endif()
endif()
@@ -878,13 +925,32 @@ function(cpack_deb_prepare_package_vars)
set(CPACK_DEBIAN_PACKAGE_RELEASE 1)
endif()
- # Patch package file name to be in corrent debian format:
- # <foo>_<VersionNumber>-<DebianRevisionNumber>_<DebianArchitecture>.deb
- set(CPACK_OUTPUT_FILE_NAME
- "${CPACK_DEBIAN_PACKAGE_NAME}_${CPACK_PACKAGE_VERSION}-${CPACK_DEBIAN_PACKAGE_RELEASE}_${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}.deb")
- set(CPACK_TEMPORARY_PACKAGE_FILE_NAME "${CPACK_TOPLEVEL_DIRECTORY}/${CPACK_OUTPUT_FILE_NAME}")
- get_filename_component(BINARY_DIR "${CPACK_OUTPUT_FILE_PATH}" DIRECTORY)
- set(CPACK_OUTPUT_FILE_PATH "${BINARY_DIR}/${CPACK_OUTPUT_FILE_NAME}")
+
+ cpack_deb_variable_fallback("CPACK_DEBIAN_FILE_NAME"
+ "CPACK_DEBIAN_${_local_component_name}_FILE_NAME"
+ "CPACK_DEBIAN_FILE_NAME")
+ if(CPACK_DEBIAN_FILE_NAME)
+ if(CPACK_DEBIAN_FILE_NAME STREQUAL "DEB-DEFAULT")
+ # Patch package file name to be in corrent debian format:
+ # <foo>_<VersionNumber>-<DebianRevisionNumber>_<DebianArchitecture>.deb
+ set(CPACK_OUTPUT_FILE_NAME
+ "${CPACK_DEBIAN_PACKAGE_NAME}_${CPACK_PACKAGE_VERSION}-${CPACK_DEBIAN_PACKAGE_RELEASE}_${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}.deb")
+ else()
+ cmake_policy(PUSH)
+ cmake_policy(SET CMP0010 NEW)
+ if(NOT CPACK_DEBIAN_FILE_NAME MATCHES ".*\\.deb")
+ cmake_policy(POP)
+ message(FATAL_ERROR "'${CPACK_DEBIAN_FILE_NAME}' is not a valid DEB package file name as it must end with '.deb'!")
+ endif()
+ cmake_policy(POP)
+
+ set(CPACK_OUTPUT_FILE_NAME "${CPACK_DEBIAN_FILE_NAME}")
+ endif()
+
+ set(CPACK_TEMPORARY_PACKAGE_FILE_NAME "${CPACK_TOPLEVEL_DIRECTORY}/${CPACK_OUTPUT_FILE_NAME}")
+ get_filename_component(BINARY_DIR "${CPACK_OUTPUT_FILE_PATH}" DIRECTORY)
+ set(CPACK_OUTPUT_FILE_PATH "${BINARY_DIR}/${CPACK_OUTPUT_FILE_NAME}")
+ endif() # else() back compatibility - don't change the name
# Print out some debug information if we were asked for that
if(CPACK_DEBIAN_PACKAGE_DEBUG)
diff --git a/Modules/CPackIFW.cmake b/Modules/CPackIFW.cmake
index 4cfc9d2..083fc28 100644
--- a/Modules/CPackIFW.cmake
+++ b/Modules/CPackIFW.cmake
@@ -4,8 +4,8 @@
#
# .. _QtIFW: http://doc.qt.io/qtinstallerframework/index.html
#
-# This module looks for the location of the command line utilities supplied with
-# the Qt Installer Framework (QtIFW_).
+# This module looks for the location of the command line utilities supplied
+# with the Qt Installer Framework (QtIFW_).
#
# The module also defines several commands to control the behavior of the
# CPack ``IFW`` generator.
@@ -31,7 +31,8 @@
# Variables
# ^^^^^^^^^
#
-# You can use the following variables to change behavior of CPack ``IFW`` generator.
+# You can use the following variables to change behavior of CPack ``IFW``
+# generator.
#
# Debug
# """"""
@@ -65,7 +66,8 @@
#
# .. variable:: CPACK_IFW_PACKAGE_WINDOW_ICON
#
-# Filename for a custom window icon in PNG format for the Installer application.
+# Filename for a custom window icon in PNG format for the Installer
+# application.
#
# .. variable:: CPACK_IFW_PACKAGE_LOGO
#
@@ -80,7 +82,8 @@
# .. variable:: CPACK_IFW_TARGET_DIRECTORY
#
# Default target directory for installation.
-# By default used "@ApplicationsDir@/:variable:`CPACK_PACKAGE_INSTALL_DIRECTORY`"
+# By default used
+# "@ApplicationsDir@/:variable:`CPACK_PACKAGE_INSTALL_DIRECTORY`"
#
# You can use predefined variables.
#
@@ -186,7 +189,7 @@
#
# ::
#
-# cpack_ifw_configure_component(<compname> [COMMON]
+# cpack_ifw_configure_component(<compname> [COMMON] [ESSENTIAL]
# [NAME <name>]
# [VERSION <version>]
# [SCRIPT <script>]
@@ -194,20 +197,23 @@
# [DEPENDS <com_id> ...]
# [LICENSES <display_name> <file_path> ...])
#
-# This command should be called after cpack_add_component command.
+# This command should be called after :command:`cpack_add_component` command.
#
# ``COMMON`` if set, then the component will be packaged and installed as part
# of a group to which it belongs.
#
+# ``ESSENTIAL`` if set, then the package manager stays disabled until that
+# component is updated.
+#
+# ``NAME`` is used to create domain-like identification for this component.
+# By default used origin component name.
+#
# ``VERSION`` is version of component.
# By default used :variable:`CPACK_PACKAGE_VERSION`.
#
# ``SCRIPT`` is a relative or absolute path to operations script
# for this component.
#
-# ``NAME`` is used to create domain-like identification for this component.
-# By default used origin component name.
-#
# ``PRIORITY`` is priority of the component in the tree.
#
# ``DEPENDS`` list of dependency component identifiers in QtIFW_ style.
@@ -223,21 +229,23 @@
#
# ::
#
-# cpack_ifw_configure_component_group(<grpname>
-# [VERSION <version>]
+# cpack_ifw_configure_component_group(<groupname>
# [NAME <name>]
+# [VERSION <version>]
# [SCRIPT <script>]
# [PRIORITY <priority>]
# [LICENSES <display_name> <file_path> ...])
#
-# This command should be called after cpack_add_component_group command.
+# This command should be called after :command:`cpack_add_component_group`
+# command.
+#
+# ``NAME`` is used to create domain-like identification for this component
+# group.
+# By default used origin component group name.
#
# ``VERSION`` is version of component group.
# By default used :variable:`CPACK_PACKAGE_VERSION`.
#
-# ``NAME`` is used to create domain-like identification for this component group.
-# By default used origin component group name.
-#
# ``SCRIPT`` is a relative or absolute path to operations script
# for this component group.
#
@@ -260,8 +268,8 @@
# [PASSWORD <password>]
# [DISPLAY_NAME <display_name>])
#
-# This macro will also add the <reponame> repository
-# to a variable :variable:`CPACK_IFW_REPOSITORIES_ALL`
+# This command will also add the <reponame> repository
+# to a variable :variable:`CPACK_IFW_REPOSITORIES_ALL`.
#
# ``DISABLED`` if set, then the repository will be disabled by default.
#
@@ -289,9 +297,8 @@
# [PASSWORD <password>]
# [DISPLAY_NAME <display_name>])
#
-# Specified will
-# This macro will also add the repository action
-# to a variable :variable:`CPACK_IFW_REPOSITORIES_ALL`
+# This command will also add the <reponame> repository
+# to a variable :variable:`CPACK_IFW_REPOSITORIES_ALL`.
#
# ``URL`` is points to a list of available components.
#
@@ -541,8 +548,8 @@ macro(cpack_ifw_configure_component compname)
string(TOUPPER ${compname} _CPACK_IFWCOMP_UNAME)
- set(_IFW_OPT COMMON)
- set(_IFW_ARGS VERSION SCRIPT NAME PRIORITY)
+ set(_IFW_OPT COMMON ESSENTIAL)
+ set(_IFW_ARGS NAME VERSION SCRIPT PRIORITY)
set(_IFW_MULTI_ARGS DEPENDS LICENSES)
cmake_parse_arguments(CPACK_IFW_COMPONENT_${_CPACK_IFWCOMP_UNAME} "${_IFW_OPT}" "${_IFW_ARGS}" "${_IFW_MULTI_ARGS}" ${ARGN})
diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake
index ad6de18..2ff18fc 100644
--- a/Modules/ExternalProject.cmake
+++ b/Modules/ExternalProject.cmake
@@ -2021,6 +2021,8 @@ function(_ep_add_update_command name)
--non-interactive ${svn_trust_cert_args} ${svn_user_pw_args})
set(always 1)
elseif(git_repository)
+ unset(CMAKE_MODULE_PATH) # Use CMake builtin find module
+ find_package(Git QUIET)
if(NOT GIT_EXECUTABLE)
message(FATAL_ERROR "error: could not find git for fetch of ${name}")
endif()
diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake
index aff7676..447d29f 100644
--- a/Source/CMakeVersion.cmake
+++ b/Source/CMakeVersion.cmake
@@ -1,5 +1,5 @@
# CMake version number components.
set(CMake_VERSION_MAJOR 3)
set(CMake_VERSION_MINOR 5)
-set(CMake_VERSION_PATCH 20160523)
+set(CMake_VERSION_PATCH 20160525)
#set(CMake_VERSION_RC 1)
diff --git a/Source/CPack/IFW/cmCPackIFWPackage.cxx b/Source/CPack/IFW/cmCPackIFWPackage.cxx
index 5bc1a0b..df612e5 100644
--- a/Source/CPack/IFW/cmCPackIFWPackage.cxx
+++ b/Source/CPack/IFW/cmCPackIFWPackage.cxx
@@ -146,6 +146,7 @@ void cmCPackIFWPackage::DefaultConfiguration()
Licenses.clear();
SortingPriority = "";
Default = "";
+ Essential = "";
Virtual = "";
ForcedInstallation = "";
}
@@ -267,6 +268,11 @@ int cmCPackIFWPackage::ConfigureFromComponent(cmCPackComponent* component)
// Default
Default = component->IsDisabledByDefault ? "false" : "true";
+ // Essential
+ if (this->IsOn(prefix + "ESSENTIAL")) {
+ Essential = "true";
+ }
+
// Virtual
Virtual = component->IsHidden ? "true" : "";
@@ -452,6 +458,11 @@ void cmCPackIFWPackage::GeneratePackageFile()
xout.Element("Default", Default);
}
+ // Essential
+ if (!Essential.empty()) {
+ xout.Element("Essential", Essential);
+ }
+
// Priority
if (!SortingPriority.empty()) {
xout.Element("SortingPriority", SortingPriority);
diff --git a/Source/CPack/IFW/cmCPackIFWPackage.h b/Source/CPack/IFW/cmCPackIFWPackage.h
index 8a566cb..55b07ec 100644
--- a/Source/CPack/IFW/cmCPackIFWPackage.h
+++ b/Source/CPack/IFW/cmCPackIFWPackage.h
@@ -101,6 +101,9 @@ public:
/// Set to true to preselect the component in the installer
std::string Default;
+ /// Marks the package as essential to force a restart of the MaintenanceTool
+ std::string Essential;
+
/// Set to true to hide the component from the installer
std::string Virtual;
diff --git a/Source/CPack/cmCPackDebGenerator.cxx b/Source/CPack/cmCPackDebGenerator.cxx
index 7675677..7fd76df 100644
--- a/Source/CPack/cmCPackDebGenerator.cxx
+++ b/Source/CPack/cmCPackDebGenerator.cxx
@@ -57,8 +57,8 @@ int cmCPackDebGenerator::PackageOnePack(std::string initialTopLevel,
// Begin the archive for this pack
std::string localToplevel(initialTopLevel);
std::string packageFileName(cmSystemTools::GetParentDirectory(toplevel));
- std::string outputFileName(cmsys::SystemTools::LowerCase(std::string(
- this->GetOption("CPACK_PACKAGE_FILE_NAME"))) +
+ std::string outputFileName(std::string(
+ this->GetOption("CPACK_PACKAGE_FILE_NAME")) +
"-" + packageName + this->GetOutputExtension());
localToplevel += "/" + packageName;
@@ -174,8 +174,8 @@ int cmCPackDebGenerator::PackageComponentsAllInOne(
// The ALL GROUPS in ONE package case
std::string localToplevel(initialTopLevel);
std::string packageFileName(cmSystemTools::GetParentDirectory(toplevel));
- std::string outputFileName(cmsys::SystemTools::LowerCase(std::string(
- this->GetOption("CPACK_PACKAGE_FILE_NAME"))) +
+ std::string outputFileName(std::string(
+ this->GetOption("CPACK_PACKAGE_FILE_NAME")) +
this->GetOutputExtension());
// all GROUP in one vs all COMPONENT in one
localToplevel += "/" + compInstDirName;
diff --git a/Tests/CPackComponentsDEB/CMakeLists.txt b/Tests/CPackComponentsDEB/CMakeLists.txt
index 093b23f..9d4b5e9 100644
--- a/Tests/CPackComponentsDEB/CMakeLists.txt
+++ b/Tests/CPackComponentsDEB/CMakeLists.txt
@@ -130,6 +130,8 @@ configure_file(${CPackComponentsDEB_SOURCE_DIR}/MyLibCPackConfig-${CPackDEBConfi
@ONLY)
set(CPACK_PROJECT_CONFIG_FILE ${CPackComponentsDEB_BINARY_DIR}/MyLibCPackConfig-${CPackDEBConfiguration}.cmake)
+# set CPACK_DEBIAN_FILE_NAME to use default package name format
+set(CPACK_DEBIAN_FILE_NAME "DEB-DEFAULT")
# Include CPack to introduce the appropriate targets
include(CPack)
diff --git a/Tests/CPackComponentsDEB/MyLibCPackConfig-components-depend1.cmake.in b/Tests/CPackComponentsDEB/MyLibCPackConfig-components-depend1.cmake.in
index d207bcc..dc038fa 100644
--- a/Tests/CPackComponentsDEB/MyLibCPackConfig-components-depend1.cmake.in
+++ b/Tests/CPackComponentsDEB/MyLibCPackConfig-components-depend1.cmake.in
@@ -4,6 +4,7 @@
if(CPACK_GENERATOR MATCHES "DEB")
set(CPACK_DEB_COMPONENT_INSTALL "ON")
+ set(CPACK_DEBIAN_ENABLE_COMPONENT_DEPENDS "ON")
endif()
#
diff --git a/Tests/CPackComponentsDEB/MyLibCPackConfig-components-depend2.cmake.in b/Tests/CPackComponentsDEB/MyLibCPackConfig-components-depend2.cmake.in
index 803720a..1aa7d01 100644
--- a/Tests/CPackComponentsDEB/MyLibCPackConfig-components-depend2.cmake.in
+++ b/Tests/CPackComponentsDEB/MyLibCPackConfig-components-depend2.cmake.in
@@ -4,6 +4,7 @@
if(CPACK_GENERATOR MATCHES "DEB")
set(CPACK_DEB_COMPONENT_INSTALL "ON")
+ set(CPACK_DEBIAN_ENABLE_COMPONENT_DEPENDS "ON")
endif()
#
diff --git a/Tests/CPackComponentsForAll/CMakeLists.txt b/Tests/CPackComponentsForAll/CMakeLists.txt
index 05c13a4..3440843 100644
--- a/Tests/CPackComponentsForAll/CMakeLists.txt
+++ b/Tests/CPackComponentsForAll/CMakeLists.txt
@@ -165,6 +165,9 @@ set(CPACK_RPM_RELOCATION_PATHS "${CMAKE_INSTALL_INCLUDEDIR}"
"${CMAKE_INSTALL_LIBDIR}" "${CMAKE_INSTALL_BINDIR}" "other_relocatable"
"${CMAKE_INSTALL_LIBDIR}/inside_relocatable_two/depth_two/different_relocatable")
+# set CPACK_DEBIAN_FILE_NAME to use default package name format
+set(CPACK_DEBIAN_FILE_NAME "DEB-DEFAULT")
+
# We may use the CPack specific config file in order
# to tailor CPack behavior on a CPack generator specific way
# (Behavior would be different for RPM or TGZ or DEB ...)
diff --git a/Tests/RunCMake/CPack/RPM_CUSTOM_NAMES.cmake b/Tests/RunCMake/CPack/CUSTOM_NAMES.cmake
index ba53a87..c89df89 100644
--- a/Tests/RunCMake/CPack/RPM_CUSTOM_NAMES.cmake
+++ b/Tests/RunCMake/CPack/CUSTOM_NAMES.cmake
@@ -1,9 +1,5 @@
set(CPACK_RPM_COMPONENT_INSTALL "ON")
-set(CPACK_RPM_FILE_NAME "RPM-DEFAULT")
-set(CPACK_RPM_PKG_2_PACKAGE_NAME "second")
-set(CPACK_RPM_PKG_3_FILE_NAME "pkg_3_abc.rpm")
-
install(FILES CMakeLists.txt DESTINATION foo COMPONENT pkg_1)
install(FILES CMakeLists.txt DESTINATION foo COMPONENT pkg_2)
install(FILES CMakeLists.txt DESTINATION foo COMPONENT pkg_3)
diff --git a/Tests/RunCMake/CPack/DEB/COMPONENTS_EMPTY_DIR-specifics.cmake b/Tests/RunCMake/CPack/DEB/COMPONENTS_EMPTY_DIR-specifics.cmake
index 2720fe9..4b4ac8d 100644
--- a/Tests/RunCMake/CPack/DEB/COMPONENTS_EMPTY_DIR-specifics.cmake
+++ b/Tests/RunCMake/CPack/DEB/COMPONENTS_EMPTY_DIR-specifics.cmake
@@ -1,2 +1,3 @@
set(CPACK_PACKAGE_CONTACT "someone")
set(CPACK_DEB_COMPONENT_INSTALL "ON")
+set(CPACK_DEBIAN_FILE_NAME "DEB-DEFAULT")
diff --git a/Tests/RunCMake/CPack/DEB/CUSTOM_NAMES-ExpectedFiles.cmake b/Tests/RunCMake/CPack/DEB/CUSTOM_NAMES-ExpectedFiles.cmake
new file mode 100644
index 0000000..2acf45b
--- /dev/null
+++ b/Tests/RunCMake/CPack/DEB/CUSTOM_NAMES-ExpectedFiles.cmake
@@ -0,0 +1,9 @@
+set(whitespaces_ "[\t\n\r ]*")
+
+set(EXPECTED_FILES_COUNT "3")
+set(EXPECTED_FILE_1 "custom_names-pkg_1_0.1.1-1_*.deb")
+set(EXPECTED_FILE_CONTENT_1 "^.*/usr/foo${whitespaces_}.*/usr/foo/CMakeLists.txt$")
+set(EXPECTED_FILE_2 "second*.deb")
+set(EXPECTED_FILE_CONTENT_2 "^.*/usr/foo${whitespaces_}.*/usr/foo/CMakeLists.txt$")
+set(EXPECTED_FILE_3 "pkg_3_abc.deb")
+set(EXPECTED_FILE_CONTENT_3 "^.*/usr/foo${whitespaces_}.*/usr/foo/CMakeLists.txt$")
diff --git a/Tests/RunCMake/CPack/DEB/CUSTOM_NAMES-specifics.cmake b/Tests/RunCMake/CPack/DEB/CUSTOM_NAMES-specifics.cmake
new file mode 100644
index 0000000..c64f161
--- /dev/null
+++ b/Tests/RunCMake/CPack/DEB/CUSTOM_NAMES-specifics.cmake
@@ -0,0 +1,6 @@
+set(CPACK_PACKAGE_CONTACT "someone")
+set(CPACK_DEB_COMPONENT_INSTALL "ON")
+
+set(CPACK_DEBIAN_FILE_NAME "DEB-DEFAULT")
+set(CPACK_DEBIAN_PKG_2_PACKAGE_NAME "second")
+set(CPACK_DEBIAN_PKG_3_FILE_NAME "pkg_3_abc.deb")
diff --git a/Tests/RunCMake/CPack/DEB/DEPENDENCIES-ExpectedFiles.cmake b/Tests/RunCMake/CPack/DEB/DEPENDENCIES-ExpectedFiles.cmake
index c182e30..a6f08fe 100644
--- a/Tests/RunCMake/CPack/DEB/DEPENDENCIES-ExpectedFiles.cmake
+++ b/Tests/RunCMake/CPack/DEB/DEPENDENCIES-ExpectedFiles.cmake
@@ -1,14 +1,14 @@
set(whitespaces_ "[\t\n\r ]*")
set(EXPECTED_FILES_COUNT "5")
-set(EXPECTED_FILE_1 "dependencies-applications_0.1.1-1_*.deb")
+set(EXPECTED_FILE_1 "dependencies-0.1.1-*-applications.deb")
set(EXPECTED_FILE_CONTENT_1 "^.*/usr/foo${whitespaces_}.*/usr/foo/test_prog$")
-set(EXPECTED_FILE_2 "dependencies-applications_auto_0.1.1-1_*.deb")
+set(EXPECTED_FILE_2 "dependencies-0.1.1-*-applications_auto.deb")
set(EXPECTED_FILE_CONTENT_2 "^.*/usr/foo_auto${whitespaces_}.*/usr/foo_auto/test_prog$")
-set(EXPECTED_FILE_3 "dependencies-headers_0.1.1-1_*.deb")
+set(EXPECTED_FILE_3 "dependencies-0.1.1-*-headers.deb")
set(EXPECTED_FILE_CONTENT_3 "^.*/usr/bar${whitespaces_}.*/usr/bar/CMakeLists.txt$")
-set(EXPECTED_FILE_4 "dependencies-libs_0.1.1-1_*.deb")
+set(EXPECTED_FILE_4 "dependencies-0.1.1-*-libs.deb")
# dynamic lib extension is .so on Linux and .dylib on Mac so we will use a wildcard .* for it
set(EXPECTED_FILE_CONTENT_4 "^.*/usr/bas${whitespaces_}.*/usr/bas/libtest_lib\\..*$")
-set(EXPECTED_FILE_5 "dependencies-libs_auto_0.1.1-1_*.deb")
+set(EXPECTED_FILE_5 "dependencies-0.1.1-*-libs_auto.deb")
set(EXPECTED_FILE_CONTENT_5 "^.*/usr/bas_auto${whitespaces_}.*/usr/bas_auto/libtest_lib\\..*$")
diff --git a/Tests/RunCMake/CPack/DEB/DEPENDENCIES-specifics.cmake b/Tests/RunCMake/CPack/DEB/DEPENDENCIES-specifics.cmake
index 96a9f14..5f82cc6 100644
--- a/Tests/RunCMake/CPack/DEB/DEPENDENCIES-specifics.cmake
+++ b/Tests/RunCMake/CPack/DEB/DEPENDENCIES-specifics.cmake
@@ -1,5 +1,7 @@
set(CPACK_PACKAGE_CONTACT "someone")
set(CPACK_DEB_COMPONENT_INSTALL "ON")
+#intentionaly commented out to test old file naming
+#set(CPACK_DEBIAN_FILE_NAME "DEB-DEFAULT")
# false by default
set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS FALSE)
diff --git a/Tests/RunCMake/CPack/DEB/EMPTY_DIR-specifics.cmake b/Tests/RunCMake/CPack/DEB/EMPTY_DIR-specifics.cmake
index 8821ab9..4e9a2e7 100644
--- a/Tests/RunCMake/CPack/DEB/EMPTY_DIR-specifics.cmake
+++ b/Tests/RunCMake/CPack/DEB/EMPTY_DIR-specifics.cmake
@@ -1 +1,2 @@
set(CPACK_PACKAGE_CONTACT "someone")
+set(CPACK_DEBIAN_FILE_NAME "DEB-DEFAULT")
diff --git a/Tests/RunCMake/CPack/DEB/MINIMAL-specifics.cmake b/Tests/RunCMake/CPack/DEB/MINIMAL-specifics.cmake
index 8821ab9..4e9a2e7 100644
--- a/Tests/RunCMake/CPack/DEB/MINIMAL-specifics.cmake
+++ b/Tests/RunCMake/CPack/DEB/MINIMAL-specifics.cmake
@@ -1 +1,2 @@
set(CPACK_PACKAGE_CONTACT "someone")
+set(CPACK_DEBIAN_FILE_NAME "DEB-DEFAULT")
diff --git a/Tests/RunCMake/CPack/DEB/PER_COMPONENT_FIELDS-specifics.cmake b/Tests/RunCMake/CPack/DEB/PER_COMPONENT_FIELDS-specifics.cmake
index a1da1a3..25bd2e7 100644
--- a/Tests/RunCMake/CPack/DEB/PER_COMPONENT_FIELDS-specifics.cmake
+++ b/Tests/RunCMake/CPack/DEB/PER_COMPONENT_FIELDS-specifics.cmake
@@ -1,5 +1,6 @@
set(CPACK_PACKAGE_CONTACT "someone")
set(CPACK_DEB_COMPONENT_INSTALL "ON")
+set(CPACK_DEBIAN_FILE_NAME "DEB-DEFAULT")
set(CPACK_DEBIAN_PACKAGE_SECTION "default")
set(CPACK_DEBIAN_PKG_2_PACKAGE_NAME "second")
diff --git a/Tests/RunCMake/CPack/DEB_EXTRA.cmake b/Tests/RunCMake/CPack/DEB_EXTRA.cmake
index 3c291d5..189d123 100644
--- a/Tests/RunCMake/CPack/DEB_EXTRA.cmake
+++ b/Tests/RunCMake/CPack/DEB_EXTRA.cmake
@@ -34,5 +34,6 @@ set(CPACK_DEBIAN_BAR_PACKAGE_CONTROL_EXTRA
set(CPACK_PACKAGE_NAME "deb_extra")
set(CPACK_PACKAGE_CONTACT "someone")
+set(CPACK_DEBIAN_FILE_NAME "DEB-DEFAULT")
set(CPACK_DEB_COMPONENT_INSTALL ON)
diff --git a/Tests/RunCMake/CPack/DEB_GENERATE_SHLIBS.cmake b/Tests/RunCMake/CPack/DEB_GENERATE_SHLIBS.cmake
index efb0211..1aeb06f 100644
--- a/Tests/RunCMake/CPack/DEB_GENERATE_SHLIBS.cmake
+++ b/Tests/RunCMake/CPack/DEB_GENERATE_SHLIBS.cmake
@@ -1,5 +1,6 @@
set(CPACK_PACKAGE_CONTACT "someone")
set(CPACK_DEB_COMPONENT_INSTALL "ON")
+set(CPACK_DEBIAN_FILE_NAME "DEB-DEFAULT")
set(CPACK_DEBIAN_PACKAGE_GENERATE_SHLIBS "ON")
diff --git a/Tests/RunCMake/CPack/DEB_GENERATE_SHLIBS_LDCONFIG.cmake b/Tests/RunCMake/CPack/DEB_GENERATE_SHLIBS_LDCONFIG.cmake
index 1f70386..f58c876 100644
--- a/Tests/RunCMake/CPack/DEB_GENERATE_SHLIBS_LDCONFIG.cmake
+++ b/Tests/RunCMake/CPack/DEB_GENERATE_SHLIBS_LDCONFIG.cmake
@@ -1,5 +1,6 @@
set(CPACK_PACKAGE_CONTACT "someone")
set(CPACK_DEB_COMPONENT_INSTALL "ON")
+set(CPACK_DEBIAN_FILE_NAME "DEB-DEFAULT")
set(CPACK_DEBIAN_PACKAGE_GENERATE_SHLIBS "ON")
set(CPACK_DEBIAN_PACKAGE_GENERATE_SHLIBS_POLICY ">=")
diff --git a/Tests/RunCMake/CPack/RPM/RPM_CUSTOM_NAMES-ExpectedFiles.cmake b/Tests/RunCMake/CPack/RPM/CUSTOM_NAMES-ExpectedFiles.cmake
index 780e57e..780e57e 100644
--- a/Tests/RunCMake/CPack/RPM/RPM_CUSTOM_NAMES-ExpectedFiles.cmake
+++ b/Tests/RunCMake/CPack/RPM/CUSTOM_NAMES-ExpectedFiles.cmake
diff --git a/Tests/RunCMake/CPack/RPM/CUSTOM_NAMES-specifics.cmake b/Tests/RunCMake/CPack/RPM/CUSTOM_NAMES-specifics.cmake
new file mode 100644
index 0000000..575aa01
--- /dev/null
+++ b/Tests/RunCMake/CPack/RPM/CUSTOM_NAMES-specifics.cmake
@@ -0,0 +1,5 @@
+set(CPACK_RPM_COMPONENT_INSTALL "ON")
+
+set(CPACK_RPM_FILE_NAME "RPM-DEFAULT")
+set(CPACK_RPM_PKG_2_PACKAGE_NAME "second")
+set(CPACK_RPM_PKG_3_FILE_NAME "pkg_3_abc.rpm")
diff --git a/Tests/RunCMake/CPack/RPM/CUSTOM_NAMES-stderr.txt b/Tests/RunCMake/CPack/RPM/CUSTOM_NAMES-stderr.txt
new file mode 100644
index 0000000..9bfba7e
--- /dev/null
+++ b/Tests/RunCMake/CPack/RPM/CUSTOM_NAMES-stderr.txt
@@ -0,0 +1,3 @@
+^CPackRPM: Will use GENERATED spec file: .*/Tests/RunCMake/RPM/CPack/CUSTOM_NAMES-build/_CPack_Packages/.*/RPM/SPECS/custom_names-pkg_1.spec
+CPackRPM: Will use GENERATED spec file: .*/Tests/RunCMake/RPM/CPack/CUSTOM_NAMES-build/_CPack_Packages/.*/RPM/SPECS/second.spec
+CPackRPM: Will use GENERATED spec file: .*/Tests/RunCMake/RPM/CPack/CUSTOM_NAMES-build/_CPack_Packages/.*/RPM/SPECS/custom_names-pkg_3.spec$
diff --git a/Tests/RunCMake/CPack/RPM/RPM_CUSTOM_NAMES-stderr.txt b/Tests/RunCMake/CPack/RPM/RPM_CUSTOM_NAMES-stderr.txt
deleted file mode 100644
index d3ba7b0..0000000
--- a/Tests/RunCMake/CPack/RPM/RPM_CUSTOM_NAMES-stderr.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-^CPackRPM: Will use GENERATED spec file: .*/Tests/RunCMake/RPM/CPack/RPM_CUSTOM_NAMES-build/_CPack_Packages/.*/RPM/SPECS/custom_names-pkg_1.spec
-CPackRPM: Will use GENERATED spec file: .*/Tests/RunCMake/RPM/CPack/RPM_CUSTOM_NAMES-build/_CPack_Packages/.*/RPM/SPECS/second.spec
-CPackRPM: Will use GENERATED spec file: .*/Tests/RunCMake/RPM/CPack/RPM_CUSTOM_NAMES-build/_CPack_Packages/.*/RPM/SPECS/custom_names-pkg_3.spec$
diff --git a/Tests/RunCMake/CPack/RunCMakeTest.cmake b/Tests/RunCMake/CPack/RunCMakeTest.cmake
index 759295f..59c52f8 100644
--- a/Tests/RunCMake/CPack/RunCMakeTest.cmake
+++ b/Tests/RunCMake/CPack/RunCMakeTest.cmake
@@ -10,7 +10,7 @@ run_cpack_test(DEB_EXTRA "DEB" false)
run_cpack_test(DEPENDENCIES "RPM;DEB" true)
run_cpack_test(EMPTY_DIR "RPM;DEB;TGZ" true)
run_cpack_test(COMPONENTS_EMPTY_DIR "RPM;DEB;TGZ" true)
-run_cpack_test(RPM_CUSTOM_NAMES "RPM" true)
+run_cpack_test(CUSTOM_NAMES "RPM;DEB" true)
run_cpack_test(PER_COMPONENT_FIELDS "RPM;DEB" false)
run_cpack_test(RPM_DIST "RPM" false)
run_cpack_test(INSTALL_SCRIPTS "RPM" false)