Fix qmake -project
authorRafael Roquetto <rafael.roquetto@kdab.com>
Fri, 3 Aug 2012 17:35:54 +0000 (19:35 +0200)
committerQt by Nokia <qt-info@nokia.com>
Mon, 6 Aug 2012 14:04:03 +0000 (16:04 +0200)
qmake -project was always outputting a project with subdirs template, because
Option::h_moc_mod was not being properly read, causing addFile() to misbehave.

Change-Id: I2c07aea132f9885eabf188de993b0fabfb352886
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
qmake/generators/projectgenerator.cpp
qmake/project.cpp

index 1e5bab6..16d1c71 100644 (file)
@@ -78,6 +78,7 @@ ProjectGenerator::init()
 
     project->read(QMakeProject::ReadFeatures);
     project->values("CONFIG").clear();
+    Option::postProcessProject(project);
 
     QHash<QString, QStringList> &v = project->variables();
     QString templ = Option::user_template.isEmpty() ? QString("app") : Option::user_template;
index 61140e9..3379f45 100644 (file)
@@ -1518,6 +1518,12 @@ QMakeProject::read(uchar cmd)
         vars = base_vars; // start with the base
       }
         setupProject();
+    } else if (cmd & ReadFeatures) {
+        // Even when ReadSetup is not set, but ReadFeatures is,
+        // we still need to process spec_pre.prf to load some
+        // default values and other settings.
+        debug_msg(1, "Processing spec_pre (but skipping actual spec): %s", vars["CONFIG"].join("::").toLatin1().constData());
+        doProjectInclude("spec_pre", IncludeFlagFeature, vars);
     }
 
     for (QHash<QString, QStringList>::ConstIterator it = extra_vars.constBegin();