summaryrefslogtreecommitdiffstats
path: root/Source/CPack/IFW/cmCPackIFWPackage.cxx
diff options
context:
space:
mode:
authorPierluigi Taddei <pierluigi.taddei@gmail.com>2016-09-15 19:26:52 (GMT)
committerBrad King <brad.king@kitware.com>2016-09-16 14:29:00 (GMT)
commitc2f0f41f6372a6a810f43cab3ebba70261231c70 (patch)
tree6ff15bbeff65ebd6635d29c090b376406dbf5423 /Source/CPack/IFW/cmCPackIFWPackage.cxx
parent010140311a0aa9336b7e2a2d22c177d445ee1c32 (diff)
downloadCMake-c2f0f41f6372a6a810f43cab3ebba70261231c70.zip
CMake-c2f0f41f6372a6a810f43cab3ebba70261231c70.tar.gz
CMake-c2f0f41f6372a6a810f43cab3ebba70261231c70.tar.bz2
CPackIFW: Add USER_INTERFACES option
Add to CPackIFW the capability of accepting a list of USER_INTERFACES that are copied to the meta folder and added to the component description.
Diffstat (limited to 'Source/CPack/IFW/cmCPackIFWPackage.cxx')
-rw-r--r--Source/CPack/IFW/cmCPackIFWPackage.cxx30
1 files changed, 30 insertions, 0 deletions
diff --git a/Source/CPack/IFW/cmCPackIFWPackage.cxx b/Source/CPack/IFW/cmCPackIFWPackage.cxx
index bc503fc..2d3cf12 100644
--- a/Source/CPack/IFW/cmCPackIFWPackage.cxx
+++ b/Source/CPack/IFW/cmCPackIFWPackage.cxx
@@ -153,6 +153,7 @@ void cmCPackIFWPackage::DefaultConfiguration()
ReleaseDate = "";
Script = "";
Licenses.clear();
+ UserInterfaces.clear();
SortingPriority = "";
Default = "";
Essential = "";
@@ -229,6 +230,12 @@ int cmCPackIFWPackage::ConfigureFromComponent(cmCPackComponent* component)
Script = option;
}
+ // User interfaces
+ if (const char* option = this->GetOption(prefix + "USER_INTERFACES")) {
+ UserInterfaces.clear();
+ cmSystemTools::ExpandListArgument(option, UserInterfaces);
+ }
+
// CMake dependencies
if (!component->Dependencies.empty()) {
std::vector<cmCPackComponent*>::iterator dit;
@@ -322,6 +329,12 @@ int cmCPackIFWPackage::ConfigureFromGroup(cmCPackComponentGroup* group)
Script = option;
}
+ // User interfaces
+ if (const char* option = this->GetOption(prefix + "USER_INTERFACES")) {
+ UserInterfaces.clear();
+ cmSystemTools::ExpandListArgument(option, UserInterfaces);
+ }
+
// Licenses
if (const char* option = this->GetOption(prefix + "LICENSES")) {
Licenses.clear();
@@ -417,6 +430,23 @@ void cmCPackIFWPackage::GeneratePackageFile()
xout.Element("Script", name);
}
+ // User Interfaces (copy to meta dir)
+ std::vector<std::string> userInterfaces = UserInterfaces;
+ for (size_t i = 0; i < userInterfaces.size(); i++) {
+ std::string name = cmSystemTools::GetFilenameName(userInterfaces[i]);
+ std::string path = Directory + "/meta/" + name;
+ cmsys::SystemTools::CopyFileIfDifferent(userInterfaces[i].data(),
+ path.data());
+ userInterfaces[i] = name;
+ }
+ if (!userInterfaces.empty()) {
+ xout.StartElement("UserInterfaces");
+ for (size_t i = 0; i < userInterfaces.size(); i++) {
+ xout.Element("UserInterface", userInterfaces[i]);
+ }
+ xout.EndElement();
+ }
+
// Dependencies
std::set<DependenceStruct> compDepSet;
for (std::set<DependenceStruct*>::iterator ait = AlienDependencies.begin();