diff options
author | Tobias Hunger <tobias.hunger@qt.io> | 2016-09-09 08:01:43 (GMT) |
---|---|---|
committer | Tobias Hunger <tobias.hunger@qt.io> | 2016-09-12 15:24:06 (GMT) |
commit | c73967cb4a0217b2d0825f67d6fd56af2b4d6b7f (patch) | |
tree | fba921dd4a139556673c520c9d7727ce572517db /Source/cmake.cxx | |
parent | 366e38284d0a111542a5c87ded6ad21fa641cb2c (diff) | |
download | CMake-c73967cb4a0217b2d0825f67d6fd56af2b4d6b7f.zip CMake-c73967cb4a0217b2d0825f67d6fd56af2b4d6b7f.tar.gz CMake-c73967cb4a0217b2d0825f67d6fd56af2b4d6b7f.tar.bz2 |
cmake: Introduce ReportCapabilitiesJson
Introduce cmake::ReportCapabilitiesJson which returns a the Json object
that is serialized in cmake::ReportCapabilities.
This allows to re-use the information in cmake-server.
Diffstat (limited to 'Source/cmake.cxx')
-rw-r--r-- | Source/cmake.cxx | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/Source/cmake.cxx b/Source/cmake.cxx index d6bea3d..4edf228 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -35,7 +35,7 @@ #if defined(CMAKE_BUILD_WITH_CMAKE) #include "cmGraphVizWriter.h" #include "cmVariableWatch.h" -#include <cm_jsoncpp_value.h> + #include <cm_jsoncpp_writer.h> #endif @@ -233,10 +233,9 @@ cmake::~cmake() delete this->FileComparison; } -std::string cmake::ReportCapabilities() const -{ - std::string result; #if defined(CMAKE_BUILD_WITH_CMAKE) +Json::Value cmake::ReportCapabilitiesJson() const +{ Json::Value obj = Json::objectValue; // Version information: Json::Value version = Json::objectValue; @@ -287,8 +286,16 @@ std::string cmake::ReportCapabilities() const #else obj["serverMode"] = false; #endif + return obj; +} +#endif + +std::string cmake::ReportCapabilities() const +{ + std::string result; +#if defined(CMAKE_BUILD_WITH_CMAKE) Json::FastWriter writer; - result = writer.write(obj); + result = writer.write(this->ReportCapabilitiesJson()); #else result = "Not supported"; #endif |