diff options
author | Pierluigi Taddei <pierluigi.taddei@gmail.com> | 2016-09-15 19:26:52 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2016-09-16 14:29:00 (GMT) |
commit | c2f0f41f6372a6a810f43cab3ebba70261231c70 (patch) | |
tree | 6ff15bbeff65ebd6635d29c090b376406dbf5423 /Source | |
parent | 010140311a0aa9336b7e2a2d22c177d445ee1c32 (diff) | |
download | CMake-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')
-rw-r--r-- | Source/CPack/IFW/cmCPackIFWPackage.cxx | 30 | ||||
-rw-r--r-- | Source/CPack/IFW/cmCPackIFWPackage.h | 3 |
2 files changed, 33 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(); diff --git a/Source/CPack/IFW/cmCPackIFWPackage.h b/Source/CPack/IFW/cmCPackIFWPackage.h index 579eeb8..739ae3e 100644 --- a/Source/CPack/IFW/cmCPackIFWPackage.h +++ b/Source/CPack/IFW/cmCPackIFWPackage.h @@ -99,6 +99,9 @@ public: /// List of license agreements to be accepted by the installing user std::vector<std::string> Licenses; + /// List of pages to load + std::vector<std::string> UserInterfaces; + /// Priority of the component in the tree std::string SortingPriority; |