summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorTobias Hunger <tobias.hunger@qt.io>2016-09-13 11:26:34 +0200
committerBrad King <brad.king@kitware.com>2016-09-19 08:57:57 -0400
commitb13d3e0d0b3c644242ef8dc4977d35da73398a9d (patch)
tree76312d0c8123d1053d4f98cd3c81edf7f860198d /CMakeLists.txt
parentcd049f012ef22f8f1214b35e351fda823d534b92 (diff)
downloadcmake-b13d3e0d0b3c644242ef8dc4977d35da73398a9d.tar.gz
cmake-server: Bare-bones server implementation
Adds a bare-bones cmake-server implementation and makes it possible to start that with "cmake -E server". Communication happens via stdin/stdout for now. Protocol is based on Json objects surrounded by magic strings ("[== CMake Server ==[" and "]== CMake Server ==]"), which simplifies Json parsing significantly. This patch also defines an interface used to implement different versions of the protocol spoken by the server, but does not include any protocol implementaiton.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt12
1 files changed, 12 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c8bd063dd0..2ec8b57223 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -702,6 +702,18 @@ endif()
# setup some Testing support (a macro defined in this file)
CMAKE_SETUP_TESTING()
+# Check whether to build server mode or not:
+set(CMake_HAVE_SERVER_MODE 0)
+if(NOT CMake_TEST_EXTERNAL_CMAKE AND NOT CMAKE_BOOTSTRAP AND CMAKE_USE_LIBUV)
+ list(FIND CMAKE_CXX_COMPILE_FEATURES cxx_auto_type CMake_HAVE_CXX_AUTO_TYPE)
+ list(FIND CMAKE_CXX_COMPILE_FEATURES cxx_range_for CMake_HAVE_CXX_RANGE_FOR)
+ if(CMake_HAVE_CXX_AUTO_TYPE AND CMake_HAVE_CXX_RANGE_FOR)
+ if(CMake_HAVE_CXX_MAKE_UNIQUE)
+ set(CMake_HAVE_SERVER_MODE 1)
+ endif()
+ endif()
+endif()
+
if(NOT CMake_TEST_EXTERNAL_CMAKE)
if(NOT CMake_VERSION_IS_RELEASE)
if(CMAKE_C_COMPILER_ID STREQUAL "GNU" AND