File indexing completed on 2024-05-05 04:40:21

0001 /*
0002     SPDX-License-Identifier: GPL-2.0-or-later
0003 */
0004 
0005 #ifndef QMAKECONFIG_H
0006 #define QMAKECONFIG_H
0007 
0008 #include <QHash>
0009 #include <QStringList>
0010 
0011 namespace KDevelop {
0012 class IProject;
0013 class Path;
0014 }
0015 
0016 class QMakeConfig
0017 {
0018 public:
0019     static const char CONFIG_GROUP[];
0020 
0021     static const char 
0022         QMAKE_EXECUTABLE[],
0023         BUILD_FOLDER[],
0024         INSTALL_PREFIX[],
0025         EXTRA_ARGUMENTS[],
0026         BUILD_TYPE[],
0027         ALL_BUILDS[];
0028 
0029     /**
0030      * Returns true when the given project is sufficiently configured.
0031      */
0032     static bool isConfigured(const KDevelop::IProject* project);
0033 
0034     /**
0035      * Returns the directory where srcDir will be built.
0036      * srcDir must contain a *.pro file !
0037      */
0038     static KDevelop::Path buildDirFromSrc(const KDevelop::IProject* project, const KDevelop::Path& srcDir);
0039 
0040     /**
0041      * Returns the QMake executable configured for the given @p project.
0042      */
0043     static QString qmakeExecutable(const KDevelop::IProject* project);
0044 
0045     /**
0046      * Query QMake and return the thus obtained QMake variables.
0047      */
0048     static QHash<QString, QString> queryQMake(const QString& qmakeExecutable, const QStringList& args = {});
0049 
0050     /**
0051      * Given the QMake variables, try to find a basic MkSpec.
0052      */
0053     static QString findBasicMkSpec( const QHash<QString,QString>& qmakeVars );
0054 };
0055 
0056 #endif