summaryrefslogtreecommitdiffstats
path: root/qmake/generators/win32/msbuild_objectmodel.cpp
diff options
context:
space:
mode:
authorAndrew Knight <andrew.knight@digia.com>2014-02-11 13:49:18 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-02-11 14:52:16 +0100
commitb4fe9ce225869917c4e822f936596563d7593480 (patch)
tree016ea7839f84c8371fc78ecd2f77504c8e7bf454 /qmake/generators/win32/msbuild_objectmodel.cpp
parent49df5fc3d22669e8c534fc9985e9f4e09f8b2f62 (diff)
qmake: Provide feature for windeployqt
windeployqt is a tool that aids in the deployment of Qt libraries and other files on Windows. This feature (CONFIG+=windeployqt) adds automatic invocation of windeployqt for qmake projects as a post-link action. For Visual Studio projects, windeployqt is added as a custom target which runs after linking, automatically adding the output as deployment items. Task-number: QTBUG-35630 Change-Id: I4cdcb1a7f70cedccb4a4e17be5eb9f5de35a4d66 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Diffstat (limited to 'qmake/generators/win32/msbuild_objectmodel.cpp')
-rw-r--r--qmake/generators/win32/msbuild_objectmodel.cpp40
1 files changed, 40 insertions, 0 deletions
diff --git a/qmake/generators/win32/msbuild_objectmodel.cpp b/qmake/generators/win32/msbuild_objectmodel.cpp
index 75d3c4fa9c..2eac5c1a55 100644
--- a/qmake/generators/win32/msbuild_objectmodel.cpp
+++ b/qmake/generators/win32/msbuild_objectmodel.cpp
@@ -774,6 +774,10 @@ void VCXProjectWriter::write(XmlOutput &xml, VCProject &tool)
write(xml, config.preLink);
xml << closetag();
+
+ // windeployqt
+ if (!config.windeployqt.ExcludedFromBuild)
+ write(xml, config.windeployqt);
}
// The file filters are added in a separate file for MSBUILD.
@@ -1720,6 +1724,42 @@ void VCXProjectWriter::write(XmlOutput &xml, const VCDeploymentTool &tool)
// SmartDevice deployment not supported in VS 2010
}
+void VCXProjectWriter::write(XmlOutput &xml, const VCWinDeployQtTool &tool)
+{
+ const QString name = QStringLiteral("WinDeployQt_") + tool.config->Name;
+ xml << tag("Target")
+ << attrTag(_Name, name)
+ << attrTag("Condition", generateCondition(*tool.config))
+ << attrTag("Inputs", "$(OutDir)\\$(TargetName).exe")
+ << attrTag("Outputs", tool.Record)
+ << tag(_Message)
+ << attrTag("Text", tool.CommandLine)
+ << closetag()
+ << tag("Exec")
+ << attrTag("Command", tool.CommandLine)
+ << closetag()
+ << closetag()
+ << tag("Target")
+ << attrTag(_Name, QStringLiteral("PopulateWinDeployQtItems_") + tool.config->Name)
+ << attrTag("Condition", generateCondition(*tool.config))
+ << attrTag("AfterTargets", "Link")
+ << attrTag("DependsOnTargets", name)
+ << tag("ReadLinesFromFile")
+ << attrTag("File", tool.Record)
+ << tag("Output")
+ << attrTag("TaskParameter", "Lines")
+ << attrTag("ItemName", "DeploymentItems")
+ << closetag()
+ << closetag()
+ << tag(_ItemGroup)
+ << tag("None")
+ << attrTag("Include", "@(DeploymentItems)")
+ << attrTagT("DeploymentContent", _True)
+ << closetag()
+ << closetag()
+ << closetag();
+}
+
void VCXProjectWriter::write(XmlOutput &xml, const VCConfiguration &tool)
{
xml << tag("PropertyGroup")