From 6d39c845eece813870e065802b4fd9b05ab212d9 Mon Sep 17 00:00:00 2001 From: "Erlend E. Aasland" Date: Thu, 7 Oct 2021 23:31:03 +0200 Subject: CPackIFW: Add support for ProductImages config option --- Help/cpack_gen/ifw.rst | 8 ++++++++ Help/release/dev/cpackifw-package-product-images.rst | 8 ++++++++ Source/CPack/IFW/cmCPackIFWInstaller.cxx | 19 +++++++++++++++++++ Source/CPack/IFW/cmCPackIFWInstaller.h | 3 +++ 4 files changed, 38 insertions(+) create mode 100644 Help/release/dev/cpackifw-package-product-images.rst diff --git a/Help/cpack_gen/ifw.rst b/Help/cpack_gen/ifw.rst index 6817eac..9ee6fbe 100644 --- a/Help/cpack_gen/ifw.rst +++ b/Help/cpack_gen/ifw.rst @@ -248,6 +248,14 @@ Package By default is ``OFF`` or used value from ``CPACK_DOWNLOAD_ALL`` if set +.. variable:: CPACK_IFW_PACKAGE_PRODUCT_IMAGES + + .. versionadded:: 3.23 + + A list of images to be shown on the ``PerformInstallationPage``. + + This feature is available for QtIFW 4.0.0 or newer. + Components """""""""" diff --git a/Help/release/dev/cpackifw-package-product-images.rst b/Help/release/dev/cpackifw-package-product-images.rst new file mode 100644 index 0000000..3a02534 --- /dev/null +++ b/Help/release/dev/cpackifw-package-product-images.rst @@ -0,0 +1,8 @@ + +cpackifw-package-product-images +------------------------------- + +* The :cpack_gen:`CPack IFW Generator` gained the new + :variable:`CPACK_IFW_PACKAGE_PRODUCT_IMAGES` variable for adding a list of + images to be shown on the ``PerformInstallationPage``. + This feature is available for QtIFW 4.0 and newer. diff --git a/Source/CPack/IFW/cmCPackIFWInstaller.cxx b/Source/CPack/IFW/cmCPackIFWInstaller.cxx index 7ee6300..2442c4f 100644 --- a/Source/CPack/IFW/cmCPackIFWInstaller.cxx +++ b/Source/CPack/IFW/cmCPackIFWInstaller.cxx @@ -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 resources; diff --git a/Source/CPack/IFW/cmCPackIFWInstaller.h b/Source/CPack/IFW/cmCPackIFWInstaller.h index a031fc2..ad2d472 100644 --- a/Source/CPack/IFW/cmCPackIFWInstaller.h +++ b/Source/CPack/IFW/cmCPackIFWInstaller.h @@ -118,6 +118,9 @@ public: /// List of resources to include in the installer binary std::vector Resources; + /// A list of images to be shown on PerformInstallationPage. + std::vector ProductImages; + public: // Internal implementation -- cgit v0.12