summaryrefslogtreecommitdiffstats
path: root/Source/CPack/cmCPackGenerator.cxx
diff options
context:
space:
mode:
authorEric NOULARD <eric.noulard@gmail.com>2011-02-06 20:23:10 (GMT)
committerEric NOULARD <eric.noulard@gmail.com>2011-02-06 20:23:10 (GMT)
commit494bb8ada786be70f39807a574bea6a1ef98654d (patch)
treee7cf92bee0c90b6c8a3dcb97e36d8152f6f8698c /Source/CPack/cmCPackGenerator.cxx
parent76976a59e9edc550fbf5b7b7ac4dbc381c02d139 (diff)
downloadCMake-494bb8ada786be70f39807a574bea6a1ef98654d.zip
CMake-494bb8ada786be70f39807a574bea6a1ef98654d.tar.gz
CMake-494bb8ada786be70f39807a574bea6a1ef98654d.tar.bz2
CPackRPM honors all the different ways of packaging components
RPM cannot easily 'merge' differents directory into a single RPM with shared prefix. So more flexibility has been added to generic CPackGenerator in order to let the specific generator chose the local installation directory for each component.
Diffstat (limited to 'Source/CPack/cmCPackGenerator.cxx')
-rw-r--r--Source/CPack/cmCPackGenerator.cxx36
1 files changed, 31 insertions, 5 deletions
diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx
index feda52c..69d9b8c 100644
--- a/Source/CPack/cmCPackGenerator.cxx
+++ b/Source/CPack/cmCPackGenerator.cxx
@@ -684,7 +684,14 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects(
if (componentInstall)
{
tempInstallDirectory += "/";
- tempInstallDirectory += installComponent;
+ // Some CPack generators would rather chose
+ // the local installation directory suffix.
+ // Some (e.g. RPM) use
+ // one install directory for each component **GROUP**
+ // instead of the default
+ // one install directory for each component.
+ tempInstallDirectory +=
+ GetComponentInstallDirNameSuffix(installComponent);
}
if (!setDestDir)
@@ -873,6 +880,12 @@ int cmCPackGenerator::DoPackage()
return 0;
}
+ // Digest Component grouping specification
+ if ( !this->PrepareGroupingKind() )
+ {
+ return 0;
+ }
+
if ( cmSystemTools::IsOn(
this->GetOption("CPACK_REMOVE_TOPLEVEL_DIRECTORY")) )
{
@@ -1251,11 +1264,11 @@ int cmCPackGenerator::PrepareGroupingKind()
cmCPackLogger(cmCPackLog::LOG_VERBOSE, "["
<< this->Name << "]"
<< " requested component grouping = "<< groupingType <<std::endl);
- if (groupingType == "ALL_GROUP_IN_ONE")
+ if (groupingType == "ALL_GROUPS_IN_ONE")
{
allGroupInOne = true;
}
- else if (groupingType == "ALL_COMPONENT_IN_ONE")
+ else if (groupingType == "ALL_COMPONENTS_IN_ONE")
{
allComponentInOne = true;
}
@@ -1268,11 +1281,19 @@ int cmCPackGenerator::PrepareGroupingKind()
cmCPackLogger(cmCPackLog::LOG_WARNING, "["
<< this->Name << "]"
<< " requested component grouping type <"<< groupingType
- << "> UNKNOWN not in (ALL_GROUP_IN_ONE,"
- "ALL_COMPONENT_IN_ONE,IGNORE)" <<std::endl);
+ << "> UNKNOWN not in (ALL_GROUPS_IN_ONE,"
+ "ALL_COMPONENTS_IN_ONE,IGNORE)" <<std::endl);
}
}
+ cmCPackLogger(cmCPackLog::LOG_VERBOSE, "["
+ << this->Name << "]"
+ << " requested component grouping = ("
+ << "ALL_GROUPS_IN_ONE=" << allGroupInOne
+ << ", ALL_COMPONENTS_IN_ONE=" << allComponentInOne
+ << ", IGNORE_GROUPS=" << ignoreComponentGroup
+ << ")"
+ << std::endl);
// Some components were defined but NO group
// force ignoreGroups
if (this->ComponentGroups.empty() && (!this->Components.empty())
@@ -1288,6 +1309,11 @@ int cmCPackGenerator::PrepareGroupingKind()
return 1;
}
+std::string cmCPackGenerator::GetComponentInstallDirNameSuffix(
+ const std::string& componentName) {
+ return componentName;
+}
+
//----------------------------------------------------------------------
bool cmCPackGenerator::SupportsComponentInstallation() const
{