aboutsummaryrefslogtreecommitdiffstats
path: root/src/qtprojectlib/MsBuildProject.cs
diff options
context:
space:
mode:
authorMiguel Costa <miguel.costa@qt.io>2018-01-26 15:19:26 +0100
committerMiguel Costa <miguel.costa@qt.io>2018-01-31 10:03:34 +0000
commitfa219b53ce5199b3d49215b1d5add2b327457ed7 (patch)
tree7373dfbd472b88603fc0db55dbdec4b49804742d /src/qtprojectlib/MsBuildProject.cs
parenta41066cca0a903ac2068943f777b786d81a01f13 (diff)
Fix issues with the use of the QtMsBuild environment variable
(1) When starting Visual Studio, set the environment variable for the running process; this will enable VS Tools to work correctly in side-by-side installations of Visual Studio. (2) Remove the "ugly" (and now useless) registry access inside the project file (3) Don't define the useless environment variable "QtVsTools" (4) If the Qt/MsBuild files cannot be found using the environment variable, try a default location inside the project directory; this will allow projects to be used "detached" from the VS Tools (e.g. when sharing the project with someone that does not have the VS Tools installed). Change-Id: I7199d665c5a3801dc8804503ef5d887c2ae3344b Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Diffstat (limited to 'src/qtprojectlib/MsBuildProject.cs')
-rw-r--r--src/qtprojectlib/MsBuildProject.cs6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/qtprojectlib/MsBuildProject.cs b/src/qtprojectlib/MsBuildProject.cs
index 0b4bd824..189fd5a0 100644
--- a/src/qtprojectlib/MsBuildProject.cs
+++ b/src/qtprojectlib/MsBuildProject.cs
@@ -193,9 +193,11 @@ namespace QtProjectLib
xImportCppProps.AddAfterSelf(
new XElement(ns + "PropertyGroup",
- new XAttribute("Condition", "'$(QtMsBuild)'==''"),
+ new XAttribute("Condition",
+ @"'$(QtMsBuild)'=='' " +
+ @"or !Exists('$(QtMsBuild)\qt.targets')"),
new XElement(ns + "QtMsBuild",
- @"$(Registry:HKEY_CURRENT_USER\Environment@QtMsBuild)")),
+ @"$(MSBuildProjectDirectory)\QtMsBuild")),
new XElement(ns + "Target",
new XAttribute("Name", "QtMsBuildNotFound"),