diff options
author | Oswald Buddenhagen <oswald.buddenhagen@nokia.com> | 2012-09-05 18:29:19 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-09-11 00:13:01 +0200 |
commit | 0e78e5080262b8fa7a86f7cd0c8716839db048f6 (patch) | |
tree | 83ca3f608a6c9a359ba783d496ffdbc9ef7a6073 /qmake/generators | |
parent | ed7594db5db7b28ce4c4646624de97b52fbf16d5 (diff) |
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 <qt_docbot@qt-project.org>
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
Diffstat (limited to 'qmake/generators')
-rw-r--r-- | qmake/generators/makefile.cpp | 6 | ||||
-rw-r--r-- | qmake/generators/metamakefile.cpp | 4 | ||||
-rw-r--r-- | qmake/generators/projectgenerator.cpp | 20 | ||||
-rw-r--r-- | qmake/generators/win32/msvc_vcproj.cpp | 6 |
4 files changed, 19 insertions, 17 deletions
diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp index 2f7e8c7bab..2cfbccb2b5 100644 --- a/qmake/generators/makefile.cpp +++ b/qmake/generators/makefile.cpp @@ -194,7 +194,7 @@ MakefileGenerator::initOutPaths() ProValueMap &v = project->variables(); //for shadow builds if(!v.contains("QMAKE_ABSOLUTE_SOURCE_PATH")) { - if (Option::mkfile::do_cache && !project->cacheFile().isEmpty() && + if (Option::globals->do_cache && !project->cacheFile().isEmpty() && v.contains("QMAKE_ABSOLUTE_SOURCE_ROOT")) { QString root = v["QMAKE_ABSOLUTE_SOURCE_ROOT"].first().toQString(); root = QDir::fromNativeSeparators(root); @@ -884,7 +884,7 @@ MakefileGenerator::init() // escape qmake command project->values("QMAKE_QMAKE") = - ProStringList(escapeFilePath(Option::fixPathToTargetOS(Option::qmake_abslocation, false))); + ProStringList(escapeFilePath(Option::fixPathToTargetOS(Option::globals->qmake_abslocation, false))); } bool @@ -2682,7 +2682,7 @@ MakefileGenerator::writeMakeQmake(QTextStream &t, bool noDummyQmakeAll) if(!ofile.isEmpty() && !project->isActiveConfig("no_autoqmake")) { t << escapeFilePath(ofile) << ": " << escapeDependencyPath(fileFixify(project->projectFile())) << " "; - if (Option::mkfile::do_cache) { + if (Option::globals->do_cache) { if (!project->confFile().isEmpty()) t << escapeDependencyPath(fileFixify(project->confFile())) << " "; if (!project->cacheFile().isEmpty()) diff --git a/qmake/generators/metamakefile.cpp b/qmake/generators/metamakefile.cpp index c1e7efd62c..4c40ea06ee 100644 --- a/qmake/generators/metamakefile.cpp +++ b/qmake/generators/metamakefile.cpp @@ -235,7 +235,7 @@ MakefileGenerator basevars["BUILD_NAME"] = (buildname.isEmpty() ? ProStringList(build) : buildname); //create project - QMakeProject *build_proj = new QMakeProject(project->properties()); + QMakeProject *build_proj = new QMakeProject; build_proj->setExtraVars(basevars); build_proj->setExtraConfigs(basecfgs); @@ -317,7 +317,7 @@ SubdirsMetaMakefileGenerator::init() } //handle sub project - QMakeProject *sub_proj = new QMakeProject(project->properties()); + QMakeProject *sub_proj = new QMakeProject; for (int ind = 0; ind < sub->indent; ++ind) printf(" "); sub->input_dir = subdir.absolutePath(); 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; } diff --git a/qmake/generators/win32/msvc_vcproj.cpp b/qmake/generators/win32/msvc_vcproj.cpp index b27b638d42..db88dcc152 100644 --- a/qmake/generators/win32/msvc_vcproj.cpp +++ b/qmake/generators/win32/msvc_vcproj.cpp @@ -442,8 +442,8 @@ void VcprojGenerator::writeSubDirs(QTextStream &t) // Make sure that all temp projects are configured // for release so that the depends are created // without the debug <lib>dxxx.lib name mangling - QStringList old_after_vars = Option::after_user_vars; - Option::after_user_vars.append("CONFIG+=release"); + QString old_after_vars = Option::globals->postcmds; + Option::globals->postcmds.append("\nCONFIG+=release"); QStringList subdirs = collectSubDirs(project); for(int i = 0; i < subdirs.size(); ++i) { @@ -627,7 +627,7 @@ nextfile: t << _slnProjDepBeg; // Restore previous after_user_var options - Option::after_user_vars = old_after_vars; + Option::globals->postcmds = old_after_vars; // Figure out dependencies for(QList<VcsolutionDepend*>::Iterator it = solution_cleanup.begin(); it != solution_cleanup.end(); ++it) { |