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.
This commit is contained in:
parent
366e38284d
commit
c73967cb4a
|
@ -35,7 +35,7 @@
|
||||||
#if defined(CMAKE_BUILD_WITH_CMAKE)
|
#if defined(CMAKE_BUILD_WITH_CMAKE)
|
||||||
#include "cmGraphVizWriter.h"
|
#include "cmGraphVizWriter.h"
|
||||||
#include "cmVariableWatch.h"
|
#include "cmVariableWatch.h"
|
||||||
#include <cm_jsoncpp_value.h>
|
|
||||||
#include <cm_jsoncpp_writer.h>
|
#include <cm_jsoncpp_writer.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -233,10 +233,9 @@ cmake::~cmake()
|
||||||
delete this->FileComparison;
|
delete this->FileComparison;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string cmake::ReportCapabilities() const
|
|
||||||
{
|
|
||||||
std::string result;
|
|
||||||
#if defined(CMAKE_BUILD_WITH_CMAKE)
|
#if defined(CMAKE_BUILD_WITH_CMAKE)
|
||||||
|
Json::Value cmake::ReportCapabilitiesJson() const
|
||||||
|
{
|
||||||
Json::Value obj = Json::objectValue;
|
Json::Value obj = Json::objectValue;
|
||||||
// Version information:
|
// Version information:
|
||||||
Json::Value version = Json::objectValue;
|
Json::Value version = Json::objectValue;
|
||||||
|
@ -287,8 +286,16 @@ std::string cmake::ReportCapabilities() const
|
||||||
#else
|
#else
|
||||||
obj["serverMode"] = false;
|
obj["serverMode"] = false;
|
||||||
#endif
|
#endif
|
||||||
|
return obj;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
std::string cmake::ReportCapabilities() const
|
||||||
|
{
|
||||||
|
std::string result;
|
||||||
|
#if defined(CMAKE_BUILD_WITH_CMAKE)
|
||||||
Json::FastWriter writer;
|
Json::FastWriter writer;
|
||||||
result = writer.write(obj);
|
result = writer.write(this->ReportCapabilitiesJson());
|
||||||
#else
|
#else
|
||||||
result = "Not supported";
|
result = "Not supported";
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -24,6 +24,10 @@
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
|
#if defined(CMAKE_BUILD_WITH_CMAKE)
|
||||||
|
#include "cm_jsoncpp_value.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
class cmExternalMakefileProjectGeneratorFactory;
|
class cmExternalMakefileProjectGeneratorFactory;
|
||||||
class cmFileTimeComparison;
|
class cmFileTimeComparison;
|
||||||
class cmGlobalGenerator;
|
class cmGlobalGenerator;
|
||||||
|
@ -118,6 +122,9 @@ public:
|
||||||
/// Destructor
|
/// Destructor
|
||||||
~cmake();
|
~cmake();
|
||||||
|
|
||||||
|
#if defined(CMAKE_BUILD_WITH_CMAKE)
|
||||||
|
Json::Value ReportCapabilitiesJson() const;
|
||||||
|
#endif
|
||||||
std::string ReportCapabilities() const;
|
std::string ReportCapabilities() const;
|
||||||
|
|
||||||
static const char* GetCMakeFilesDirectory() { return "/CMakeFiles"; }
|
static const char* GetCMakeFilesDirectory() { return "/CMakeFiles"; }
|
||||||
|
|
Loading…
Reference in New Issue