summaryrefslogtreecommitdiffstats
path: root/Source/CPack/cmCPackArchiveGenerator.cxx
diff options
context:
space:
mode:
authorEric NOULARD <eric.noulard@gmail.com>2011-03-03 20:19:13 (GMT)
committerEric NOULARD <eric.noulard@gmail.com>2011-03-03 20:19:13 (GMT)
commitfe530ff5e90f8eada47b4480375b9898f018eefc (patch)
treec54a0d1439dd37583f10d922b7641d55e6ddfc65 /Source/CPack/cmCPackArchiveGenerator.cxx
parentcbb5ae60be15738a4d6db4607466346153c3dbba (diff)
downloadCMake-fe530ff5e90f8eada47b4480375b9898f018eefc.zip
CMake-fe530ff5e90f8eada47b4480375b9898f018eefc.tar.gz
CMake-fe530ff5e90f8eada47b4480375b9898f018eefc.tar.bz2
CPackArchive package all components specified in CPACK_COMPONENTS_ALL
When asking for group packaging the components not belonging to any group should be packaged separately.
Diffstat (limited to 'Source/CPack/cmCPackArchiveGenerator.cxx')
-rw-r--r--Source/CPack/cmCPackArchiveGenerator.cxx33
1 files changed, 33 insertions, 0 deletions
diff --git a/Source/CPack/cmCPackArchiveGenerator.cxx b/Source/CPack/cmCPackArchiveGenerator.cxx
index 3c670a1..b629c63 100644
--- a/Source/CPack/cmCPackArchiveGenerator.cxx
+++ b/Source/CPack/cmCPackArchiveGenerator.cxx
@@ -143,6 +143,39 @@ int cmCPackArchiveGenerator::PackageComponents(bool ignoreGroup)
// add the generated package to package file names list
packageFileNames.push_back(packageFileName);
}
+ // Handle Orphan components (components not belonging to any groups)
+ std::map<std::string, cmCPackComponent>::iterator compIt;
+ for (compIt=this->Components.begin();
+ compIt!=this->Components.end(); ++compIt )
+ {
+ // Does the component belong to a group?
+ if (compIt->second.Group==NULL)
+ {
+ cmCPackLogger(cmCPackLog::LOG_VERBOSE,
+ "Component <"
+ << compIt->second.Name
+ << "> does not belong to any group, package it separately."
+ << std::endl);
+ std::string localToplevel(
+ this->GetOption("CPACK_TEMPORARY_DIRECTORY")
+ );
+ std::string packageFileName = std::string(toplevel);
+
+ localToplevel += "/"+ compIt->first;
+ packageFileName += "/"+
+ GetComponentPackageFileName(this->GetOption("CPACK_PACKAGE_FILE_NAME"),
+ compIt->first,
+ false)
+ + this->GetOutputExtension();
+ {
+ DECLARE_AND_OPEN_ARCHIVE(packageFileName,archive);
+ // Add the files of this component to the archive
+ addOneComponentToArchive(archive,&(compIt->second));
+ }
+ // add the generated package to package file names list
+ packageFileNames.push_back(packageFileName);
+ }
+ }
}
// CPACK_COMPONENTS_IGNORE_GROUPS is set
// We build 1 package per component