From d58f90f628ebae57de7c7709fe30869a03489063 Mon Sep 17 00:00:00 2001 From: Julien Marrec Date: Thu, 5 Sep 2024 16:58:05 +0200 Subject: CPack/IFW: Actually ignore missing ProductImages --- Source/CPack/IFW/cmCPackIFWInstaller.cxx | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/Source/CPack/IFW/cmCPackIFWInstaller.cxx b/Source/CPack/IFW/cmCPackIFWInstaller.cxx index 9cfaa22..e729538 100644 --- a/Source/CPack/IFW/cmCPackIFWInstaller.cxx +++ b/Source/CPack/IFW/cmCPackIFWInstaller.cxx @@ -2,6 +2,7 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmCPackIFWInstaller.h" +#include #include #include #include @@ -306,14 +307,20 @@ void cmCPackIFWInstaller::ConfigureFromOptions() this->GetOption("CPACK_IFW_PACKAGE_PRODUCT_IMAGES")) { this->ProductImages.clear(); cmExpandList(productImages, this->ProductImages); - for (const auto& file : this->ProductImages) { + + auto erase_missing_file_pred = [this](const std::string& file) -> bool { if (!cmSystemTools::FileExists(file)) { - // The warning will say skipped, but there will later be a hard error - // when the binarycreator tool tries to read the missing file. this->printSkippedOptionWarning("CPACK_IFW_PACKAGE_PRODUCT_IMAGES", file); + return true; } - } + return false; + }; + + this->ProductImages.erase(std::remove_if(this->ProductImages.begin(), + this->ProductImages.end(), + erase_missing_file_pred), + this->ProductImages.end()); } // Run program, run program arguments, and run program description -- cgit v0.12