Commit 6696855f authored by Brad King's avatar Brad King

cmake: Simplify implementation of -E capabilities

The `cmake -E capabilities` command-line tool is implemented only in a
full-featured (non-bootstrap) CMake, and server mode is now always
available in this case.
parent 6b815e58
......@@ -630,7 +630,7 @@ cmServerResponse cmServerProtocol1::ProcessGlobalSettings(
Json::Value obj = Json::objectValue;
// Capabilities information:
obj[kCAPABILITIES_KEY] = cm->ReportCapabilitiesJson(true);
obj[kCAPABILITIES_KEY] = cm->ReportCapabilitiesJson();
obj[kDEBUG_OUTPUT_KEY] = cm->GetDebugOutput();
obj[kTRACE_KEY] = cm->GetTrace();
......
......@@ -248,7 +248,7 @@ Json::Value cmake::ReportVersionJson() const
return version;
}
Json::Value cmake::ReportCapabilitiesJson(bool haveServerMode) const
Json::Value cmake::ReportCapabilitiesJson() const
{
Json::Value obj = Json::objectValue;
......@@ -284,18 +284,18 @@ Json::Value cmake::ReportCapabilitiesJson(bool haveServerMode) const
generators.append(i.second);
}
obj["generators"] = generators;
obj["serverMode"] = haveServerMode;
obj["serverMode"] = true;
return obj;
}
#endif
std::string cmake::ReportCapabilities(bool haveServerMode) const
std::string cmake::ReportCapabilities() const
{
std::string result;
#if defined(CMAKE_BUILD_WITH_CMAKE)
Json::FastWriter writer;
result = writer.write(this->ReportCapabilitiesJson(haveServerMode));
result = writer.write(this->ReportCapabilitiesJson());
#else
result = "Not supported";
#endif
......
......@@ -136,9 +136,9 @@ public:
#if defined(CMAKE_BUILD_WITH_CMAKE)
Json::Value ReportVersionJson() const;
Json::Value ReportCapabilitiesJson(bool haveServerMode) const;
Json::Value ReportCapabilitiesJson() const;
#endif
std::string ReportCapabilities(bool haveServerMode) const;
std::string ReportCapabilities() const;
//@{
/**
......
......@@ -734,11 +734,7 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string> const& args)
return 1;
}
cmake cm(cmake::RoleInternal, cmState::Unknown);
#if defined(CMAKE_BUILD_WITH_CMAKE)
std::cout << cm.ReportCapabilities(true);
#else
std::cout << cm.ReportCapabilities(false);
#endif
std::cout << cm.ReportCapabilities();
return 0;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment