I am trying to write a Yocto recipe for qthttpserver (https://github.com/qt-labs/qthttpserver, 5.15 branch). Here's what I have so far ('qthttpserver_5.15.bb'):
SUMMARY = "qthttpserver recipe"
DEPENDS = "qtbase qtwebsockets"
LICENSE = "GPL-3.0-only"
LIC_FILES_CHKSUM = "file://LICENSE.GPL3;md5=d32239bcb673463ab874e80d47fae504"
SRC_URI = "gitsm://github.com/qt-labs/qthttpserver.git;protocol=https;branch=5.15"
SRCREV = "52bce52413763ead7759f8c2e374a40bb82f058f"
S = "${WORKDIR}/git"
inherit qmake5
do_install() {
install -d ${libdir}
cp ${S}/lib/* ${libdir}/
}
FILES:${PN} += " \
${libdir}/* \
"
This fails with Project ERROR: Unknown module(s) in QT: sslserver (presumably because the sslserver subproject is not getting built first?).
If I try to manually run the build from a terminal (in the 'build' directory) with
../recipe-sysroot-native/usr/bin/qmake ../git/qthttpserver.pro -spec linux-g++
../recipe-sysroot-native/usr/bin/make -f Makefile qmake_all
then I get Project ERROR: Unknown module(s) in QT: gui. The 'gui' module is not referenced in the project anywhere that I can find.
If I try to manually run the build (from a terminal, in the 'build' directory) with the 'system' qmake
"/opt/Qt/5.15.2/gcc_64/bin/qmake" ../git/qthttpserver.pro -spec linux-g++
../recipe-sysroot-native/usr/bin/make -f Makefile qmake_all
then it builds fine.
What is going on here?
Solved by adding
require ../../../meta-qt5/recipes-qt/qt5/qt5.incto the recipe (and removinginherit qmake5, as it's included in qt5.inc in any case).Made some progress by setting
OE_QMAKE_RECURSIVE = ""but then was struggling with the installation part, and eventually realised that just requiring qt5.inc solved everything.