summaryrefslogtreecommitdiffstats
path: root/qmake
diff options
context:
space:
mode:
authorAndrew Patterson <andrew@avenza.com>2013-05-13 08:02:39 -0400
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-06-05 08:45:07 +0200
commitf36374727e5445cdab489a27605c35d1c4515317 (patch)
tree9c8cff3cacda10aa3d59b00d6013b24aafa93437 /qmake
parent76d75fd7df66c2687cf78945ccead03c5500f531 (diff)
Changed project dependencies for solution files
Reorganized project dependency output in solution files for vc 2005+ Task-number: QTBUG-30993 Change-Id: I4764f3d98be40b3e217130522bb89a43bbf3669e Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Diffstat (limited to 'qmake')
-rw-r--r--qmake/generators/win32/msvc_vcproj.cpp44
1 files changed, 27 insertions, 17 deletions
diff --git a/qmake/generators/win32/msvc_vcproj.cpp b/qmake/generators/win32/msvc_vcproj.cpp
index fb4bf08431..17c72fa5d0 100644
--- a/qmake/generators/win32/msvc_vcproj.cpp
+++ b/qmake/generators/win32/msvc_vcproj.cpp
@@ -200,8 +200,9 @@ const char _slnSolutionConf[] = "\n\tGlobalSection(SolutionConfiguration) = pr
"\n\t\tConfigName.0 = Debug|Win32"
"\n\t\tConfigName.1 = Release|Win32"
"\n\tEndGlobalSection";
-const char _slnProjDepBeg[] = "\n\tGlobalSection(ProjectDependencies) = postSolution";
-const char _slnProjDepEnd[] = "\n\tEndGlobalSection";
+
+const char _slnProjDepBeg[] = "\n\tProjectSection(ProjectDependencies) = postProject";
+const char _slnProjDepEnd[] = "\n\tEndProjectSection";
const char _slnProjConfBeg[] = "\n\tGlobalSection(ProjectConfiguration) = postSolution";
const char _slnProjRelConfTag1[]= ".Release|%1.ActiveCfg = Release|";
const char _slnProjRelConfTag2[]= ".Release|%1.Build.0 = Release|";
@@ -571,10 +572,6 @@ ProStringList VcprojGenerator::collectDependencies(QMakeProject *proj, QHash<QSt
#endif
solution_cleanup.append(newDep);
solution_depends.insert(newDep->target, newDep);
- t << _slnProjectBeg << _slnMSVCvcprojGUID << _slnProjectMid
- << "\"" << newDep->orig_target << "\", \"" << newDep->vcprojFile
- << "\", \"" << newDep->uuid << "\"";
- t << _slnProjectEnd;
}
nextfile:
qmake_setpwd(oldpwd);
@@ -634,6 +631,30 @@ void VcprojGenerator::writeSubDirs(QTextStream &t)
QHash<QString, ProStringList> subdirProjectLookup;
collectDependencies(project, profileLookup, projGuids, extraSubdirs, solution_depends, solution_cleanup, t, subdirProjectLookup);
+ // write out projects
+ for (QList<VcsolutionDepend*>::Iterator it = solution_cleanup.begin(); it != solution_cleanup.end(); ++it) {
+ t << _slnProjectBeg << _slnMSVCvcprojGUID << _slnProjectMid
+ << "\"" << (*it)->orig_target << "\", \"" << (*it)->vcprojFile
+ << "\", \"" << (*it)->uuid << "\"";
+
+ debug_msg(1, "Project %s has dependencies: %s", (*it)->target.toLatin1().constData(), (*it)->dependencies.join(" ").toLatin1().constData());
+
+ bool hasDependency = false;
+ for (QStringList::iterator dit = (*it)->dependencies.begin(); dit != (*it)->dependencies.end(); ++dit) {
+ if (VcsolutionDepend *vc = solution_depends[*dit]) {
+ if (!hasDependency) {
+ hasDependency = true;
+ t << _slnProjDepBeg;
+ }
+ t << "\n\t\t" << vc->uuid << " = " << vc->uuid;
+ }
+ }
+ if (hasDependency)
+ t << _slnProjDepEnd;
+
+ t << _slnProjectEnd;
+ }
+
t << _slnGlobalBeg;
QHashIterator<VcsolutionDepend *, QStringList> extraIt(extraSubdirs);
@@ -657,20 +678,9 @@ void VcprojGenerator::writeSubDirs(QTextStream &t)
}
t << slnConf;
- t << _slnProjDepBeg;
-
// Restore previous after_user_var options
Option::globals->postcmds = old_after_vars;
- // Figure out dependencies
- for(QList<VcsolutionDepend*>::Iterator it = solution_cleanup.begin(); it != solution_cleanup.end(); ++it) {
- int cnt = 0;
- for(QStringList::iterator dit = (*it)->dependencies.begin(); dit != (*it)->dependencies.end(); ++dit) {
- if(VcsolutionDepend *vc = solution_depends[*dit])
- t << "\n\t\t" << (*it)->uuid << "." << cnt++ << " = " << vc->uuid;
- }
- }
- t << _slnProjDepEnd;
t << _slnProjConfBeg;
for(QList<VcsolutionDepend*>::Iterator it = solution_cleanup.begin(); it != solution_cleanup.end(); ++it) {
QString platform = is64Bit ? "x64" : "Win32";