CMake: Detect fileapi in cmake

Detect whether cmake supports fileapi or not. This is based on the
version number since cmake upstream does not want to add a flag into
the capabilities output:-/

Change-Id: I036adf65cbd1b171f0f98a7c86230a7ca33fff32
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
Tobias Hunger
2019-06-05 15:05:29 +02:00
parent 6a3ec1928c
commit aad9828dca
2 changed files with 8 additions and 0 deletions

View File

@@ -248,6 +248,13 @@ bool CMakeTool::hasServerMode() const
return m_introspection->m_hasServerMode; return m_introspection->m_hasServerMode;
} }
bool CMakeTool::hasFileApi() const
{
readInformation(QueryType::VERSION);
return m_introspection->m_version.major > 3
|| (m_introspection->m_version.major == 3 && m_introspection->m_version.minor >= 14);
}
CMakeTool::Version CMakeTool::version() const CMakeTool::Version CMakeTool::version() const
{ {
readInformation(QueryType::VERSION); readInformation(QueryType::VERSION);

View File

@@ -99,6 +99,7 @@ public:
QList<Generator> supportedGenerators() const; QList<Generator> supportedGenerators() const;
TextEditor::Keywords keywords(); TextEditor::Keywords keywords();
bool hasServerMode() const; bool hasServerMode() const;
bool hasFileApi() const;
Version version() const; Version version() const;
bool isAutoDetected() const; bool isAutoDetected() const;