path: root/qmake
diff options
authorChris Gilbert <>2013-10-24 13:52:14 -0700
committerThe Qt Project <>2013-10-29 19:59:17 +0100
commitae52bba5d441ea5fa1a56b956e90e00e2f688765 (patch)
tree0d79b4cfb906745eb4740cc425a4b50fd003bf69 /qmake
parent721ec985011489b35ec9fd4f3c3cb9d51864f003 (diff)
Fix msvc project dependencies as specificed by .depends
Previously, the full path to the qmake project file was specified as the key for projGuids when inserting the project GUID into this hash table. The only place that items are inserted into projGuids is in VcprojGenerator::collectDependencies at: projGuids.insert(val.first, newDep->target); In this case, val.first contains the full path for the given project being processed at this point. (e.g.: c:\testproject\ Further in sln/vcproj generation, projGuids is queried with the contents of <TARGET>.depends so that users may specify another qmake project as a dependency for a given target. This occurs in two places, in two ways: 1) In VcprojGenerator::collectDependencies() at: QString depend = dep.toQString(); if (!projGuids[depend].isEmpty()) { ... In this case QString depend contains whatever is put into <TARGET>.depends. Typically this is the plain name of the project you depend on. (e.g.: testproj) 2) In VcprojGenerator::writeSubDirs(QTextStream &t) by proxy of extraSubdirs which is a QStringList of the project depends should the mapping in case 1 fail. This case works much like the above case, attempting to use each QString entry of the extraSubdirs list as a key in projGuids. If either of the above two attempts are successful, the msvc solution is configured in a way that creates a project dependency, ensuring correct compilation order and other related behavior. The fix here stores the target project (e.g.: testproject) as opposed to the full project path, as that is what is expected in the <TARGET>.depends statements contained in the qmake project. Change-Id: Iee05661a64d7a3e4467c5ade48d801fbbfe981b5 Reviewed-by: Andy Shaw <> Reviewed-by: Chris Gilbert <>
Diffstat (limited to 'qmake')
1 files changed, 1 insertions, 1 deletions
diff --git a/qmake/generators/win32/msvc_vcproj.cpp b/qmake/generators/win32/msvc_vcproj.cpp
index a30129fa27..8a5c5b7032 100644
--- a/qmake/generators/win32/msvc_vcproj.cpp
+++ b/qmake/generators/win32/msvc_vcproj.cpp
@@ -514,7 +514,7 @@ ProStringList VcprojGenerator::collectDependencies(QMakeProject *proj, QHash<QSt
// We want to store it as the .lib name.
if (newDep->target.endsWith(".dll"))
newDep->target = newDep->target.left(newDep->target.length()-3) + "lib";
- projGuids.insert(val.first, newDep->target);
+ projGuids.insert(newDep->orig_target, newDep->target);
if (val.second.size()) {
const ProStringList depends = val.second;