forked from qt-creator/qt-creator
factor out QMakeEvaluator::prepareProject()
Change-Id: I99a5b0b9ef3080ebc5d0546c3bf17c8806a52c72 Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
This commit is contained in:
@@ -820,6 +820,43 @@ void QMakeEvaluator::visitProVariable(
|
||||
}
|
||||
}
|
||||
|
||||
void QMakeEvaluator::prepareProject()
|
||||
{
|
||||
// ### init QMAKE_QMAKE, QMAKE_SH
|
||||
// ### init QMAKE_EXT_{C,H,CPP,OBJ}
|
||||
// ### init TEMPLATE_PREFIX
|
||||
|
||||
if (m_option->do_cache) {
|
||||
QString qmake_cache = m_option->cachefile;
|
||||
if (qmake_cache.isEmpty() && !m_outputDir.isEmpty()) { //find it as it has not been specified
|
||||
QDir dir(m_outputDir);
|
||||
forever {
|
||||
qmake_cache = dir.path() + QLatin1String("/.qmake.cache");
|
||||
if (IoUtils::exists(qmake_cache))
|
||||
break;
|
||||
if (!dir.cdUp() || dir.isRoot()) {
|
||||
qmake_cache.clear();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!qmake_cache.isEmpty()) {
|
||||
ProValueMap cache_valuemap;
|
||||
if (evaluateFileInto(qmake_cache, QMakeHandler::EvalConfigFile,
|
||||
&cache_valuemap, EvalProOnly)) {
|
||||
if (m_option->qmakespec.isEmpty()) {
|
||||
const ProStringList &vals = cache_valuemap.value(ProString("QMAKESPEC"));
|
||||
if (!vals.isEmpty())
|
||||
m_option->qmakespec = vals.first().toQString();
|
||||
}
|
||||
} else {
|
||||
qmake_cache.clear();
|
||||
}
|
||||
}
|
||||
m_option->cachefile = qmake_cache;
|
||||
}
|
||||
}
|
||||
|
||||
void QMakeEvaluator::loadSpec()
|
||||
{
|
||||
QString qmakespec = m_option->expandEnvVars(m_option->qmakespec);
|
||||
@@ -910,39 +947,7 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::visitProFile(
|
||||
m_cumulative = false;
|
||||
#endif
|
||||
|
||||
// ### init QMAKE_QMAKE, QMAKE_SH
|
||||
// ### init QMAKE_EXT_{C,H,CPP,OBJ}
|
||||
// ### init TEMPLATE_PREFIX
|
||||
|
||||
if (m_option->do_cache) {
|
||||
QString qmake_cache = m_option->cachefile;
|
||||
if (qmake_cache.isEmpty() && !m_outputDir.isEmpty()) { //find it as it has not been specified
|
||||
QDir dir(m_outputDir);
|
||||
forever {
|
||||
qmake_cache = dir.path() + QLatin1String("/.qmake.cache");
|
||||
if (IoUtils::exists(qmake_cache))
|
||||
break;
|
||||
if (!dir.cdUp() || dir.isRoot()) {
|
||||
qmake_cache.clear();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!qmake_cache.isEmpty()) {
|
||||
ProValueMap cache_valuemap;
|
||||
if (evaluateFileInto(qmake_cache, QMakeHandler::EvalConfigFile,
|
||||
&cache_valuemap, EvalProOnly)) {
|
||||
if (m_option->qmakespec.isEmpty()) {
|
||||
const ProStringList &vals = cache_valuemap.value(ProString("QMAKESPEC"));
|
||||
if (!vals.isEmpty())
|
||||
m_option->qmakespec = vals.first().toQString();
|
||||
}
|
||||
} else {
|
||||
qmake_cache.clear();
|
||||
}
|
||||
}
|
||||
m_option->cachefile = qmake_cache;
|
||||
}
|
||||
prepareProject();
|
||||
|
||||
loadSpec();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user