summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Modules/CPackWIX.cmake3
-rw-r--r--Source/CPack/WiX/cmCPackWIXGenerator.cxx11
-rw-r--r--Source/CPack/WiX/cmWIXPatch.cxx12
-rw-r--r--Source/CPack/WiX/cmWIXPatch.h2
4 files changed, 23 insertions, 5 deletions
diff --git a/Modules/CPackWIX.cmake b/Modules/CPackWIX.cmake
index bef8e16..4994005 100644
--- a/Modules/CPackWIX.cmake
+++ b/Modules/CPackWIX.cmake
@@ -119,7 +119,8 @@
#
# .. variable:: CPACK_WIX_PATCH_FILE
#
-# Optional XML file with fragments to be inserted into generated WiX sources
+# Optional list of XML files with fragments to be inserted into
+# generated WiX sources
#
# This optional variable can be used to specify an XML file that the
# WiX generator will use to inject fragments into its generated
diff --git a/Source/CPack/WiX/cmCPackWIXGenerator.cxx b/Source/CPack/WiX/cmCPackWIXGenerator.cxx
index b55c5a5..ece327a 100644
--- a/Source/CPack/WiX/cmCPackWIXGenerator.cxx
+++ b/Source/CPack/WiX/cmCPackWIXGenerator.cxx
@@ -242,7 +242,16 @@ bool cmCPackWIXGenerator::InitializeWiXConfiguration()
const char* patchFilePath = GetOption("CPACK_WIX_PATCH_FILE");
if(patchFilePath)
{
- this->Patch->LoadFragments(patchFilePath);
+ std::vector<std::string> patchFilePaths;
+ cmSystemTools::ExpandListArgument(patchFilePath, patchFilePaths);
+
+ for(size_t i = 0; i < patchFilePaths.size(); ++i)
+ {
+ if(!this->Patch->LoadFragments(patchFilePaths[i]))
+ {
+ return false;
+ }
+ }
}
return true;
diff --git a/Source/CPack/WiX/cmWIXPatch.cxx b/Source/CPack/WiX/cmWIXPatch.cxx
index 471c3a4..07375da 100644
--- a/Source/CPack/WiX/cmWIXPatch.cxx
+++ b/Source/CPack/WiX/cmWIXPatch.cxx
@@ -20,10 +20,18 @@ cmWIXPatch::cmWIXPatch(cmCPackLog* logger):
}
-void cmWIXPatch::LoadFragments(std::string const& patchFilePath)
+bool cmWIXPatch::LoadFragments(std::string const& patchFilePath)
{
cmWIXPatchParser parser(Fragments, Logger);
- parser.ParseFile(patchFilePath.c_str());
+ if(!parser.ParseFile(patchFilePath.c_str()))
+ {
+ cmCPackLogger(cmCPackLog::LOG_ERROR,
+ "Failed parsing XML patch file: '" <<
+ patchFilePath << "'" << std::endl);
+ return false;
+ }
+
+ return true;
}
void cmWIXPatch::ApplyFragment(
diff --git a/Source/CPack/WiX/cmWIXPatch.h b/Source/CPack/WiX/cmWIXPatch.h
index d53fcb4..2f31a01 100644
--- a/Source/CPack/WiX/cmWIXPatch.h
+++ b/Source/CPack/WiX/cmWIXPatch.h
@@ -26,7 +26,7 @@ class cmWIXPatch
public:
cmWIXPatch(cmCPackLog* logger);
- void LoadFragments(std::string const& patchFilePath);
+ bool LoadFragments(std::string const& patchFilePath);
void ApplyFragment(std::string const& id, cmWIXSourceWriter& writer);