diff options
author | Tobias Hunger <tobias.hunger@qt.io> | 2016-09-28 17:25:29 +0200 |
---|---|---|
committer | Tobias Hunger <tobias.hunger@qt.io> | 2016-09-30 07:27:50 +0000 |
commit | 38b21ad04d7e4326d20d7f044d4411cc1ebebbc4 (patch) | |
tree | c2a891df38cd7803e3b37731a252d35b340ca003 /src/plugins/cmakeprojectmanager/cmaketool.h | |
parent | 8d608d2a74a86bf0f89616de5837e10bd66807f3 (diff) |
CMake: Report version information on cmake tool
Improve data retrieval from cmake while at it.
Change-Id: I0329804b800bb9c3b7e734246f795cfd6ae361fe
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Diffstat (limited to 'src/plugins/cmakeprojectmanager/cmaketool.h')
-rw-r--r-- | src/plugins/cmakeprojectmanager/cmaketool.h | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/src/plugins/cmakeprojectmanager/cmaketool.h b/src/plugins/cmakeprojectmanager/cmaketool.h index ab786fce95..7e6ff51bc9 100644 --- a/src/plugins/cmakeprojectmanager/cmaketool.h +++ b/src/plugins/cmakeprojectmanager/cmaketool.h @@ -52,6 +52,14 @@ public: AutoDetection }; + struct Version + { + int major = 0; + int minor = 0; + int patch = 0; + QByteArray fullVersion; + }; + class Generator { public: @@ -88,6 +96,7 @@ public: QList<Generator> supportedGenerators() const; TextEditor::Keywords keywords(); bool hasServerMode() const; + Version version() const; bool isAutoDetected() const; QString displayName() const; @@ -97,12 +106,20 @@ public: QString mapAllPaths(const ProjectExplorer::Kit *kit, const QString &in) const; private: + enum class QueryType { + GENERATORS, + SERVER_MODE, + VERSION + }; + void readInformation(QueryType type) const; + Utils::SynchronousProcessResponse run(const QStringList &args, bool mayFail = false) const; void parseFunctionDetailsOutput(const QString &output); QStringList parseVariableOutput(const QString &output); void fetchGeneratorsFromHelp() const; - void fetchGeneratorsFromCapabilities() const; + void fetchVersionFromVersionOutput() const; + void fetchFromCapabilities() const; Core::Id m_id; QString m_displayName; @@ -115,10 +132,14 @@ private: mutable bool m_didRun = false; mutable bool m_hasServerMode = false; + mutable bool m_queriedServerMode = false; + mutable bool m_triedCapabilities = false; + mutable QList<Generator> m_generators; mutable QMap<QString, QStringList> m_functionArgs; mutable QStringList m_variables; mutable QStringList m_functions; + mutable Version m_version; PathMapper m_pathMapper; }; |