diff options
author | Brad King <brad.king@kitware.com> | 2011-03-08 19:22:24 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2011-03-08 19:22:24 (GMT) |
commit | 9c1344f33bde890f7cec13962f477a914ae716c5 (patch) | |
tree | 9e87277cf2d4fe86e8b7f5aa90d1b03a0c7c7eda | |
parent | 27b41deaed762621a0dcff31c5cce5cc7c5624c8 (diff) | |
parent | fe530ff5e90f8eada47b4480375b9898f018eefc (diff) | |
download | CMake-9c1344f33bde890f7cec13962f477a914ae716c5.zip CMake-9c1344f33bde890f7cec13962f477a914ae716c5.tar.gz CMake-9c1344f33bde890f7cec13962f477a914ae716c5.tar.bz2 |
Merge topic 'CPackArchive-PackageOrphanComponents'
fe530ff CPackArchive package all components specified in CPACK_COMPONENTS_ALL
-rw-r--r-- | Source/CPack/cmCPackArchiveGenerator.cxx | 33 | ||||
-rw-r--r-- | Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake | 2 |
2 files changed, 34 insertions, 1 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 diff --git a/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake b/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake index 45a3b17..e797b7c 100644 --- a/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake +++ b/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake @@ -39,7 +39,7 @@ if(CPackGen MATCHES "ZIP") set(expected_count 1) endif(${CPackComponentWay} STREQUAL "default") if (${CPackComponentWay} STREQUAL "OnePackPerGroup") - set(expected_count 2) + set(expected_count 3) endif (${CPackComponentWay} STREQUAL "OnePackPerGroup") if (${CPackComponentWay} STREQUAL "IgnoreGroup") set(expected_count 4) |