[Qt-creator] Suggestions for 'new class' dialog

Tobias Hunger tobias.hunger at gmail.com
Tue Dec 15 22:29:56 CET 2020


On Tue, Dec 15, 2020, 17:23 Kevin André <hyperquantum at gmail.com> wrote:

> I think it could be done without understanding the structure of a
> CMake file, but with some kind of pattern matching instead. Try to
> emulate what a person would do when a new file is to be added: find
> out where the pre-existing source files are in the CMake file, and
> insert the name of the new file using the same pattern used for the
> existing files.
>

This goes up in flames when the CMakeLists.txt file is in an unusual place.
But creator can error out and warn.

It also goes up in flames when several targets are defined in one
CMakeLists.txt file. Creator might add your file to the wrong target then
and has no way to notice this.

Adding files into cmake does not work as long as the tool doing the
insertion is able to understand cmake code. There is no way around that,
cmake projects differ to much from each other and best practices to make
anything else possible.

Best Regards,
Tobias
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/qt-creator/attachments/20201215/42d2c5c5/attachment.html>


More information about the Qt-creator mailing list