summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorJulien Marrec <julien.marrec@gmail.com>2024-09-05 14:58:05 (GMT)
committerBrad King <brad.king@kitware.com>2024-09-11 12:10:52 (GMT)
commitd58f90f628ebae57de7c7709fe30869a03489063 (patch)
tree37ca708c6462644bd348d1192d14224647407da7 /Source
parent3c214f2638a58e1e97eab4069039a5d5d228bdf6 (diff)
downloadCMake-d58f90f628ebae57de7c7709fe30869a03489063.zip
CMake-d58f90f628ebae57de7c7709fe30869a03489063.tar.gz
CMake-d58f90f628ebae57de7c7709fe30869a03489063.tar.bz2
CPack/IFW: Actually ignore missing ProductImages
Diffstat (limited to 'Source')
-rw-r--r--Source/CPack/IFW/cmCPackIFWInstaller.cxx15
1 files 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 <algorithm>
#include <cstddef>
#include <sstream>
#include <utility>
@@ -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