diff options
author | Christian Kandeler <christian.kandeler@qt.io> | 2017-01-02 17:27:19 +0100 |
---|---|---|
committer | Christian Kandeler <christian.kandeler@qt.io> | 2017-01-02 17:30:36 +0100 |
commit | 6faaa320f2ea0515c3bea58fe1d5cf7a569a1496 (patch) | |
tree | 8c48be12817038b982413648a6d3623bb733da06 /src/lib/corelib/generators | |
parent | 16a08516371356b5105413243f6fa0a5d7ea1ef1 (diff) | |
parent | 2bc9373d7b4bf54ecac4c9ea63453d549b2a0dad (diff) |
Merge 1.7 into master
Change-Id: I3ca5362d88742fa1a0e839ac4dc1f072e87c06cd
Diffstat (limited to 'src/lib/corelib/generators')
-rw-r--r-- | src/lib/corelib/generators/visualstudio/msbuildqbsproductproject.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/lib/corelib/generators/visualstudio/msbuildqbsproductproject.cpp b/src/lib/corelib/generators/visualstudio/msbuildqbsproductproject.cpp index 81d0be8bb..d51534159 100644 --- a/src/lib/corelib/generators/visualstudio/msbuildqbsproductproject.cpp +++ b/src/lib/corelib/generators/visualstudio/msbuildqbsproductproject.cpp @@ -138,7 +138,9 @@ void MSBuildQbsProductProject::addConfiguration(const GeneratableProject &projec debugBuild ? QStringLiteral("true") : QStringLiteral("false")); // General - General - propertyGroup1->appendProperty(QStringLiteral("OutDir"), relativeTargetDir); + // We need a trailing backslash for $(OutDir); See also the VS documentation: + // https://docs.microsoft.com/en-us/cpp/ide/common-macros-for-build-commands-and-properties + propertyGroup1->appendProperty(QStringLiteral("OutDir"), relativeTargetDir + QLatin1Char('\\')); propertyGroup1->appendProperty(QStringLiteral("TargetName"), productData.targetName()); propertyGroup1->appendProperty(QStringLiteral("PlatformToolset"), versionInfo().platformToolsetVersion()); @@ -322,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(); } |