cmake -E server improves Visual Studio and Qt Creator IDEs

CMake 3.7 supports a new “server” mode. This work was originally prototyped by Stephen Kelly and is now led by Tobias Hunger (The Qt Company) to make it easier to develop tooling on top of CMake. The basic concept is to have a CMake process with which a JSON protocol can communicate.cmakeserver

The server mode has advantages over creating a link time application programming interface (API) to the CMake C++ code. Integrated development environments (IDEs) will be able to use different versions of CMake for different projects as long as they follow the same JSON protocol. The CMake C++ code will also not have to maintain backwards compatibility to any particular internal API.

This initial work has been picked up by both the Qt Creator team and the Microsoft Visual Studio team, who made announcements for Qt Creator and Visual Studio 2017 RC, respectively. It is exciting to see such great contributions to the CMake ecosystem! Both of these efforts are currently in the early development stage, but it is certainly nice to see the CMake IDE experience improved. Kitware will continue to facilitate and coordinate these efforts as they move forward.

If you use Visual Studio or Qt Creator, please give these new projects a try.  You can provide feedback on the cmake-developers mailing list or to the IDE development teams directly. You can download Visual Studio 2017 RC (complete with a copy of CMake) from https://www.visualstudio.com/downloads/. Qt Creator with CMake server support can be built from source and is included in the master git branch found on https://code.qt.io/cgit/qt-creator/qt-creator.git/. Finally, to get CMake 3.7, visit https://cmake.org/download.

 

4 comments to cmake -E server improves Visual Studio and Qt Creator IDEs

  1. Could you explain the purpose of a server mode? How is this different from the traditional way of generating visual studio projects?

  2. It will allow visual studio to talk directly to CMake, so that you can load a CMake project by simply pointing VS at a source tree with a CMakeLists.txt file. In addition you can edit the CMake files and VS can automatically re-run CMake. All in all it should be a smoother integration since VS will be fully aware of CMake. In addition they said that they could add support for the ninja generator as VS will not even need a VS project file to know about the project. Look at the announcement that they gave https://blogs.msdn.microsoft.com/vcblog/2016/11/16/cmake-support-in-visual-studio-the-visual-studio-2017-rc-update/ for more information.

  3. I’d really like to add source files and project properties in a visual studio solution and see that the corresponding cmake project is automatically updated. This will improve a lot my CMake development using Visual Studio. Is something possible with these new API?

  4. @jepessen, that’s an interesting suggestion. CMake-server provides a lot of potential for simplifying the Cmake experience in VS. As Cmake-server evolves, it should be possible for it to extract semantic information about CMake scripts that could then be used by VS to operate project changes like the ones you mentioned.

Leave a Reply