CPackArchive restore default behavior and provide new variable.

CPACK_COMPONENT_INCLUDE_TOPLEVEL_DIRECTORY should be set by the user
in order to get the toplevel directory included in the archive
whenever a componentized archive is requested. This solves bug #12129
and keeps fully backward compatible behavior.
This commit is contained in:
Eric NOULARD 2012-02-01 23:32:50 +01:00
parent 3cab24a974
commit 5d18851b25
2 changed files with 2 additions and 2 deletions

View File

@ -58,7 +58,7 @@ int cmCPackArchiveGenerator::addOneComponentToArchive(cmArchiveWrite& archive,
// Change to local toplevel // Change to local toplevel
cmSystemTools::ChangeDirectory(localToplevel.c_str()); cmSystemTools::ChangeDirectory(localToplevel.c_str());
std::string filePrefix; std::string filePrefix;
if (this->IsOn("CPACK_INCLUDE_TOPLEVEL_DIRECTORY")) if (this->IsOn("CPACK_COMPONENT_INCLUDE_TOPLEVEL_DIRECTORY"))
{ {
filePrefix = this->GetOption("CPACK_PACKAGE_FILE_NAME"); filePrefix = this->GetOption("CPACK_PACKAGE_FILE_NAME");
filePrefix += "/"; filePrefix += "/";

View File

@ -691,7 +691,7 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects(
// one install directory for each component. // one install directory for each component.
tempInstallDirectory += tempInstallDirectory +=
GetComponentInstallDirNameSuffix(installComponent); GetComponentInstallDirNameSuffix(installComponent);
if (this->IsOn("CPACK_INCLUDE_TOPLEVEL_DIRECTORY")) if (this->IsOn("CPACK_COMPONENT_INCLUDE_TOPLEVEL_DIRECTORY"))
{ {
tempInstallDirectory += "/"; tempInstallDirectory += "/";
tempInstallDirectory += this->GetOption("CPACK_PACKAGE_FILE_NAME"); tempInstallDirectory += this->GetOption("CPACK_PACKAGE_FILE_NAME");