aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAli Can Demiralp <ali.demiralp@qt.io>2024-04-09 12:19:17 +0200
committerAli Can Demiralp <ali.demiralp@qt.io>2024-04-09 11:45:51 +0000
commit574fa426800b9a055653f3e6fda329c92208e184 (patch)
tree89d44fbbf87ee69cce0e259f46a9a3af81e95a59
parentd98afa9683c390bc31523cce96c55dadfc405c35 (diff)
Correct conversion of moc_predef steps and set output path to $(IntDir)
The project importer was ignoring moc_predef steps since it was searching for "moc.exe" within their commands, which does not exist, since predefs are handled by cl and not moc.exe. This is no longer the case. Furthermore the predef output was hard-coded to "debug\" and "release\" directories under the project root. This has been changed to respect the $(IntDir). Fixes: QTVSADDINBUG-987 Change-Id: Ibc6b01d68a7cd27bad3c3148a0562ef399ac743b Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
-rw-r--r--QtVsTools.Core/MsBuild/MsBuildProjectReaderWriter.cs7
1 files changed, 5 insertions, 2 deletions
diff --git a/QtVsTools.Core/MsBuild/MsBuildProjectReaderWriter.cs b/QtVsTools.Core/MsBuild/MsBuildProjectReaderWriter.cs
index b4c731c2..fc879d9b 100644
--- a/QtVsTools.Core/MsBuild/MsBuildProjectReaderWriter.cs
+++ b/QtVsTools.Core/MsBuild/MsBuildProjectReaderWriter.cs
@@ -668,7 +668,7 @@ namespace QtVsTools.Core.MsBuild
// replace each set of .moc.cbt custom build steps
// with a single .cpp custom build step
- var mocCbtCustomBuilds = GetCustomBuilds(QtMoc.ToolExecName)
+ var mocCbtCustomBuilds = GetCustomBuilds("moc_predefs")
.Where(x =>
((string)x.Attribute("Include")).EndsWith(".cbt", IgnoreCase)
|| ((string)x.Attribute("Include")).EndsWith(".moc", IgnoreCase))
@@ -695,8 +695,11 @@ namespace QtVsTools.Core.MsBuild
&& cbtPropertyNames.Contains(x.Name.LocalName)
&& x.Parent.Elements(ns + "ExcludedFromBuild")
.All(y => (string)x.Attribute("Condition") != (string)y.Attribute("Condition")));
- foreach (var property in enabledProperties)
+ foreach (var property in enabledProperties) {
+ property.Value = property.Value.Replace("debug", "$(IntDir)")
+ .Replace("release", "$(IntDir)");
newCbt.Add(new XElement(property));
+ }
cbtToRemove.Add(cbt);
}
cbtGroup.First().AddBeforeSelf(newCbt);