meta-qt5
는 아주 minimal한 feature set만 enable.QtBase 옵션을 수정해, OpenGL ES2 지원을 원한다면, qtbase_git.bbappend
에 아래처럼 옵션추가
PACKAGECONFIG += "gles2"
${S}/mkspecs/oe-device-extra.pri
do_configure_prepend() {
cat > ${S}/mkspecs/oe-device-extra.pri <<EOF
QMAKE_LIBS_EGL += -lEGL -ldl -lglib-2.0 -lpthread
QMAKE_LIBS_OPENGL_ES2 += -lGLESv2 -lgsl -lEGL -ldl -lglib-2.0 -lpthread
QMAKE_CFLAGS += -DLINUX=1 -DWL_EGL_PLATFORM
QMAKE_CXXFLAGS += -DLINUX=1 -DWL_EGL_PLATFORM
QT_QPA_DEFAULT_PLATFORM = eglfs
EOF
}
$ git clone git://github.com/meta-qt5/meta-qt5.git
qtbase_%.bbappend
로 사용할 PACKAGECONFIG를 가져오자.
위와 같은 메커니즘으로, yocto build system에서는 PACKAGECONFIG를 다룬다.
$ bitbake qtbase -e | grep "^PACKAGECONFIG"
CMakeLists.txt
에 관련 내용이 있는 경우에만 해당된다.do_install_ptest
Errorptest
빼기방법 1. meta-tegra내 qtbase_%.bbappend 에서
# === /etc/profile.d/qt-qtpa.sh ==== #
export QT_QPA_PLATFORM=eglfs
export QT_QPA_EGLFS_INTEGRATION="eglfs_kms" # 혹은
export QT_QPA_EGLFS_INTEGRATION="eglfs_kms_egldevice"
systemd 가 시작 시, profile.d 내 파일을 실행하여 전역 환경변수가 먹힌다.
SUMMARY = "Start Qt-Demo application"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
SRC_URI += "file://qt_demo_start.service \
file://qt_demo_start.sh"
S = "${WORKDIR}"
inherit systemd
SYSTEMD_PACKAGES="${PN}"
do_install() {
install -d ${D}${sbindir}
install -m 0750 qt_demo_start.sh ${D}${sbindir}
install -d ${D}${systemd_system_unitdir}
install -m 0644 qt_demo_start.service ${D}${systemd_system_unitdir}
}
FILES:${PN} = "${sbindir} ${systemd_system_unitdir}"
SYSTEMD_SERVICE:${PN} = "qt_demo_start.service
[Unit]
Description=qt demo start service
After=multi-user.target
[Service]
Type=simple
#Environment=QT_QPA_EGLFS_FORCE888=1
Environment=QT_QPA_PLATFORM=linuxfb
#Environment=QT_QPA_EGLFS_FORCEVSYNC=1
#Environment=QT_PLUGIN_PATH=/usr/lib/qt5/plugins
#Environment=QT_QPA_EGLFS_INTEGRATION=eglfs_viv
#Environment=QT_QPA_EGLFS_FB=/dev/fbX # fbX - your framebuffer number
ExecStart=/usr/sbin/qt_demo_start.sh start
RemainAfterExit=true
ExecStop=/usr/sbin/qt_demo_start.sh stop
StandardOutput=journal
[Install]
WantedBy=multi-user.target
#!/bin/sh
start() {
/usr/share/qt5everywheredemo-1.0/QtDemo
}
stop() {
/usr/bin/killall QtDemo
}
case "$1" in
start|restart)
echo "Starting QtDemo"
stop
start
;;
stop)
echo "Stopping QtDemo"
stop
;;
esac