forked from qt-creator/qt-creator
make $$QMAKE_QMAKE available to projects
not setting it outside the main project processing, as it's even less likely to be needed there. Change-Id: Ia7afe3a53bf0977d739bf23d7cd79e3a2aee8867 Reviewed-by: Daniel Teske <daniel.teske@nokia.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
This commit is contained in:
@@ -943,8 +943,10 @@ QtSupport::ProFileReader *Qt4Project::createProFileReader(Qt4ProFileNode *qt4Pro
|
||||
QString systemRoot = SysRootProfileInformation::hasSysRoot(p)
|
||||
? SysRootProfileInformation::sysRoot(p).toString() : QString();
|
||||
|
||||
if (qtVersion && qtVersion->isValid())
|
||||
if (qtVersion && qtVersion->isValid()) {
|
||||
m_qmakeGlobals->qmake_abslocation = QDir::cleanPath(qtVersion->qmakeCommand().toString());
|
||||
m_qmakeGlobals->setProperties(qtVersion->versionInfo());
|
||||
}
|
||||
m_qmakeGlobals->sysroot = systemRoot;
|
||||
|
||||
Utils::Environment::const_iterator eit = env.constBegin(), eend = env.constEnd();
|
||||
|
@@ -859,6 +859,8 @@ void QMakeEvaluator::loadDefaults()
|
||||
vars[ProString("DIR_SEPARATOR")] << ProString(m_option->dir_sep, NoHash);
|
||||
vars[ProString("DIRLIST_SEPARATOR")] << ProString(m_option->dirlist_sep, NoHash);
|
||||
vars[ProString("_DATE_")] << ProString(QDateTime::currentDateTime().toString(), NoHash);
|
||||
if (!m_option->qmake_abslocation.isEmpty())
|
||||
vars[ProString("QMAKE_QMAKE")] << ProString(m_option->qmake_abslocation, NoHash);
|
||||
#if defined(Q_OS_WIN32)
|
||||
vars[ProString("QMAKE_HOST.os")] << ProString("Windows", NoHash);
|
||||
|
||||
|
@@ -184,17 +184,17 @@ QString QMakeGlobals::expandEnvVars(const QString &str) const
|
||||
}
|
||||
|
||||
#ifdef PROEVALUATOR_INIT_PROPS
|
||||
bool QMakeGlobals::initProperties(const QString &qmake)
|
||||
bool QMakeGlobals::initProperties()
|
||||
{
|
||||
QByteArray data;
|
||||
#ifndef QT_BOOTSTRAPPED
|
||||
QProcess proc;
|
||||
proc.start(qmake, QStringList() << QLatin1String("-query"));
|
||||
proc.start(qmake_abslocation, QStringList() << QLatin1String("-query"));
|
||||
if (!proc.waitForFinished())
|
||||
return false;
|
||||
data = proc.readAll();
|
||||
#else
|
||||
if (FILE *proc = QT_POPEN(QString(IoUtils::shellQuote(qmake) + QLatin1String(" -query"))
|
||||
if (FILE *proc = QT_POPEN(QString(IoUtils::shellQuote(qmake_abslocation) + QLatin1String(" -query"))
|
||||
.toLocal8Bit(), "r")) {
|
||||
char buff[1024];
|
||||
while (!feof(proc))
|
||||
|
@@ -84,13 +84,14 @@ public:
|
||||
QProcessEnvironment environment;
|
||||
#endif
|
||||
QString sysroot;
|
||||
QString qmake_abslocation;
|
||||
QString user_template, user_template_prefix;
|
||||
|
||||
// -nocache, -cache, -spec, QMAKESPEC
|
||||
// -set persistent value
|
||||
void setCommandLineArguments(const QStringList &args);
|
||||
#ifdef PROEVALUATOR_INIT_PROPS
|
||||
bool initProperties(const QString &qmake);
|
||||
bool initProperties();
|
||||
#else
|
||||
void setProperties(const QHash<QString, QString> &props);
|
||||
#endif
|
||||
|
@@ -158,7 +158,9 @@ int main(int argc, char **argv)
|
||||
qFatal("need at least two arguments: [-v] <cumulative?> <filenme> [<out_pwd> [<qmake options>]]");
|
||||
|
||||
QMakeGlobals option;
|
||||
option.initProperties(QLibraryInfo::location(QLibraryInfo::BinariesPath) + QLatin1String("/qmake"));
|
||||
option.qmake_abslocation =
|
||||
QDir::cleanPath(QLibraryInfo::location(QLibraryInfo::BinariesPath) + QLatin1String("/qmake"));
|
||||
option.initProperties();
|
||||
if (args.count() >= 4)
|
||||
option.setCommandLineArguments(args.mid(3));
|
||||
QMakeParser parser(0, &evalHandler);
|
||||
|
Reference in New Issue
Block a user