Good afternoon,
CMakeProjectManager2 is a fork of the original Qt Creator plugin to support the CMake build system. The sluggish history of this project has been going on since 2011 (my first blog post:
htrd.su/wiki/zhurnal/2011-03-24_14.49_qt_creator_i_cmake_-_prodolzhenie , second update from 2012:
htrd.su/wiki/zhurnal/2012/ 10/17 / cmakeprojectmanager2 _-_ poslednie_izmenenija ). Since then, nothing new has been added. Compatibility with the latest versions of Qt Creator was provided, the repository moved to GitHub (as an experiment).
But yesterday and today several more changes were added, which was the reason to mention the project on Habré.
So, the initial changes have added not so much functionality, namely:
- The structure of the project files is taken not from the .cbp file, but by scanning the project tree. As an option, it can be slow on large projects, on the other hand, tree reloading does not occur every time, but when changing CMakeLists.txt or adding, deleting, renaming files (this is not the case, by the way, in the base plugin)
- Now you can create new files in the project tree directly from Qt Creator
- Now you can rename files
- Now you can delete files from disk
At the same time, the idea of ​​adding support for parsing CMakeFiles.txt to the plugin, bypassing launching CMake and generating the .cbp file, came to the fore. But (looking ahead), this idea remained an idea: a parser and a tokenizer were written separately based on CMake source code, but the developments have sunk into oblivion along with the next screw collapse. Before integration into the plugin has not reached.
')
The second package of changes was added in 2012, included the following features and fixes:
- For each assembly profile, the entered parameters for CMake are saved, so choosing the next time “Run CMake” does not need to remember with what parameters you started it and it is easier to manage the assembly profiles. Together with the latest feature from the Upstream: saving the global history of parameters for CMake, it turns out to be quite a powerful mechanism.
- Using the above information, it became possible when updating the source tree (adding, deleting, renaming) in the background to start updating the CBP file and the assembly tree, which is especially important when using globbing.
- Compared with the first option, it turned out to significantly reduce the memory consumption when using the plugin, especially when there are many auxiliary modules in the project tree, temporary C / C ++ code.
Starting from this version, you can quite comfortably use CMake if the list of files is based on globing, i.e. if the list is given by mask, like this:
When you add a file through Qt Creator, the cache is automatically updated and the file is seen in the tree, the build system and the C ++ parser.
Since then, the code base has only been synchronized with the upstream (in fact, there are no major changes relative to it). For the first version, an attempt was made to submit a merge request, but was hacked away because of the display of all the files, instead of those that are somehow written in CMakeLists.txt. After this attempt ceased. Those who want to push through part or all of the changes - well!
But it so happened that there was a need for cross-compiling CMake projects from the depths of Qt Creator. This is not difficult to do, it is enough to issue a Toolchain file (
more info) and pass it through a special parameter to the cmake process. It is inconvenient only to register the parameters by hand.
So there were changes which appeared today in a repository:
- Added the ability to choose the type of assembly
- Added ability to assign toolchain
Yes, there are not many changes, but I think this is not important. It is important that it became a little more convenient and easier.
In fact, these parameters are used to set the parameters for CMake in a more friendly form: -DCMAKE_BUILD_TYPE = and -DCMAKE_TOOLCHAIN_FILE, respectively.
About tulchan a little more. Initially planned three ways to set it:
- Automatic construction based on Qt Creator Kit (now this knowledge is used only by the parser, cmake can easily find any other suitable compiler and use it for building)
- Manual setting of the file (so far made without the possibility of opening the search dialog, only manual input: issue # 2 )
- "Inline" toolchain: edits in the built-in editor, when launched, the content is saved in the tweak directory under the name QtCreator-toolchain-override.cmake
For now, the Qt Creator Kit-based option is turned off (
issue # 4 ).
Plus, there is a nuance: according to the CMake documentation, a change of the toolchain is possible only on a new configuration or on a full cleaning of the current one (delete CMakeFiles and CMakeCache.txt), therefore, if changes of the toolchain are noticed, a full reconfiguration is made without using a cache. I plan to add a dialog with a warning (
issue # 1 ).
It should be noted that the user input of parameters is saved, moreover, it is determined that if the parameter is already set, then the user input will be used.
Well, the picture, what it looks like:

If it seems useful to someone, I will be glad. Especially I will be glad to pull requests with fixing bugs and implementing new features. The reports are also good, but according to the development trend of the project you can understand: there is not much time for it, so the reaction can be from “slow” to “ooooochen slow”.
UPD / 2015-07-18 /: Made the PPA for Ubuntu 14.04 / Mint 17.x with QtC from git [master] and CMakeProjectManager2:
launchpad.net/~adrozdoff/+archive/ubuntu/qtcreator-git