aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/corelib/generators
diff options
context:
space:
mode:
authorThomas Epting <thomas.epting@stryker.com>2016-12-18 17:24:55 +0100
committerThomas Epting <thomas.epting@stryker.com>2016-12-18 20:17:57 +0000
commit652f13e8fe428a525f48012f12f6a8c01e1c49fd (patch)
tree1985274b2d251d88447ce087f63353dadab9a6e4 /src/lib/corelib/generators
parent8544d48d52fc432d4fe396e1b7904672418c05a5 (diff)
VS generator: Don't prepend $(ProjectDir) to absolute paths
Task-number: QBS-1081 Change-Id: I62f2016f87d0186eea6f8c7e3e784ab28f72f981 Reviewed-by: Jake Petroules <jake.petroules@qt.io>
Diffstat (limited to 'src/lib/corelib/generators')
-rw-r--r--src/lib/corelib/generators/visualstudio/msbuildqbsproductproject.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/lib/corelib/generators/visualstudio/msbuildqbsproductproject.cpp b/src/lib/corelib/generators/visualstudio/msbuildqbsproductproject.cpp
index bc14f3921..d51534159 100644
--- a/src/lib/corelib/generators/visualstudio/msbuildqbsproductproject.cpp
+++ b/src/lib/corelib/generators/visualstudio/msbuildqbsproductproject.cpp
@@ -324,8 +324,12 @@ void MSBuildQbsProductProject::addFiles(const GeneratableProject &project,
});
}
auto fileItem = sourceFileNodes[filePath];
- fileItem->setFilePath(QStringLiteral("$(ProjectDir)")
- + project.baseBuildDirectory().relativeFilePath(filePath));
+ QString path = project.baseBuildDirectory().relativeFilePath(filePath);
+ // The path still might not be relative (for example if the file item is
+ // located on a different drive)
+ if (QFileInfo(path).isRelative())
+ path = QStringLiteral("$(ProjectDir)") + path;
+ fileItem->setFilePath(path);
if (group.isEnabled())
sourceFileEnabledConfigurations[filePath] << productDataIt.key();
}