qmake: Correctly handle shadow build of nested vcsubdirs projects.

For some reason, the solution generator was looking for the vcproj
files in the source tree. It should look for them in the output tree
instead (suggested by Joerg Bornemann). This should handle both
in-source and out-of-source builds, and the special-case code for
handling out-of-source builds (which had a bug) can be removed.

Task-number: QTBUG-49665
Change-Id: I40b5c5907c52ffb074ccb8f297bb5924eacc1cb0
Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Andy Shaw <andy.shaw@theqtcompany.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
This commit is contained in:
Mathew Sutcliffe 2015-11-27 18:03:37 +00:00 committed by Joerg Bornemann
parent d76be5530a
commit 8b8e8a33b3

View File

@ -532,31 +532,13 @@ ProStringList VcprojGenerator::collectDependencies(QMakeProject *proj, QHash<QSt
// We assume project filename is [QMAKE_PROJECT_NAME].vcproj
QString vcproj = tmp_vcproj.project->first("QMAKE_PROJECT_NAME") + project->first("VCPROJ_EXTENSION");
QString vcprojDir = qmake_getpwd();
QString vcprojDir = Option::output_dir;
// If file doesn't exsist, then maybe the users configuration
// doesn't allow it to be created. Skip to next...
if (!exists(vcprojDir + Option::dir_sep + vcproj)) {
// Try to find the directory which fits relative
// to the output path, which represents the shadow
// path in case we are shadow building
QStringList list = fi.path().split(QLatin1Char('/'));
QString tmpDir = QFileInfo(Option::output).path() + Option::dir_sep;
bool found = false;
for (int i = list.size() - 1; i >= 0; --i) {
QString curr;
for (int j = i; j < list.size(); ++j)
curr += list.at(j) + Option::dir_sep;
if (exists(tmpDir + curr + vcproj)) {
vcprojDir = QDir::cleanPath(tmpDir + curr);
found = true;
break;
}
}
if (!found) {
warn_msg(WarnLogic, "Ignored (not found) '%s'", QString(vcprojDir + Option::dir_sep + vcproj).toLatin1().constData());
goto nextfile; // # Dirty!
}
warn_msg(WarnLogic, "Ignored (not found) '%s'", QString(vcprojDir + Option::dir_sep + vcproj).toLatin1().constData());
goto nextfile; // # Dirty!
}
VcsolutionDepend *newDep = new VcsolutionDepend;