I’ve been working for quite some time on a daemon mode for CMake in order to make it easier to build advanced tooling for CMake. I made a video about this today:
The general idea is that CMake is started as a long-running process, and can then be communicated with via a JSON protocol.
So, for example, a client sends a request like
{ "type": "code_completion_at", "line": 50, "path": "/home/stephen/dev/src/cmake-browser/CMakeLists.txt", "column": 7 }
and the daemon responds with
{ "completion":{ "commands":[ "target_compile_definitions", "target_compile_features", "target_compile_options", "target_include_directories", "target_link_libraries", "target_sources" ], "matcher":"target_" } }
Many more features are implemented such as semantic annotation, variable introspection, contextual help etc, all without the client having to implement it themselves.
Aside from the daemon, I implemented a Qt client making use of all of the features, and a Kate plugin to use the debugging features in that editor. This is the subject of my talk at FOSDEM, which I previewed in Berlin last week.
Come to my talk there to learn more!
January 25, 2016 at 5:37 pm |
Awesome. I’ve been waiting for something like this for a long time! Do you have a link to a Qt Creator bug report for the task of integrating this work with Qt Creator?
January 25, 2016 at 8:41 pm |
The discussion about this on Qt Creator mailing list: http://lists.qt-project.org/pipermail/qt-creator/2016-January/thread.html#5298
January 25, 2016 at 8:44 pm
Here’s a readable link: http://thread.gmane.org/gmane.comp.lib.qt.creator/11794
Taylor Braun-Jones is on the cmake list anyway though, and probably followed the discussion there.
January 25, 2016 at 11:54 pm |
Very interesting where can I find more about this topic? Unfortunately I will not come at FOSDEM. If there will be any video of your talk available please let me know
January 26, 2016 at 7:49 pm |
There is more design discussion here: http://thread.gmane.org/gmane.comp.programming.tools.cmake.devel/12658 . Much of it is out of date after I switched to making a daemon instead of generating metadata files, but the goals section still has valid content.
January 26, 2016 at 10:11 am |
[…] CMake Daemon for user tools […]
April 2, 2016 at 6:03 pm |
Very nice! I hope the CMake refactoring mentioned here http://article.gmane.org/gmane.comp.programming.tools.cmake.devel/15741 allows functionality like this to be integrated soon! I’m exploring cmake-daemon for purposes of C++ JIT in an IDE. Since I need link information I added to Source/cmServerProtocol.cxx ProcessTargetInfo():
+ auto link_info = tgt->GetLinkInformation(config);
+ root[“link_language”] = link_info->GetLinkLanguage();
+ Json::Value& out_link_libs = root[“link_libraries”] = Json::arrayValue;
+ auto link_libs = tgt->GetLinkImplementationLibraries(config);
+ for (auto const& it : link_libs->Libraries) out_link_libs.append(it);
April 11, 2016 at 9:57 pm |
Cool. I’ve made a note to add something like that to the cmake-daemon. Do you want to collaborate more on it on github?
October 5, 2016 at 11:46 pm |
[…] first initiative, in the CMake community, was the CMake-server prototype developed initially by Stephen Kelly to improve the tooling story for CMake. This started some […]
November 15, 2016 at 1:08 pm |
[…] The Qt Creator team has had contact with the CMake communinity for a long time now and was actively involved in discussions with CMake and other IDE and tools vendors. After many discussions the CMake community decided that the best way forward to support the use-cases of IDEs was to add a new interactive way to interact with CMake, the so called server-mode. There was some initial development started by Stephen Kelly, who made an impressive prototype. […]
March 11, 2017 at 10:59 am |
Hi !
I have now started to develop alternative to cmake, project called syncproj. Here is a documentation in case if you’re interested:
https://docs.google.com/document/d/1C1YrbFUVpTBXajbtrC62aXru2om6dy5rClyknBj5zHU/edit
Main advantage over cmake is that it’s based upon C#, and can be executed as C# script. So you can debug project building if you want.
Also first time migration (project to .cs) is also supported, and after that you can simply mimic what is written in .cs script.
July 20, 2018 at 11:38 am |
Hi,
Is it a way to download your Qt client ?
Thank you,
May 8, 2019 at 3:36 am |
[…] first initiative, in the CMake community, was the CMake-server prototype developed initially by Stephen Kelly to improve the tooling story for CMake. This started some […]
February 23, 2023 at 10:01 am |
[…] there are the steveire’s CMake Daemon Tools. I haven’t used them myself, but they claim to offer possibilities for introspection that seem to […]