summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Help/manual/cmake-server.7.rst8
-rw-r--r--Source/cmServerProtocol.cxx29
2 files changed, 19 insertions, 18 deletions
diff --git a/Help/manual/cmake-server.7.rst b/Help/manual/cmake-server.7.rst
index 1ddcb1b..0fed0b1 100644
--- a/Help/manual/cmake-server.7.rst
+++ b/Help/manual/cmake-server.7.rst
@@ -277,10 +277,6 @@ Giving the "major" version of the requested protocol version will make the serve
use the latest minor version of that protocol. Use this if you do not explicitly
need to depend on a specific minor version.
-If the build directory already contains a CMake cache, it is sufficient to set
-the "buildDirectory" attribute. To create a fresh build directory, additional
-attributes are required depending on the protocol version.
-
Protocol version 1.0 requires the following attributes to be set:
* "sourceDirectory" with a path to the sources
@@ -290,6 +286,10 @@ Protocol version 1.0 requires the following attributes to be set:
* "platform" with the generator platform (if supported by the generator)
* "toolset" with the generator toolset (if supported by the generator)
+Protocol version 1.2 makes all but the build directory optional, provided
+there is a valid cache in the build directory that contains all the other
+information already.
+
Example::
[== "CMake Server" ==[
diff --git a/Source/cmServerProtocol.cxx b/Source/cmServerProtocol.cxx
index c2dee8f..371d536 100644
--- a/Source/cmServerProtocol.cxx
+++ b/Source/cmServerProtocol.cxx
@@ -266,8 +266,8 @@ static void setErrorMessage(std::string* errorMessage, const std::string& text)
}
}
-static bool testHomeDirectory(cmState* state, std::string& value,
- std::string* errorMessage)
+static bool getOrTestHomeDirectory(cmState* state, std::string& value,
+ std::string* errorMessage)
{
const std::string cachedValue =
std::string(state->GetCacheEntryValue("CMAKE_HOME_DIRECTORY"));
@@ -288,9 +288,10 @@ static bool testHomeDirectory(cmState* state, std::string& value,
return true;
}
-static bool testValue(cmState* state, const std::string& key,
- std::string& value, const std::string& keyDescription,
- std::string* errorMessage)
+static bool getOrTestValue(cmState* state, const std::string& key,
+ std::string& value,
+ const std::string& keyDescription,
+ std::string* errorMessage)
{
const char* entry = state->GetCacheEntryValue(key);
const std::string cachedValue =
@@ -337,31 +338,31 @@ bool cmServerProtocol1::DoActivate(const cmServerRequest& request,
cmState* state = cm->GetState();
// Check generator:
- if (!testValue(state, "CMAKE_GENERATOR", generator, "generator",
- errorMessage)) {
+ if (!getOrTestValue(state, "CMAKE_GENERATOR", generator, "generator",
+ errorMessage)) {
return false;
}
// check extra generator:
- if (!testValue(state, "CMAKE_EXTRA_GENERATOR", extraGenerator,
- "extra generator", errorMessage)) {
+ if (!getOrTestValue(state, "CMAKE_EXTRA_GENERATOR", extraGenerator,
+ "extra generator", errorMessage)) {
return false;
}
// check sourcedir:
- if (!testHomeDirectory(state, sourceDirectory, errorMessage)) {
+ if (!getOrTestHomeDirectory(state, sourceDirectory, errorMessage)) {
return false;
}
// check toolset:
- if (!testValue(state, "CMAKE_GENERATOR_TOOLSET", toolset, "toolset",
- errorMessage)) {
+ if (!getOrTestValue(state, "CMAKE_GENERATOR_TOOLSET", toolset, "toolset",
+ errorMessage)) {
return false;
}
// check platform:
- if (!testValue(state, "CMAKE_GENERATOR_PLATFORM", platform, "platform",
- errorMessage)) {
+ if (!getOrTestValue(state, "CMAKE_GENERATOR_PLATFORM", platform,
+ "platform", errorMessage)) {
return false;
}
}