[Interest] Require a qt_finalize_target() call in CMake user projects that use a static Qt

Joerg Bornemann joerg.bornemann at qt.io
Wed May 5 13:59:21 CEST 2021

On 5/5/21 1:32 PM, Marius Kittler wrote:

> to me the most important point is that I can still stay in control over which
> plugins are linked against and which not. At best I can turn off pulling
> plugins automatically completely to avoid bloating my applications and keep my
> own build system logic for deciding what plugins are needed.

IIUC what you want to do, you can set the QT_PLUGINS/QT_NO_PLUGINS 
properties on your target and specify the plugins you want to 
The code that does this for QtGui, for example, is in 

Our CMake API clearly lacks documentation, but we're working on it.

> To give you feedback on `qt_finalize_target()`: I would have no problem with
> an extra call and requiring an up-to-date CMake installation but don't forget
> to update the documentation and keep the use case of linking against plugins
> manually in mind.
 >> By the way, thanks for making this part of Qt's build system better! 
> mentioned that I had to patch Qt 5 a lot (so it can cope with all static
> dependencies correctly when using CMake) and with Qt 6 all of this is not
> necessary anymore. So despite the mentioned problems that's actually already a
> huge improvement.

Thanks for your feedback! Consider missing documentation as a bug that 
will be eventually fixed. :)



More information about the Interest mailing list