From 0e78e5080262b8fa7a86f7cd0c8716839db048f6 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Wed, 5 Sep 2012 18:29:19 +0200 Subject: port qmake to qt creator's qmake language evaluator this is a monster commit which does the following things: - import the evaluator as-is from qt creator into qmake/library/ - integrate it into qmake's makefiles - overwrite proitems.h with actual special types - remove the parts of Option which are redundant with QMakeGlobals - make QMakeProperty a singleton owned by Option::globals. the dynamic handling so far made no sense. - make QMakeProject a subclass of QMakeEvaluator, with relatively few extensions the changes to existing qmake code outside project.* and option.* are minor. implementing the changes gradually would mean changing a lot of code which will be just replaced in the next commit, so i'm not wasting my time on it. Change-Id: I9746650423b8c5b3fbd8c3979a73228982a46195 Reviewed-by: Qt Doc Bot Reviewed-by: Joerg Bornemann --- qmake/generators/projectgenerator.cpp | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'qmake/generators/projectgenerator.cpp') diff --git a/qmake/generators/projectgenerator.cpp b/qmake/generators/projectgenerator.cpp index aefa5ac6aa..0d3f6a019f 100644 --- a/qmake/generators/projectgenerator.cpp +++ b/qmake/generators/projectgenerator.cpp @@ -76,14 +76,17 @@ ProjectGenerator::init() init_flag = true; verifyCompilers(); - project->read(QMakeProject::ReadFeatures); + project->loadSpec(); + project->evaluateFeatureFile("default_pre.prf"); + project->evaluateFeatureFile("default_post.prf"); + project->evaluateConfigFeatures(); project->values("CONFIG").clear(); Option::postProcessProject(project); ProValueMap &v = project->variables(); - QString templ = Option::user_template.isEmpty() ? QString("app") : Option::user_template; - if(!Option::user_template_prefix.isEmpty()) - templ.prepend(Option::user_template_prefix); + QString templ = Option::globals->user_template.isEmpty() ? QString("app") : Option::globals->user_template; + if (!Option::globals->user_template_prefix.isEmpty()) + templ.prepend(Option::globals->user_template_prefix); v["TEMPLATE_ASSIGN"] += templ; //the scary stuff @@ -344,9 +347,8 @@ ProjectGenerator::writeMakefile(QTextStream &t) t << "######################################################################" << endl; t << "# Automatically generated by qmake (" << qmake_version() << ") " << QDateTime::currentDateTime().toString() << endl; t << "######################################################################" << endl << endl; - int i; - for(i = 0; i < Option::before_user_vars.size(); ++i) - t << Option::before_user_vars[i] << endl; + if (!Option::globals->precmds.isEmpty()) + t << Option::globals->precmds << endl; t << getWritableVar("TEMPLATE_ASSIGN", false); if(project->first("TEMPLATE_ASSIGN") == "subdirs") { t << endl << "# Directories" << "\n" @@ -373,8 +375,8 @@ ProjectGenerator::writeMakefile(QTextStream &t) << getWritableVar("RESOURCES") << getWritableVar("TRANSLATIONS"); } - for(i = 0; i < Option::after_user_vars.size(); ++i) - t << Option::after_user_vars[i] << endl; + if (!Option::globals->postcmds.isEmpty()) + t << Option::globals->postcmds << endl; return true; } -- cgit v1.2.3