MakefileGenerator *BuildsMetaMakefileGenerator::processBuild(const ProString &build) { if(project) { debug_msg(1, "Meta Generator: Parsing '%s' for build [%s].", project->projectFile().toLatin1().constData(),build.toLatin1().constData()); //initialize the base ProValueMap basevars; ProStringList basecfgs = project->values(ProKey(build + ".CONFIG")); basecfgs += build; basecfgs += "build_pass"; basevars["BUILD_PASS"] = ProStringList(build); ProStringList buildname = project->values(ProKey(build + ".name")); basevars["BUILD_NAME"] = (buildname.isEmpty() ? ProStringList(build) : buildname); //create project QMakeProject *build_proj = new QMakeProject; build_proj->setExtraVars(basevars); build_proj->setExtraConfigs(basecfgs); build_proj->read(project->projectFile()); //done return createMakefileGenerator(build_proj); } return 0; }
ProString QMakeProject::expand(const QString &expr, const QString &where, int line) { ProString ret; ProFile *pro = m_parser->parsedProBlock(expr, where, line, QMakeParser::ValueGrammar); if (pro->isOk()) { m_current.pro = pro; m_current.line = 0; const ushort *tokPtr = pro->tokPtr(); ProStringList result = expandVariableReferences(tokPtr, 1, true); if (!result.isEmpty()) ret = result.at(0); } pro->deref(); return ret; }