From aad9828dca8a61d1885f69ec4382df2f6d8d1e39 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Wed, 5 Jun 2019 15:05:29 +0200 Subject: [PATCH] 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 --- src/plugins/cmakeprojectmanager/cmaketool.cpp | 7 +++++++ src/plugins/cmakeprojectmanager/cmaketool.h | 1 + 2 files changed, 8 insertions(+) diff --git a/src/plugins/cmakeprojectmanager/cmaketool.cpp b/src/plugins/cmakeprojectmanager/cmaketool.cpp index ac0ac0999e9..4109d2cea10 100644 --- a/src/plugins/cmakeprojectmanager/cmaketool.cpp +++ b/src/plugins/cmakeprojectmanager/cmaketool.cpp @@ -248,6 +248,13 @@ bool CMakeTool::hasServerMode() const 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 { readInformation(QueryType::VERSION); diff --git a/src/plugins/cmakeprojectmanager/cmaketool.h b/src/plugins/cmakeprojectmanager/cmaketool.h index 85feaf41e5b..45af7ba329e 100644 --- a/src/plugins/cmakeprojectmanager/cmaketool.h +++ b/src/plugins/cmakeprojectmanager/cmaketool.h @@ -99,6 +99,7 @@ public: QList supportedGenerators() const; TextEditor::Keywords keywords(); bool hasServerMode() const; + bool hasFileApi() const; Version version() const; bool isAutoDetected() const;