[cmake-developers] cmake server mode

Tobias Hunger tobias.hunger at gmail.com
Thu Sep 29 00:55:13 EDT 2016


Hi Michele,

cmake -E server mode will always trigger something in cmake, so the
help will report that. I think it is nicer to report "Server mode
unavailable" when somebody attempts to run "cmake -E server" when that
is not available than to produce a "Unknown command".

To check whether or not server mode is available you can run "cmake -E
capabilities": That has a "serverMode" key with a boolean in its JSON
output. Easy to parse:-)

Gcc 4.8 should be new enough to enable it, there is only very light
C++11 usage, but I admit that I am not sure about MSVC2010.

Your build errors seem unrelated to server-mode.

Best Regards,
Tobias

On Thu, Sep 29, 2016 at 1:18 AM, michele pagot <michele.pagot at hotmail.it> wrote:
> I'm interested in the cmake server mode. I've started from
> https://steveire.wordpress.com/2016/01/24/cmake-daemon-for-user-tools/ and
> then to  https://github.com/steveire/CMake.git and finally to the cmake
> official  git master branch as it seems e
>
> I rebuilt it from scratch on Windows trying both VS2010 and MinGW. With this
> second one, using gcc4.8. Everything seems fine as the build works as
> expected and
>
> the inline help report server mode with both compilers.
>
>
>>> c:\......\cmake\cmake_master\build\buils_vs2010\bin\Debug\cmake.exe -E
>> CMake Error: cmake version 3.6.20160928-g9a9b9
>> Usage:
>> c:\.......\cmake\cmake_master\build\buils_vs2010\bin\Debug\cmake.exe -E
>> <command> [arguments...]
>> Available commands:
>>   capabilities              - Report capabilities built into cmake in JSON
>> format
>>   chdir dir cmd [args...]   - run command in a given directory
>>   compare_files file1 file2 - check if file1 is same as file2
>>   copy <file>... destination  - copy files to destination (either file or
>> directory)
>>   copy_directory <dir>... destination   - copy content of <dir>...
>> directories to 'destination' directory
>>   copy_if_different <file>... destination  - copy files if it has changed
>>   echo [<string>...]        - displays arguments as text
>>   echo_append [<string>...] - displays arguments as text but no new line
>>   env [--unset=NAME]... [NAME=VALUE]... COMMAND [ARG]...
>>                             - run command in a modified environment
>>   environment               - display the current environment
>>   make_directory <dir>...   - create parent and <dir> directories
>>   md5sum <file>...          - create MD5 checksum of files
>>   remove [-f] <file>...     - remove the file(s), use -f to force it
>>   remove_directory dir      - remove a directory and its contents
>>   rename oldname newname    - rename a file or directory (on one volume)
>>   server                    - start cmake in server mode
>>   sleep <number>...         - sleep for given number of seconds
>
>
> but as I try to use it:
>
>>> cmake -E server
>> CMake Error: CMake was not built with server mode enabled
>>
> First issue: server reported in the help even if not included
>
>
> the  new feature seems to be activated only if some special compiler
> capability are fulfilled. So I've changed compiler to gcc5.3 and now I'm
> even nor able to build due to errors like:
>
>
> [  2%] Building CXX object
> Source/kwsys/CMakeFiles/cmsys.dir/RegularExpression.cxx.obj
>
> [  2%] Building CXX object
> Source/kwsys/CMakeFiles/cmsys.dir/SystemTools.cxx.obj
>
> c:/userdata/draft/cmake/cmake_master/cmake/Source/kwsys/SystemTools.cxx: In
> member function 'bool cmsys::SystemToolsPathCaseCmp::operator()(const
> string&, const string&) const':
>
> c:/userdata/draft/cmake/cmake_master/cmake/Source/kwsys/SystemTools.cxx:465:43:
> error: 'strcasecmp' was not declared in this scope
>
>      return strcasecmp(l.c_str(), r.c_str()) < 0;
>
>                                            ^
>
> c:/userdata/draft/cmake/cmake_master/cmake/Source/kwsys/SystemTools.cxx: In
> static member function 'static bool cmsys::SystemTools::ComparePath(const
> string&, const string&)':
>
> c:/userdata/draft/cmake/cmake_master/cmake/Source/kwsys/SystemTools.cxx:4289:43:
> error: 'strcasecmp' was not declared in this scope
>
>    return strcasecmp(c1.c_str(), c2.c_str()) == 0;
>
>                                            ^
>
> make[2]: *** [Source/kwsys/CMakeFiles/cmsys.dir/SystemTools.cxx.obj] Error 1
>
> make[1]: *** [Source/kwsys/CMakeFiles/cmsys.dir/all] Error 2
>
> make: *** [all] Error 2
>
>
>
> Fixed by:
>
> #endif
>
> #include <stdio.h>
>
> #include <stdlib.h>
>
> #include <string>
>
> #include <strings.h>
>
> #include <sys/stat.h>
>
>
>
>
>
>
>
>
>
>
>
> c:/userdata/draft/cmake/cmake_master/cmake/Utilities/cmlibarchive/libarchive/archive_read.c:825:1:
> error: conflicting types for 'archive_read_data'
>  archive_read_data(struct archive *_a, void *buff, size_t s)
>  ^
> In file included from
> c:/userdata/draft/cmake/cmake_master/cmake/Utilities/cmlibarchive/libarchive/archive_read.c:51:0:
> c:/userdata/draft/cmake/cmake_master/cmake/Utilities/cmlibarchive/libarchive/archive.h:581:24:
> note: previous declaration of 'archive_read_data' was here
>  __LA_DECL la_ssize_t   archive_read_data(struct archive *,
>                         ^
> make[2]: ***
> [Utilities/cmlibarchive/libarchive/CMakeFiles/cmlibarchive.dir/archive_read.c.obj]
> Error 1
> make[1]: ***
> [Utilities/cmlibarchive/libarchive/CMakeFiles/cmlibarchive.dir/all] Error 2
> make: *** [all] Error 2
>
>
>
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more
> information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/cmake-developers


More information about the cmake-developers mailing list