![]() ![]() CMake should have automatically created the directory build/.cmake/api/v1/reply containing the replies to our query.Īnd that’s it.Create the file build/.cmake/api/v1/query/codemodel-v2 and leave it empty. ![]() Create the API directory build/.cmake/api/v1/query.Navigate to your cmake project top-level directory.CMake provides the codemodel object kind which we can obtain through a simple stateless query.Īll cmake-file-api exchanges happen inside of /.cmake/api/. Retrieving a list of sources of a target is extremely easy. I’ll show an example here which should provide a good starting point. In this particular case, the files happen to contain JSON content.Īs with all of cmake’s documentation, it is extremely precise but doesn’t really provide a quick ‘getting started’ experience as it serves more as a very accurate reference manual than anything else. This means that we can create files to perform an API request and cmake will provide replies in form of files as well. As the name suggests, it’s a file based API to cmake. For this, the cmake-file-api (or formerly cmake-server) will come in handy. One of the most basic features is to parse the source files used by the opened “project”. Let’s say you’re writing your own IDE and you’d at least like to pretend that it comes with built-in cmake support. Today I’d like to show you how to retrieve information about the generated build system. It contains a multitude of features which often stay unexplored by the casual user. CMake has evolved to become quite a beast. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
January 2023
Categories |