diff options
author | Brad King <brad.king@kitware.com> | 2013-10-15 09:33:22 -0400 |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2013-10-15 09:33:22 -0400 |
commit | 69fd12583c18e42338aabfa67cd1791571a2c86e (patch) | |
tree | 0dd785b7eb64873a740bad39f38468c9b64d8b09 /Source/CPack/WiX | |
parent | cd36929c278d69c00850144932d931676ed5f889 (diff) | |
parent | 2e6cadde13690a80bc3919cec00e802208367f32 (diff) | |
download | cmake-69fd12583c18e42338aabfa67cd1791571a2c86e.tar.gz |
Merge topic 'wix-extra-sources'
2e6cadd CPackWiX: allow user supplied extra sources, objects and libraries
Diffstat (limited to 'Source/CPack/WiX')
-rw-r--r-- | Source/CPack/WiX/cmCPackWIXGenerator.cxx | 28 | ||||
-rw-r--r-- | Source/CPack/WiX/cmCPackWIXGenerator.h | 4 |
2 files changed, 32 insertions, 0 deletions
diff --git a/Source/CPack/WiX/cmCPackWIXGenerator.cxx b/Source/CPack/WiX/cmCPackWIXGenerator.cxx index b9af052f34..725810bc69 100644 --- a/Source/CPack/WiX/cmCPackWIXGenerator.cxx +++ b/Source/CPack/WiX/cmCPackWIXGenerator.cxx @@ -190,6 +190,8 @@ bool cmCPackWIXGenerator::PackageFilesImpl() return false; } + AppendUserSuppliedExtraSources(); + std::stringstream objectFiles; for(size_t i = 0; i < wixSources.size(); ++i) { @@ -206,9 +208,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 1380a171c7..eac69feffa 100644 --- a/Source/CPack/WiX/cmCPackWIXGenerator.h +++ b/Source/CPack/WiX/cmCPackWIXGenerator.h @@ -71,6 +71,10 @@ private: bool CreateWiXSourceFiles(); + void AppendUserSuppliedExtraSources(); + + void AppendUserSuppliedExtraObjects(std::ostream& stream); + bool CreateLicenseFile(); bool RunWiXCommand(const std::string& command); |