fix loading of qmakespecs in the qt support classes

it's not sufficient to load the qmake.conf only any more.

Change-Id: Ic699ad5e202d6f3e115e44621b4c6ee2def6edd2
Reviewed-by: Kai Koehne <kai.koehne@nokia.com>
Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
This commit is contained in:
Oswald Buddenhagen
2012-08-29 14:58:12 +02:00
parent 3e0950bd86
commit 465f2a1562
6 changed files with 42 additions and 29 deletions

View File

@@ -1032,6 +1032,33 @@ bool QMakeEvaluator::prepareProject(const QString &inDir)
return true;
}
bool QMakeEvaluator::loadSpecInternal()
{
if (!evaluateFeatureFile(QLatin1String("spec_pre.prf")))
return false;
QString spec = m_qmakespec + QLatin1String("/qmake.conf");
if (!evaluateFileDirect(spec, QMakeHandler::EvalConfigFile, LoadProOnly)) {
evalError(fL1S("Could not read qmake configuration file %1.").arg(spec));
return false;
}
#ifdef Q_OS_UNIX
m_qmakespecFull = QFileInfo(m_qmakespec).canonicalFilePath();
#else
// We can't resolve symlinks as they do on Unix, so configure.exe puts
// the source of the qmake.conf at the end of the default/qmake.conf in
// the QMAKESPEC_ORIGINAL variable.
const ProString &orig_spec = first(ProKey("QMAKESPEC_ORIGINAL"));
m_qmakespecFull = orig_spec.isEmpty() ? m_qmakespec : orig_spec.toQString();
#endif
valuesRef(ProKey("QMAKESPEC")) << ProString(m_qmakespecFull);
m_qmakespecName = IoUtils::fileName(m_qmakespecFull).toString();
if (!evaluateFeatureFile(QLatin1String("spec_post.prf")))
return false;
// The MinGW and x-build specs may change the separator; $$shell_{path,quote}() need it
m_dirSep = first(ProKey("QMAKE_DIR_SEP"));
return true;
}
bool QMakeEvaluator::loadSpec()
{
QString qmakespec = m_option->expandEnvVars(
@@ -1085,29 +1112,9 @@ bool QMakeEvaluator::loadSpec()
&& !evaluateFileDirect(m_superfile, QMakeHandler::EvalConfigFile, LoadProOnly)) {
return false;
}
if (!evaluateFeatureFile(QLatin1String("spec_pre.prf")))
return false;
QString spec = m_qmakespec + QLatin1String("/qmake.conf");
if (!evaluateFileDirect(spec, QMakeHandler::EvalConfigFile, LoadProOnly)) {
evalError(fL1S("Could not read qmake configuration file %1.").arg(spec));
return false;
}
#ifdef Q_OS_UNIX
m_qmakespecFull = QFileInfo(m_qmakespec).canonicalFilePath();
#else
// We can't resolve symlinks as they do on Unix, so configure.exe puts
// the source of the qmake.conf at the end of the default/qmake.conf in
// the QMAKESPEC_ORIGINAL variable.
const ProString &orig_spec = first(ProKey("QMAKESPEC_ORIGINAL"));
m_qmakespecFull = orig_spec.isEmpty() ? m_qmakespec : orig_spec.toQString();
#endif
valuesRef(ProKey("QMAKESPEC")) << ProString(m_qmakespecFull);
m_qmakespecName = IoUtils::fileName(m_qmakespecFull).toString();
if (!evaluateFeatureFile(QLatin1String("spec_post.prf")))
if (!loadSpecInternal())
return false;
updateFeaturePaths(); // The spec extends the feature search path, so rebuild the cache.
// The MinGW and x-build specs may change the separator; $$shell_{path,quote}() need it
m_dirSep = first(ProKey("QMAKE_DIR_SEP"));
if (!m_conffile.isEmpty()
&& !evaluateFileDirect(m_conffile, QMakeHandler::EvalConfigFile, LoadProOnly)) {
return false;