summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorDavid Cole <david.cole@kitware.com>2012-02-07 20:34:39 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2012-02-07 20:34:39 (GMT)
commita3e791389735224426de524db2af938602201395 (patch)
tree098cd861d9d03de8d56693f8c8b0b51de74a63a2 /Source
parent38e6757cd3192b4c6048409feada7a8c397504cf (diff)
parent5d18851b25af4f363d72371a5a6492741436eb37 (diff)
downloadCMake-a3e791389735224426de524db2af938602201395.zip
CMake-a3e791389735224426de524db2af938602201395.tar.gz
CMake-a3e791389735224426de524db2af938602201395.tar.bz2
Merge topic 'AddTopLevelForComponent'
5d18851 CPackArchive restore default behavior and provide new variable. 3cab24a CPack Add top level directory in component install for Archive Generators
Diffstat (limited to 'Source')
-rw-r--r--Source/CPack/cmCPackArchiveGenerator.cxx11
-rw-r--r--Source/CPack/cmCPackGenerator.cxx5
2 files changed, 14 insertions, 2 deletions
diff --git a/Source/CPack/cmCPackArchiveGenerator.cxx b/Source/CPack/cmCPackArchiveGenerator.cxx
index 0ce5b01..0ff9050 100644
--- a/Source/CPack/cmCPackArchiveGenerator.cxx
+++ b/Source/CPack/cmCPackArchiveGenerator.cxx
@@ -57,13 +57,20 @@ int cmCPackArchiveGenerator::addOneComponentToArchive(cmArchiveWrite& archive,
std::string dir = cmSystemTools::GetCurrentWorkingDirectory();
// Change to local toplevel
cmSystemTools::ChangeDirectory(localToplevel.c_str());
+ std::string filePrefix;
+ if (this->IsOn("CPACK_COMPONENT_INCLUDE_TOPLEVEL_DIRECTORY"))
+ {
+ filePrefix = this->GetOption("CPACK_PACKAGE_FILE_NAME");
+ filePrefix += "/";
+ }
std::vector<std::string>::const_iterator fileIt;
for (fileIt = component->Files.begin(); fileIt != component->Files.end();
++fileIt )
{
+ std::string rp = filePrefix + *fileIt;
cmCPackLogger(cmCPackLog::LOG_DEBUG,"Adding file: "
- << (*fileIt) << std::endl);
- archive.Add(*fileIt);
+ << rp << std::endl);
+ archive.Add(rp);
if (!archive)
{
cmCPackLogger(cmCPackLog::LOG_ERROR, "ERROR while packaging files: "
diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx
index 083279f..f7d8a4d 100644
--- a/Source/CPack/cmCPackGenerator.cxx
+++ b/Source/CPack/cmCPackGenerator.cxx
@@ -691,6 +691,11 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects(
// one install directory for each component.
tempInstallDirectory +=
GetComponentInstallDirNameSuffix(installComponent);
+ if (this->IsOn("CPACK_COMPONENT_INCLUDE_TOPLEVEL_DIRECTORY"))
+ {
+ tempInstallDirectory += "/";
+ tempInstallDirectory += this->GetOption("CPACK_PACKAGE_FILE_NAME");
+ }
}
if (!setDestDir)