Update on CMake project support in Qt Creator
July 30, 2019 by Tobias Hunger | Comments
I have been busy improving the CMake support in Qt Creator for the last couple of weeks and thought I should take the time to highlight some of the new features.
Fileapi support
The CMake project has announced a new IDE integration mechanism with their 3.14 release called fileapi. It provides about the same level of information as the previous recommended mechanism (server-mode), but does not require a long-running cmake process. This makes the new approach use less resources while being more robust in the face of users running cmake on the command line.
"fileapi" is now supported in Qt Creator (master branch).
CMake support in the Locator
Creator has allowed to trigger the build of CMake targets via the locator for a while now. Simply do Ctrl-K
to focus the locator and then type cm <target>
to build that target.
In master branch this got a small extension: Typing cmo <target>
will open the definition of a target in the editor. This works best when your CMake binary supports fileapi: It will then take you to the exact line the target is defined at. Older CMake binaries will just open the CMakeLists.txt file in the target's source directory instead as there is no information on line numbers available.
Open targets via the Context menu
The same information that is used by the cmo
locator is used to populate a Open...
menu in the target's context menu. That allows to jump straight to lines relevant to the target definition.
Note that this feature has been available for one specific CMake version with server-mode support before, but the necessary support in CMake got removed again and only returned in the fileapi.
That is all I have to show today:-) Please test Qt Creator with CMake 3.14 or later and provide feedback and report bugs. Unfortunately there are currently no snapshots of Qt Creator taken from the master branch, those will only become available after Qt Creator 4.10RC release.
Thanks to Alessandro for demoing these features in a short video!
Blog Topics:
Comments
Subscribe to our newsletter
Subscribe Newsletter
Try Qt 6.5 Now!
Download the latest release here: www.qt.io/download.
Qt 6.5 is the latest Long-Term-Support release with all you need for C++ cross-platform app development.
Explore Qt World
Check our Qt demos and case studies in the virtual Qt World
We're Hiring
Check out all our open positions here and follow us on Instagram to see what it's like to be #QtPeople.
Näytä tämä julkaisu Instagramissa.Henkilön Qt (@theqtcompany) jakama julkaisu