summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorNils Gladitz <nilsgladitz@gmail.com>2013-10-13 11:16:54 (GMT)
committerNils Gladitz <nilsgladitz@gmail.com>2013-10-13 11:16:54 (GMT)
commit2e6cadde13690a80bc3919cec00e802208367f32 (patch)
tree4d371644cff370f825294a740b53cf9bd2077e5c /Source
parentde94782bc503742e1fddcf1d465f8fb3d6acb343 (diff)
downloadCMake-2e6cadde13690a80bc3919cec00e802208367f32.zip
CMake-2e6cadde13690a80bc3919cec00e802208367f32.tar.gz
CMake-2e6cadde13690a80bc3919cec00e802208367f32.tar.bz2
CPackWiX: allow user supplied extra sources, objects and libraries
Diffstat (limited to 'Source')
-rw-r--r--Source/CPack/WiX/cmCPackWIXGenerator.cxx28
-rw-r--r--Source/CPack/WiX/cmCPackWIXGenerator.h4
2 files changed, 32 insertions, 0 deletions
diff --git a/Source/CPack/WiX/cmCPackWIXGenerator.cxx b/Source/CPack/WiX/cmCPackWIXGenerator.cxx
index cc9dec7..888c29b 100644
--- a/Source/CPack/WiX/cmCPackWIXGenerator.cxx
+++ b/Source/CPack/WiX/cmCPackWIXGenerator.cxx
@@ -189,6 +189,8 @@ bool cmCPackWIXGenerator::PackageFilesImpl()
return false;
}
+ AppendUserSuppliedExtraSources();
+
std::stringstream objectFiles;
for(size_t i = 0; i < wixSources.size(); ++i)
{
@@ -205,9 +207,35 @@ bool cmCPackWIXGenerator::PackageFilesImpl()
objectFiles << " " << QuotePath(objectFilename);
}
+ AppendUserSuppliedExtraObjects(objectFiles);
+
return RunLightCommand(objectFiles.str());
}
+void cmCPackWIXGenerator::AppendUserSuppliedExtraSources()
+{
+ const char *cpackWixExtraSources = GetOption("CPACK_WIX_EXTRA_SOURCES");
+ if(!cpackWixExtraSources) return;
+
+ cmSystemTools::ExpandListArgument(cpackWixExtraSources, wixSources);
+}
+
+void cmCPackWIXGenerator::AppendUserSuppliedExtraObjects(std::ostream& stream)
+{
+ const char *cpackWixExtraObjects = GetOption("CPACK_WIX_EXTRA_OBJECTS");
+ if(!cpackWixExtraObjects) return;
+
+ std::vector<std::string> expandedExtraObjects;
+
+ cmSystemTools::ExpandListArgument(
+ cpackWixExtraObjects, expandedExtraObjects);
+
+ for(size_t i = 0; i < expandedExtraObjects.size(); ++i)
+ {
+ stream << " " << QuotePath(expandedExtraObjects[i]);
+ }
+}
+
bool cmCPackWIXGenerator::CreateWiXVariablesIncludeFile()
{
std::string cpackTopLevel;
diff --git a/Source/CPack/WiX/cmCPackWIXGenerator.h b/Source/CPack/WiX/cmCPackWIXGenerator.h
index aaccf9d..d6376cf 100644
--- a/Source/CPack/WiX/cmCPackWIXGenerator.h
+++ b/Source/CPack/WiX/cmCPackWIXGenerator.h
@@ -68,6 +68,10 @@ private:
bool CreateWiXSourceFiles();
+ void AppendUserSuppliedExtraSources();
+
+ void AppendUserSuppliedExtraObjects(std::ostream& stream);
+
bool CreateLicenseFile();
bool RunWiXCommand(const std::string& command);