diff options
author | Tobias Hunger <tobias.hunger@qt.io> | 2016-09-09 08:01:45 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2016-09-26 18:33:12 (GMT) |
commit | 890432672bc9fe91365e5e5305285ab193e9060a (patch) | |
tree | 8df978e8e6a678ccd53940915d699decbd94da74 /Source/cmServerProtocol.cxx | |
parent | 0a8ad6700eb7f54961271b3ee7b41add61eb0be5 (diff) | |
download | CMake-890432672bc9fe91365e5e5305285ab193e9060a.zip CMake-890432672bc9fe91365e5e5305285ab193e9060a.tar.gz CMake-890432672bc9fe91365e5e5305285ab193e9060a.tar.bz2 |
server-mode: Add command to compute the build system
Diffstat (limited to 'Source/cmServerProtocol.cxx')
-rw-r--r-- | Source/cmServerProtocol.cxx | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/Source/cmServerProtocol.cxx b/Source/cmServerProtocol.cxx index 06f5177..134edf3 100644 --- a/Source/cmServerProtocol.cxx +++ b/Source/cmServerProtocol.cxx @@ -280,6 +280,9 @@ const cmServerResponse cmServerProtocol1_0::Process( { assert(this->m_State >= STATE_ACTIVE); + if (request.Type == kCOMPUTE_TYPE) { + return this->ProcessCompute(request); + } if (request.Type == kCONFIGURE_TYPE) { return this->ProcessConfigure(request); } @@ -298,6 +301,26 @@ bool cmServerProtocol1_0::IsExperimental() const return true; } +cmServerResponse cmServerProtocol1_0::ProcessCompute( + const cmServerRequest& request) +{ + if (this->m_State > STATE_CONFIGURED) { + return request.ReportError("This build system was already generated."); + } + if (this->m_State < STATE_CONFIGURED) { + return request.ReportError("This project was not configured yet."); + } + + cmake* cm = this->CMakeInstance(); + int ret = cm->Generate(); + + if (ret < 0) { + return request.ReportError("Failed to compute build system."); + } + m_State = STATE_COMPUTED; + return request.Reply(Json::Value()); +} + cmServerResponse cmServerProtocol1_0::ProcessConfigure( const cmServerRequest& request) { |