1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
3
4#ifndef PROFILEEVALUATOR_H
5#define PROFILEEVALUATOR_H
6
7#include "qmake_global.h"
8#include "qmakeglobals.h"
9#include "qmakeevaluator.h"
10#include "proitems.h"
11
12#include <QHash>
13#include <QStringList>
14
15QT_BEGIN_NAMESPACE
16
17class QMakeVfs;
18class QMakeParser;
19class QMakeEvaluator;
20class QMakeHandler;
21
22class QMAKE_EXPORT ProFileGlobals : public QMakeGlobals
23{
24public:
25 QString sysroot;
26};
27
28class QMAKE_EXPORT ProFileEvaluator
29{
30public:
31 enum TemplateType {
32 TT_Unknown = 0,
33 TT_Application,
34 TT_Library,
35 TT_Script,
36 TT_Aux,
37 TT_Subdirs
38 };
39
40 // Call this from a concurrency-free context
41 static void initialize();
42
43 ProFileEvaluator(ProFileGlobals *option, QMakeParser *parser, QMakeVfs *vfs,
44 QMakeHandler *handler);
45 ~ProFileEvaluator();
46
47 ProFileEvaluator::TemplateType templateType() const;
48#ifdef PROEVALUATOR_CUMULATIVE
49 void setCumulative(bool on); // Default is false
50#endif
51 void setExtraVars(const QHash<QString, QStringList> &extraVars);
52 void setExtraConfigs(const QStringList &extraConfigs);
53 void setOutputDir(const QString &dir); // Default is empty
54
55 bool loadNamedSpec(const QString &specDir, bool hostSpec);
56
57 bool accept(ProFile *pro, QMakeEvaluator::LoadFlags flags = QMakeEvaluator::LoadAll);
58
59 bool contains(const QString &variableName) const;
60 QString value(const QString &variableName) const;
61 QStringList values(const QString &variableName) const;
62 QStringList values(const QString &variableName, const ProFile *pro) const;
63 QStringList absolutePathValues(const QString &variable, const QString &baseDirectory) const;
64 QStringList absoluteFileValues(
65 const QString &variable, const QString &baseDirectory, const QStringList &searchDirs,
66 const ProFile *pro) const;
67 QString propertyValue(const QString &val) const;
68
69 QString resolvedMkSpec() const;
70
71private:
72 QString sysrootify(const QString &path, const QString &baseDir) const;
73
74 QMakeEvaluator *d;
75};
76
77QT_END_NAMESPACE
78
79#endif // PROFILEEVALUATOR_H
80

source code of qttools/src/linguist/shared/profileevaluator.h