CPackWiX: allow user supplied extra sources, objects and libraries
This commit is contained in:
parent
de94782bc5
commit
2e6cadde13
@ -102,6 +102,20 @@
|
|||||||
# If this variable is not set, the default MSI template included with CMake will be used.
|
# If this variable is not set, the default MSI template included with CMake will be used.
|
||||||
#
|
#
|
||||||
##end
|
##end
|
||||||
|
##variable
|
||||||
|
# CPACK_WIX_EXTRA_SOURCES - Extra WiX source files
|
||||||
|
#
|
||||||
|
# This variable provides an optional list of extra WiX source files (.wxs)
|
||||||
|
# that should be compiled and linked. The full path to source files is required.
|
||||||
|
#
|
||||||
|
##end
|
||||||
|
##variable
|
||||||
|
# CPACK_WIX_EXTRA_OBJECTS - Extra WiX object files or libraries
|
||||||
|
#
|
||||||
|
# This variable provides an optional list of extra WiX object (.wixobj) and/or
|
||||||
|
# WiX library (.wixlib) files. The full path to objects and libraries is required.
|
||||||
|
#
|
||||||
|
##end
|
||||||
|
|
||||||
#=============================================================================
|
#=============================================================================
|
||||||
# Copyright 2012 Kitware, Inc.
|
# Copyright 2012 Kitware, Inc.
|
||||||
|
@ -189,6 +189,8 @@ bool cmCPackWIXGenerator::PackageFilesImpl()
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
AppendUserSuppliedExtraSources();
|
||||||
|
|
||||||
std::stringstream objectFiles;
|
std::stringstream objectFiles;
|
||||||
for(size_t i = 0; i < wixSources.size(); ++i)
|
for(size_t i = 0; i < wixSources.size(); ++i)
|
||||||
{
|
{
|
||||||
@ -205,9 +207,35 @@ bool cmCPackWIXGenerator::PackageFilesImpl()
|
|||||||
objectFiles << " " << QuotePath(objectFilename);
|
objectFiles << " " << QuotePath(objectFilename);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
AppendUserSuppliedExtraObjects(objectFiles);
|
||||||
|
|
||||||
return RunLightCommand(objectFiles.str());
|
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()
|
bool cmCPackWIXGenerator::CreateWiXVariablesIncludeFile()
|
||||||
{
|
{
|
||||||
std::string cpackTopLevel;
|
std::string cpackTopLevel;
|
||||||
|
@ -68,6 +68,10 @@ private:
|
|||||||
|
|
||||||
bool CreateWiXSourceFiles();
|
bool CreateWiXSourceFiles();
|
||||||
|
|
||||||
|
void AppendUserSuppliedExtraSources();
|
||||||
|
|
||||||
|
void AppendUserSuppliedExtraObjects(std::ostream& stream);
|
||||||
|
|
||||||
bool CreateLicenseFile();
|
bool CreateLicenseFile();
|
||||||
|
|
||||||
bool RunWiXCommand(const std::string& command);
|
bool RunWiXCommand(const std::string& command);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user