2012-05-02 18:34:25 +02:00
|
|
|
/**************************************************************************
|
|
|
|
|
**
|
|
|
|
|
** This file is part of Qt Creator
|
|
|
|
|
**
|
|
|
|
|
** Copyright (c) 2012 Nokia Corporation and/or its subsidiary(-ies).
|
|
|
|
|
**
|
2012-07-19 12:26:56 +02:00
|
|
|
** Contact: http://www.qt-project.org/
|
2012-05-02 18:34:25 +02:00
|
|
|
**
|
|
|
|
|
**
|
|
|
|
|
** GNU Lesser General Public License Usage
|
|
|
|
|
**
|
|
|
|
|
** This file may be used under the terms of the GNU Lesser General Public
|
|
|
|
|
** License version 2.1 as published by the Free Software Foundation and
|
|
|
|
|
** appearing in the file LICENSE.LGPL included in the packaging of this file.
|
|
|
|
|
** Please review the following information to ensure the GNU Lesser General
|
|
|
|
|
** Public License version 2.1 requirements will be met:
|
|
|
|
|
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
|
|
|
|
**
|
|
|
|
|
** In addition, as a special exception, Nokia gives you certain additional
|
|
|
|
|
** rights. These rights are described in the Nokia Qt LGPL Exception
|
|
|
|
|
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
|
|
|
|
**
|
|
|
|
|
** Other Usage
|
|
|
|
|
**
|
|
|
|
|
** Alternatively, this file may be used in accordance with the terms and
|
|
|
|
|
** conditions contained in a signed written agreement between you and Nokia.
|
|
|
|
|
**
|
|
|
|
|
**
|
|
|
|
|
**************************************************************************/
|
|
|
|
|
|
|
|
|
|
#ifndef QMAKEGLOBALS_H
|
|
|
|
|
#define QMAKEGLOBALS_H
|
|
|
|
|
|
|
|
|
|
#include "qmake_global.h"
|
|
|
|
|
#include "proitems.h"
|
|
|
|
|
|
|
|
|
|
#include <QHash>
|
|
|
|
|
#include <QStringList>
|
|
|
|
|
#ifndef QT_BOOTSTRAPPED
|
|
|
|
|
# include <QProcess>
|
|
|
|
|
#endif
|
|
|
|
|
#ifdef PROEVALUATOR_THREAD_SAFE
|
|
|
|
|
# include <QMutex>
|
|
|
|
|
# include <QWaitCondition>
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
QT_BEGIN_NAMESPACE
|
|
|
|
|
|
2012-05-02 15:43:12 +02:00
|
|
|
class QMakeEvaluator;
|
|
|
|
|
|
2012-07-24 15:00:06 +02:00
|
|
|
class QMakeBaseKey
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
QMakeBaseKey(const QString &_root, bool _hostBuild);
|
|
|
|
|
|
|
|
|
|
QString root;
|
|
|
|
|
bool hostBuild;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
uint qHash(const QMakeBaseKey &key);
|
|
|
|
|
bool operator==(const QMakeBaseKey &one, const QMakeBaseKey &two);
|
2012-06-13 19:37:50 +02:00
|
|
|
|
|
|
|
|
class QMakeBaseEnv
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
QMakeBaseEnv();
|
|
|
|
|
~QMakeBaseEnv();
|
|
|
|
|
|
|
|
|
|
#ifdef PROEVALUATOR_THREAD_SAFE
|
|
|
|
|
QMutex mutex;
|
|
|
|
|
QWaitCondition cond;
|
|
|
|
|
bool inProgress;
|
|
|
|
|
// The coupling of this flag to thread safety exists because for other
|
|
|
|
|
// use cases failure is immediately fatal anyway.
|
|
|
|
|
bool isOk;
|
|
|
|
|
#endif
|
|
|
|
|
QMakeEvaluator *evaluator;
|
|
|
|
|
};
|
|
|
|
|
|
2012-05-02 18:34:25 +02:00
|
|
|
class QMAKE_EXPORT QMakeGlobals
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
QMakeGlobals();
|
|
|
|
|
~QMakeGlobals();
|
|
|
|
|
|
2012-06-08 17:56:45 +02:00
|
|
|
bool do_cache;
|
2012-05-02 18:34:25 +02:00
|
|
|
QString dir_sep;
|
|
|
|
|
QString dirlist_sep;
|
|
|
|
|
QString qmakespec;
|
2012-07-24 15:00:06 +02:00
|
|
|
QString xqmakespec;
|
2012-05-02 18:34:25 +02:00
|
|
|
QString cachefile;
|
|
|
|
|
#ifndef QT_BOOTSTRAPPED
|
|
|
|
|
QProcessEnvironment environment;
|
|
|
|
|
#endif
|
|
|
|
|
QString sysroot;
|
2012-06-18 18:16:50 +02:00
|
|
|
QString qmake_abslocation;
|
2012-06-18 18:13:33 +02:00
|
|
|
QString user_template, user_template_prefix;
|
2012-05-02 18:34:25 +02:00
|
|
|
|
|
|
|
|
// -nocache, -cache, -spec, QMAKESPEC
|
|
|
|
|
// -set persistent value
|
|
|
|
|
void setCommandLineArguments(const QStringList &args);
|
2012-07-25 19:10:07 +02:00
|
|
|
void setDirectories(const QString &input_dir, const QString &output_dir);
|
2012-05-02 18:34:25 +02:00
|
|
|
#ifdef PROEVALUATOR_INIT_PROPS
|
2012-06-18 18:16:50 +02:00
|
|
|
bool initProperties();
|
2012-06-18 17:42:20 +02:00
|
|
|
#else
|
|
|
|
|
void setProperties(const QHash<QString, QString> &props);
|
2012-05-02 18:34:25 +02:00
|
|
|
#endif
|
2012-08-03 15:57:46 +02:00
|
|
|
ProString propertyValue(const ProKey &name) const { return properties.value(name); }
|
2012-05-02 18:34:25 +02:00
|
|
|
|
2012-06-11 21:06:00 +02:00
|
|
|
QString expandEnvVars(const QString &str) const;
|
|
|
|
|
|
2012-05-02 18:34:25 +02:00
|
|
|
private:
|
|
|
|
|
QString getEnv(const QString &) const;
|
2012-05-04 15:23:11 +02:00
|
|
|
QStringList getPathListEnv(const QString &var) const;
|
2012-05-02 18:34:25 +02:00
|
|
|
|
2012-07-25 19:10:07 +02:00
|
|
|
QString source_root, build_root;
|
|
|
|
|
|
2012-05-02 18:34:25 +02:00
|
|
|
QString precmds, postcmds;
|
2012-08-03 15:57:46 +02:00
|
|
|
QHash<ProKey, ProString> properties;
|
2012-06-13 19:37:50 +02:00
|
|
|
|
2012-05-02 18:34:25 +02:00
|
|
|
#ifdef PROEVALUATOR_THREAD_SAFE
|
|
|
|
|
QMutex mutex;
|
|
|
|
|
#endif
|
2012-06-13 19:37:50 +02:00
|
|
|
QHash<QMakeBaseKey, QMakeBaseEnv *> baseEnvs;
|
2012-05-02 18:34:25 +02:00
|
|
|
|
2012-05-02 15:43:12 +02:00
|
|
|
friend class QMakeEvaluator;
|
2012-05-02 18:34:25 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
QT_END_NAMESPACE
|
|
|
|
|
|
|
|
|
|
#endif // QMAKEGLOBALS_H
|