mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-02 11:49:55 -06:00
cmake: Factor json version object construction into helper
This commit is contained in:
@@ -225,10 +225,8 @@ cmake::~cmake()
|
||||
}
|
||||
|
||||
#if defined(CMAKE_BUILD_WITH_CMAKE)
|
||||
Json::Value cmake::ReportCapabilitiesJson(bool haveServerMode) const
|
||||
Json::Value cmake::ReportVersionJson() const
|
||||
{
|
||||
Json::Value obj = Json::objectValue;
|
||||
// Version information:
|
||||
Json::Value version = Json::objectValue;
|
||||
version["string"] = CMake_VERSION;
|
||||
version["major"] = CMake_VERSION_MAJOR;
|
||||
@@ -236,8 +234,15 @@ Json::Value cmake::ReportCapabilitiesJson(bool haveServerMode) const
|
||||
version["suffix"] = CMake_VERSION_SUFFIX;
|
||||
version["isDirty"] = (CMake_VERSION_IS_DIRTY == 1);
|
||||
version["patch"] = CMake_VERSION_PATCH;
|
||||
return version;
|
||||
}
|
||||
|
||||
obj["version"] = version;
|
||||
Json::Value cmake::ReportCapabilitiesJson(bool haveServerMode) const
|
||||
{
|
||||
Json::Value obj = Json::objectValue;
|
||||
|
||||
// Version information:
|
||||
obj["version"] = this->ReportVersionJson();
|
||||
|
||||
// Generators:
|
||||
std::vector<cmake::GeneratorInfo> generatorInfoList;
|
||||
|
||||
@@ -128,6 +128,7 @@ public:
|
||||
~cmake();
|
||||
|
||||
#if defined(CMAKE_BUILD_WITH_CMAKE)
|
||||
Json::Value ReportVersionJson() const;
|
||||
Json::Value ReportCapabilitiesJson(bool haveServerMode) const;
|
||||
#endif
|
||||
std::string ReportCapabilities(bool haveServerMode) const;
|
||||
|
||||
Reference in New Issue
Block a user