CPack Add top level directory in component install for Archive Generators
This patch fixes bug #0012129 Signed-off-by: Eric NOULARD <eric.noulard@gmail.com>
This commit is contained in:
parent
50edbf0f22
commit
3cab24a974
|
@ -57,13 +57,20 @@ int cmCPackArchiveGenerator::addOneComponentToArchive(cmArchiveWrite& archive,
|
||||||
std::string dir = cmSystemTools::GetCurrentWorkingDirectory();
|
std::string dir = cmSystemTools::GetCurrentWorkingDirectory();
|
||||||
// Change to local toplevel
|
// Change to local toplevel
|
||||||
cmSystemTools::ChangeDirectory(localToplevel.c_str());
|
cmSystemTools::ChangeDirectory(localToplevel.c_str());
|
||||||
|
std::string filePrefix;
|
||||||
|
if (this->IsOn("CPACK_INCLUDE_TOPLEVEL_DIRECTORY"))
|
||||||
|
{
|
||||||
|
filePrefix = this->GetOption("CPACK_PACKAGE_FILE_NAME");
|
||||||
|
filePrefix += "/";
|
||||||
|
}
|
||||||
std::vector<std::string>::const_iterator fileIt;
|
std::vector<std::string>::const_iterator fileIt;
|
||||||
for (fileIt = component->Files.begin(); fileIt != component->Files.end();
|
for (fileIt = component->Files.begin(); fileIt != component->Files.end();
|
||||||
++fileIt )
|
++fileIt )
|
||||||
{
|
{
|
||||||
|
std::string rp = filePrefix + *fileIt;
|
||||||
cmCPackLogger(cmCPackLog::LOG_DEBUG,"Adding file: "
|
cmCPackLogger(cmCPackLog::LOG_DEBUG,"Adding file: "
|
||||||
<< (*fileIt) << std::endl);
|
<< rp << std::endl);
|
||||||
archive.Add(*fileIt);
|
archive.Add(rp);
|
||||||
if (!archive)
|
if (!archive)
|
||||||
{
|
{
|
||||||
cmCPackLogger(cmCPackLog::LOG_ERROR, "ERROR while packaging files: "
|
cmCPackLogger(cmCPackLog::LOG_ERROR, "ERROR while packaging files: "
|
||||||
|
|
|
@ -691,6 +691,11 @@ 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"))
|
||||||
|
{
|
||||||
|
tempInstallDirectory += "/";
|
||||||
|
tempInstallDirectory += this->GetOption("CPACK_PACKAGE_FILE_NAME");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!setDestDir)
|
if (!setDestDir)
|
||||||
|
|
Loading…
Reference in New Issue