Merge topic 'CPack-Bug11452-ComponentBreakage-v2'

12a7125 CPack Fix KWStyle error
d0eb89c CPack backward compatibility fix 2.8.3-2.8.2 (bug 11452)
This commit is contained in:
Brad King 2010-12-02 14:24:51 -05:00 committed by CMake Topic Stage
commit 42fac25808
1 changed files with 30 additions and 16 deletions

View File

@ -228,21 +228,25 @@ int cmCPackArchiveGenerator::PackageFiles()
PrepareGroupingKind(); PrepareGroupingKind();
// CASE 1 : COMPONENT ALL-IN-ONE package if (SupportsComponentInstallation()) {
// If ALL GROUPS or ALL COMPONENTS in ONE package has been requested // CASE 1 : COMPONENT ALL-IN-ONE package
// then the package file is unique and should be open here. // If ALL GROUPS or ALL COMPONENTS in ONE package has been requested
if (allComponentInOne || (allGroupInOne && (!this->ComponentGroups.empty()))) // then the package file is unique and should be open here.
{ if (allComponentInOne ||
return PackageComponentsAllInOne(allComponentInOne); (allGroupInOne && (!this->ComponentGroups.empty()))
} )
// CASE 2 : COMPONENT CLASSICAL package(s) (i.e. not all-in-one) {
// There will be 1 package for each component group return PackageComponentsAllInOne(allComponentInOne);
// however one may require to ignore component group and }
// in this case you'll get 1 package for each component. // CASE 2 : COMPONENT CLASSICAL package(s) (i.e. not all-in-one)
else if ((!this->ComponentGroups.empty()) || (ignoreComponentGroup)) // There will be 1 package for each component group
{ // however one may require to ignore component group and
return PackageComponents(ignoreComponentGroup); // in this case you'll get 1 package for each component.
} else if ((!this->ComponentGroups.empty()) || (ignoreComponentGroup))
{
return PackageComponents(ignoreComponentGroup);
}
}
// CASE 3 : NON COMPONENT package. // CASE 3 : NON COMPONENT package.
DECLARE_AND_OPEN_ARCHIVE(packageFileNames[0],archive); DECLARE_AND_OPEN_ARCHIVE(packageFileNames[0],archive);
@ -278,5 +282,15 @@ int cmCPackArchiveGenerator::GenerateHeader(std::ostream*)
} }
bool cmCPackArchiveGenerator::SupportsComponentInstallation() const { bool cmCPackArchiveGenerator::SupportsComponentInstallation() const {
return true; // The Component installation support should only
// be activated if explicitly requested by the user
// (for backward compatibility reason)
if (IsSet("CPACK_ARCHIVE_COMPONENT_INSTALL"))
{
return true;
}
else
{
return false;
}
} }