QtAV icon indicating copy to clipboard operation
QtAV copied to clipboard

QML plugin not being built in yocto (probably silently ignored due to unmet, non-essential dependencies)

Open brgl opened this issue 4 years ago • 3 comments

QtAV, Qt version and platform

QtAV revision is: 74943ea8f34d1c45e2dcae9810e3e25f5d4161c0 Qt version is: 5.14.2

Platform: The platform is a custom linux distribution built with yocto for a headless, embedded device. The target architecture is ARM64. The problem is however reproducible on Ubuntu 20.04 and probably on other systems too.

Reproduction steps

I was able to build QtAV on a Debian 10 system with no problems including the QML module.

However I'm trying to add a bitbake recipe for QtAV to yocto with the aim of eventually making it available upstream as part of meta-qt-extra layer. While I was able to satisfy all the dependencies needed to build the library, I noticed that a QML app using the QtAV QML fails: qrc:/main.qml:5:1: module "QtAV" is not installed.

This is because the QML plugin is not built, in fact the qml/ subdirectory is entirely ignored. I noticed that a fragment of the Makefile generated by qmake on my Debian machine looks like this:

SUBTARGETS    =  \
                sub-src-libQtAV-pro \
                sub-tools \
                sub-widgets-libQtAVWidgets-pro \
                sub-qml-libQmlAV-pro \
                sub-examples \
                sub-tests

But it misses the qml target on yocto:

SUBTARGETS    =  \
        sub-src-libQtAV-pro \
        sub-tools \
        sub-widgets-libQtAVWidgets-pro \
        sub-examples

I was however unable to determine which dependency is not met. While debugging I launched a clean Ubuntu 20.04 virtual machine and only installed the packages that caused qmake to fail one by one. I was able to reproduce the problem with the SUBDIRS variable being set like this:

SUBTARGETS    =  \
                sub-src-libQtAV-pro \
                sub-tools \
                sub-widgets-libQtAVWidgets-pro \
                sub-examples \
                sub-tests

qmake doesn't print any info that would point me towards the culprit, nor does looking at the .pro and .pri files. Could you advise on what exactly is needed for the build system to descend into the qml/ subdirectory and build the plugin?

brgl avatar Feb 23 '21 19:02 brgl

this line includes qml https://github.com/wang-bin/QtAV/blob/master/QtAV.pro#L16

You can check the condition.

wang-bin avatar Feb 24 '21 01:02 wang-bin

I saw this line before and made sure I have qtquick in every build environment. But since this must be the place that borks I started digging deeper - I removed the qtHaveModule() if and tried to build. The error message led me to a stackoverflow which explained I need qtdeclarative-dev for some reason and indeed this worked both on the VM as well as in Yocto. Maybe it's worth mentioning in README or adding a warning to qmake?

brgl avatar Feb 24 '21 09:02 brgl

Maybe it's worth mentioning in README or adding a warning to qmake?

good point

wang-bin avatar Feb 24 '21 10:02 wang-bin