Priority: P3: Somewhat important
Affects Version/s: 6.4.0 FF
Fix Version/s: None
Component/s: Build System: CMake
I bumped into this problem in QtPositioning.
QtPositioning completely relies on plugins, because they provide various positioning backends. The module is simply non-functional without them. For the purpose of testing the module has several test plugins that are located directly in the tests build tree.
According to the documentation, for static builds we need to use
to explicitly specify that this application/test need to link to specific plugins.
However using them reveals some problems.
For the in-tree build I used the following config:
it is documented that qt_import_qml_plugins() calls qmlimportscanner to determine which plugins we actually need to import and link. But in the in-tree build qmlimportscanner is not yet built by the time we want to use it. This results in the following error:
For out-of-tree build I used the following config:
and after that built the tests in a separate directory using
The issue here is that the plugins to be imported are taken from the installation dir, but the custom test plugins are simply not yet installed at the time of configuring. So we will never find and link them.
So for now it looks like in the static configuration there is no way to build tests for the modules that use custom test-specific plugins.
This problem currently affects at least QtPositioning and QtLocation.