summaryrefslogtreecommitdiff
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2022-03-28 14:53:02 +0000
committerKitware Robot <kwrobot@kitware.com>2022-03-28 10:53:14 -0400
commit9f1cbddad6859645cd716d6b8e8dc8c8c440e777 (patch)
treee421f2d9d5e4d5c1048040fee08cfa32f7cdd614 /Source
parent13f1c2a81a4af0009f5f611b9f23a45189e4a23d (diff)
parente41f1ef6ff732bb8f9745359c893ec093438419e (diff)
downloadcmake-9f1cbddad6859645cd716d6b8e8dc8c8c440e777.tar.gz
Merge topic 'cpack-ifw-validate-input'
e41f1ef6ff CPack/IFW: Add missing referenced source file validation Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: buildbot <buildbot@kitware.com> Acked-by: Konstantin Podsvirov <konstantin@podsvirov.pro> Merge-request: !7116
Diffstat (limited to 'Source')
-rw-r--r--Source/CPack/IFW/cmCPackIFWInstaller.cxx24
1 files changed, 22 insertions, 2 deletions
diff --git a/Source/CPack/IFW/cmCPackIFWInstaller.cxx b/Source/CPack/IFW/cmCPackIFWInstaller.cxx
index 6fc48480ef..92ff6df3b0 100644
--- a/Source/CPack/IFW/cmCPackIFWInstaller.cxx
+++ b/Source/CPack/IFW/cmCPackIFWInstaller.cxx
@@ -26,7 +26,7 @@ void cmCPackIFWInstaller::printSkippedOptionWarning(
cmCPackIFWLogger(
WARNING,
"Option "
- << optionName << " is set to \"" << optionValue
+ << optionName << " contains the value \"" << optionValue
<< "\" but will be skipped because the specified file does not exist."
<< std::endl);
}
@@ -276,7 +276,12 @@ void cmCPackIFWInstaller::ConfigureFromOptions()
// Control script
if (cmValue optIFW_CONTROL_SCRIPT =
this->GetOption("CPACK_IFW_PACKAGE_CONTROL_SCRIPT")) {
- this->ControlScript = *optIFW_CONTROL_SCRIPT;
+ if (!cmSystemTools::FileExists(optIFW_CONTROL_SCRIPT)) {
+ this->printSkippedOptionWarning("CPACK_IFW_PACKAGE_CONTROL_SCRIPT",
+ optIFW_CONTROL_SCRIPT);
+ } else {
+ this->ControlScript = *optIFW_CONTROL_SCRIPT;
+ }
}
// Resources
@@ -284,6 +289,13 @@ void cmCPackIFWInstaller::ConfigureFromOptions()
this->GetOption("CPACK_IFW_PACKAGE_RESOURCES")) {
this->Resources.clear();
cmExpandList(optIFW_PACKAGE_RESOURCES, this->Resources);
+ for (const auto& file : this->Resources) {
+ 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_RESOURCES", file);
+ }
+ }
}
// ProductImages
@@ -291,6 +303,14 @@ void cmCPackIFWInstaller::ConfigureFromOptions()
this->GetOption("CPACK_IFW_PACKAGE_PRODUCT_IMAGES")) {
this->ProductImages.clear();
cmExpandList(productImages, this->ProductImages);
+ for (const auto& file : this->ProductImages) {
+ 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);
+ }
+ }
}
// Run program, run program arguments, and run program description