aboutsummaryrefslogtreecommitdiffstats
path: root/src/qtprojectlib/MsBuildProject.cs
diff options
context:
space:
mode:
authorMiguel Costa <miguel.costa@qt.io>2020-01-31 17:12:27 +0100
committerMiguel Costa <miguel.costa@qt.io>2020-03-09 11:42:39 +0000
commit57e1a8790137f89d4ea5d66e6b3f6bbbeb605603 (patch)
treeff1dafda989886102de424631d03a57d65e35186 /src/qtprojectlib/MsBuildProject.cs
parentd4b2f77ae1f9b542c756d51f31a5ddc3fb6e3668 (diff)
Clean up .pro import
When importing a .pro file, ensure unused include/lib path entries are discarded. Change-Id: Ibae8a502bdadedf5f311c79b3be4507faa3c8275 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'src/qtprojectlib/MsBuildProject.cs')
-rw-r--r--src/qtprojectlib/MsBuildProject.cs14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/qtprojectlib/MsBuildProject.cs b/src/qtprojectlib/MsBuildProject.cs
index e8aa4b95..26349922 100644
--- a/src/qtprojectlib/MsBuildProject.cs
+++ b/src/qtprojectlib/MsBuildProject.cs
@@ -608,14 +608,8 @@ namespace QtProjectLib
foreach (var inclPath in compiler.Elements(ns + "AdditionalIncludeDirectories")) {
inclPath.SetValue(string.Join(";", inclPath.Value.Split(';')
.Select(x => Unquote(x))
- .Where(x =>
- // Exclude include paths of Qt modules
- !moduleIncludePaths.Contains(Path.GetFileName(x), IGNORE_CASE_)
- // Exclude paths rooted on $(QTDIR)
- || (!x.StartsWith("$(QTDIR)", IGNORE_CASE)
- // Exclude paths rooted on the default Qt dir
- && (string.IsNullOrEmpty(defaultQtDir)
- || !x.StartsWith(defaultQtDir, IGNORE_CASE))))));
+ // Exclude paths rooted on $(QTDIR)
+ .Where(x => !x.StartsWith("$(QTDIR)", IGNORE_CASE))));
}
// Remove Qt module libraries from linker properties
@@ -627,7 +621,9 @@ namespace QtProjectLib
// Remove Qt lib path from linker properties
foreach (var libs in linker.Elements(ns + "AdditionalLibraryDirectories")) {
libs.SetValue(string.Join(";", libs.Value.Split(';')
- .Where(x => !x.Equals(@"$(QTDIR)\lib", IGNORE_CASE))));
+ .Select(x => Unquote(x))
+ // Exclude paths rooted on $(QTDIR)
+ .Where(x => !x.StartsWith("$(QTDIR)", IGNORE_CASE))));
}
// Add Qt module names to QtModules project property