I have a working cross-compile setup with Qt Creator and the qt5 toolchain.
Now i would like to integrate the application directly into the image build process. We have a QT5 application, using the qt-plugins serialport and websockets. The application itself runs perfectly on our modified linux system (so all libs are included).
Unfortunately, there aren’t much examples out there, but from some recipes in different layers I was able to create the following recipe:
SUMMARY = "App"
LICENSE = "CLOSED"
PR = "2.0"
DEPEMDS = "qtbase qtbase-plugins qtdeclarative qtdeclarative-plugins qtserialport qtwebsockets"
inherit systemd cmake_qt5
SRCREV = "21af9a4e4a8237f78719d57bb659c4453dc77050"
SRC_URI = "git://git@gitlab.com/USERNAME/REPO.git;protocol=ssh;branch=master"
SRC_URI += "file://start-app.sh \
file://app.service \
"
S = "${WORKDIR}/git"
require recipes-qt/qt5/qt5.inc
do_install () {
install -d ${D}${systemd_unitdir}/system/ ${D}${sysconfdir}/systemd/system/
install -m 0644 ${WORKDIR}/app.service ${D}${systemd_unitdir}/system/app.service
ln -s /dev/null ${D}${sysconfdir}/systemd/system/getty@tty1.service
}
NATIVE_SYSTEMD_SUPPORT = "1"
SYSTEMD_PACKAGE = "${PN}"
SYSTEMD_SERVICE_${PN} = "app.service"
Somehow, during the build process, the qt plugins serialport and websockets cannot be found:
ERROR: app-1.0-2.0 do_configure: Error calling /home/christian/oe-core-2.8b3/build/tmp-glibc/work/cortexa9t2hf-neon-angstrom-linux-gnueabi/app/1.0-2.0/recipe-sysroot-native/usr/bin/qt5/qmake -makefile -o Makefile /home/christian/oe-core-2.8b3/build/tmp-glibc/work/cortexa9t2hf-neon-angstrom-linux-gnueabi/app/1.0-2.0/git/APP.pro --
ERROR: app-1.0-2.0 do_configure: Function failed: do_configure (log file is located at /home/christian/oe-core-2.8b3/build/tmp-glibc/work/cortexa9t2hf-neon-angstrom-linux-gnueabi/app/1.0-2.0/temp/log.do_configure.864)
ERROR: Logfile of failure stored in: /home/christian/oe-core-2.8b3/build/tmp-glibc/work/cortexa9t2hf-neon-angstrom-linux-gnueabi/app/1.0-2.0/temp/log.do_configure.864
Log data follows:
| DEBUG: Executing shell function qmake5_base_preconfigure
| DEBUG: Shell function qmake5_base_preconfigure finished
| DEBUG: Executing shell function do_configure
| NOTE: qmake prevar substitution: ' '
| Project ERROR: Unknown module(s) in QT: websockets serialport
| ERROR: Error calling /home/christian/oe-core-2.8b3/build/tmp-glibc/work/cortexa9t2hf-neon-angstrom-linux-gnueabi/app/1.0-2.0/recipe-sysroot-native/usr/bin/qt5/qmake -makefile -o Makefile /home/christian/oe-core-2.8b3/build/tmp-glibc/work/cortexa9t2hf-neon-angstrom-linux-gnueabi/app/1.0-2.0/git/APP.pro --
| WARNING: exit code 1 from a shell command.
| ERROR: Function failed: do_configure (log file is located at /home/christian/oe-core-2.8b3/build/tmp-glibc/work/cortexa9t2hf-neon-angstrom-linux-gnueabi/app/1.0-2.0/temp/log.do_configure.864)
ERROR: Task (/home/christian/oe-core-2.8b3/build/../layers/meta-company/recipes-company/app/app.bb:do_configure) failed with exit code '1'
NOTE: Tasks Summary: Attempted 1785 tasks of which 1784 didn't need to be rerun and 1 failed.
NOTE: Writing buildhistory
Summary: 1 task failed:
/home/christian/oe-core-2.8b3/build/../layers/meta-company/recipes-company/app/app.bb:do_configure
Summary: There was 1 WARNING message shown.
Summary: There were 2 ERROR messages shown, returning a non-zero exit code.
What I am doing wrong? Did I missed something? Do I need to set additional dependencies?
BR Christian