CPack/IFW: Fix generation of ProductImages

Entries of `CPACK_IFW_PACKAGE_PRODUCT_IMAGES` each need their own
`ProductImage element.

Fixes: #26268
This commit is contained in:
Julien Marrec
2024-09-05 16:34:14 +02:00
parent 613a883470
commit 3c214f2638

View File

@@ -615,12 +615,14 @@ void cmCPackIFWInstaller::GenerateInstallerFile()
if (!this->IsVersionLess("4.0") && !this->ProductImages.empty()) {
xout.StartElement("ProductImages");
for (auto const& srcImg : this->ProductImages) {
xout.StartElement("ProductImage");
std::string name = cmSystemTools::GetFilenameName(srcImg);
std::string dstImg = this->Directory + "/config/" + name;
cmsys::SystemTools::CopyFileIfDifferent(srcImg, dstImg);
xout.Element("Image", name);
xout.EndElement(); // </ProductImage>
}
xout.EndElement();
xout.EndElement(); // </ProductImages>
}
// Resources (copy to resources dir)