CPackIFW: Command cpack_ifw_configure_component learned ESSENTIAL option

This commit is contained in:
Konstantin Podsvirov 2016-05-23 15:32:22 +03:00
parent 222fa595cd
commit 06ca7795f4
3 changed files with 19 additions and 2 deletions

View File

@ -189,7 +189,7 @@
# #
# :: # ::
# #
# cpack_ifw_configure_component(<compname> [COMMON] # cpack_ifw_configure_component(<compname> [COMMON] [ESSENTIAL]
# [NAME <name>] # [NAME <name>]
# [VERSION <version>] # [VERSION <version>]
# [SCRIPT <script>] # [SCRIPT <script>]
@ -202,6 +202,9 @@
# ``COMMON`` if set, then the component will be packaged and installed as part # ``COMMON`` if set, then the component will be packaged and installed as part
# of a group to which it belongs. # 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. # ``NAME`` is used to create domain-like identification for this component.
# By default used origin component name. # By default used origin component name.
# #
@ -545,7 +548,7 @@ macro(cpack_ifw_configure_component compname)
string(TOUPPER ${compname} _CPACK_IFWCOMP_UNAME) string(TOUPPER ${compname} _CPACK_IFWCOMP_UNAME)
set(_IFW_OPT COMMON) set(_IFW_OPT COMMON ESSENTIAL)
set(_IFW_ARGS NAME VERSION SCRIPT PRIORITY) set(_IFW_ARGS NAME VERSION SCRIPT PRIORITY)
set(_IFW_MULTI_ARGS DEPENDS LICENSES) set(_IFW_MULTI_ARGS DEPENDS LICENSES)
cmake_parse_arguments(CPACK_IFW_COMPONENT_${_CPACK_IFWCOMP_UNAME} "${_IFW_OPT}" "${_IFW_ARGS}" "${_IFW_MULTI_ARGS}" ${ARGN}) cmake_parse_arguments(CPACK_IFW_COMPONENT_${_CPACK_IFWCOMP_UNAME} "${_IFW_OPT}" "${_IFW_ARGS}" "${_IFW_MULTI_ARGS}" ${ARGN})

View File

@ -146,6 +146,7 @@ void cmCPackIFWPackage::DefaultConfiguration()
Licenses.clear(); Licenses.clear();
SortingPriority = ""; SortingPriority = "";
Default = ""; Default = "";
Essential = "";
Virtual = ""; Virtual = "";
ForcedInstallation = ""; ForcedInstallation = "";
} }
@ -267,6 +268,11 @@ int cmCPackIFWPackage::ConfigureFromComponent(cmCPackComponent* component)
// Default // Default
Default = component->IsDisabledByDefault ? "false" : "true"; Default = component->IsDisabledByDefault ? "false" : "true";
// Essential
if (this->IsOn(prefix + "ESSENTIAL")) {
Essential = "true";
}
// Virtual // Virtual
Virtual = component->IsHidden ? "true" : ""; Virtual = component->IsHidden ? "true" : "";
@ -452,6 +458,11 @@ void cmCPackIFWPackage::GeneratePackageFile()
xout.Element("Default", Default); xout.Element("Default", Default);
} }
// Essential
if (!Essential.empty()) {
xout.Element("Essential", Essential);
}
// Priority // Priority
if (!SortingPriority.empty()) { if (!SortingPriority.empty()) {
xout.Element("SortingPriority", SortingPriority); xout.Element("SortingPriority", SortingPriority);

View File

@ -101,6 +101,9 @@ public:
/// Set to true to preselect the component in the installer /// Set to true to preselect the component in the installer
std::string Default; 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 /// Set to true to hide the component from the installer
std::string Virtual; std::string Virtual;