aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiguel Costa <miguel.costa@qt.io>2019-10-07 17:29:32 +0200
committerMiguel Costa <miguel.costa@qt.io>2019-10-10 11:45:13 +0000
commitf6caa53b79a4700303eace87062eb29489a59020 (patch)
tree8ca97b2d1e346904fd3e29834f9e9aa30c3e76b6
parent9926f90cdea43b34c30a9fd0f5b42cab29f163ff (diff)
Fix Qt tools output path mangled by conversion to V3
When converting projects to the V3 format, will now correctly preserve the path to the output of Qt tools. Previously, this path was overwritten with the default setting for new projects. Task-number: QTVSADDINBUG-665 Change-Id: I4584ac1e9ec95219c770efb5aa7e52a9b424a765 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
-rw-r--r--src/qtprojectlib/MsBuildProject.cs21
1 files changed, 20 insertions, 1 deletions
diff --git a/src/qtprojectlib/MsBuildProject.cs b/src/qtprojectlib/MsBuildProject.cs
index f4916a56..cef07749 100644
--- a/src/qtprojectlib/MsBuildProject.cs
+++ b/src/qtprojectlib/MsBuildProject.cs
@@ -688,8 +688,27 @@ namespace QtProjectLib
this[Files.User].isDirty = true;
}
+ // Convert OutputFile --> <tool>Dir + <tool>FileName
+ var qtItems = this[Files.Project].xml
+ .Elements(ns + "Project")
+ .SelectMany(x => x.Elements(ns + "ItemDefinitionGroup")
+ .Union(x.Elements(ns + "ItemGroup")))
+ .SelectMany(x => x.Elements(ns + "QtMoc")
+ .Union(x.Elements(ns + "QtRcc"))
+ .Union(x.Elements(ns + "QtUic")));
+ foreach (var qtItem in qtItems) {
+ var outputFile = qtItem.Element(ns + "OutputFile");
+ if (outputFile != null) {
+ var qtTool = qtItem.Name.LocalName;
+ var outDir = Path.GetDirectoryName(outputFile.Value);
+ var outFileName = Path.GetFileName(outputFile.Value);
+ qtItem.Add(new XElement(ns + qtTool + "Dir", outDir));
+ qtItem.Add(new XElement(ns + qtTool + "FileName", outFileName));
+ }
+ }
+
// Remove old properties from project items
- var oldQtProps = new[] { "QTDIR", "InputFile", "OutputFile", "ExecutionDescription" };
+ var oldQtProps = new[] { "QTDIR", "InputFile", "OutputFile" };
var oldCppProps = new[] { "IncludePath", "Define", "Undefine" };
var oldPropsAny = oldQtProps.Union(oldCppProps);
this[Files.Project].xml