CPackIFW: Add support for ProductImages config option

This commit is contained in:
Erlend E. Aasland
2021-10-07 23:31:03 +02:00
parent 3068ea834f
commit 6d39c845ee
4 changed files with 38 additions and 0 deletions
+19
View File
@@ -275,6 +275,13 @@ void cmCPackIFWInstaller::ConfigureFromOptions()
this->Resources.clear();
cmExpandList(optIFW_PACKAGE_RESOURCES, this->Resources);
}
// ProductImages
if (cmValue productImages =
this->GetOption("CPACK_IFW_PACKAGE_PRODUCT_IMAGES")) {
this->ProductImages.clear();
cmExpandList(productImages, this->ProductImages);
}
}
/** \class cmCPackIFWResourcesParser
@@ -508,6 +515,18 @@ void cmCPackIFWInstaller::GenerateInstallerFile()
xout.Element("ControlScript", name);
}
// Product images (copy to config dir)
if (!this->IsVersionLess("4.0") && !this->ProductImages.empty()) {
xout.StartElement("ProductImages");
for (auto const& srcImg : this->ProductImages) {
std::string name = cmSystemTools::GetFilenameName(srcImg);
std::string dstImg = this->Directory + "/config/" + name;
cmsys::SystemTools::CopyFileIfDifferent(srcImg, dstImg);
xout.Element("Image", name);
}
xout.EndElement();
}
// Resources (copy to resources dir)
if (!this->Resources.empty()) {
std::vector<std::string> resources;
+3
View File
@@ -118,6 +118,9 @@ public:
/// List of resources to include in the installer binary
std::vector<std::string> Resources;
/// A list of images to be shown on PerformInstallationPage.
std::vector<std::string> ProductImages;
public:
// Internal implementation