|
|
(8 intermediate revisions by 2 users not shown) |
Line 1: |
Line 1: |
| {{PageHeader|VAR-SOM-MX6 - QT5 Hello World}} {{DocImage|category1=VAR-SOM-MX6|category2=Yocto}} __toc__ | | {{PageHeader|VAR-SOM-MX6 - QT5 Hello World}} {{DocImage|category1=VAR-SOM-MX6|category2=Yocto}} __toc__ |
| | | Please follow the QT creator guide: https://variwiki.com/index.php?title=File:YoctoQtCreator.pdf<br> |
| = Build and install tools =
| | In addition:<br> |
| <pre>
| | https://wiki.qt.io/Basic_Qt_Programming_Tutorial<br> |
| $ cd ~/var-som-mx6-yocto-fido/
| | https://wiki.qt.io <br> |
| $ . ./setup-environment build_x11
| | http://doc.qt.io/qtcreator/creator-tutorials.html<br> |
| </pre>
| | http://doc.qt.io/qt-5/qtexamplesandtutorials.html<br> |
| edit local.conf and add to the bottom:
| |
| <pre>
| |
| #
| |
| EXTRA_IMAGE_FEATURES = "debug-tweaks tools-debug eclipse-debug"
| |
| </pre> | |
| Build:
| |
| <pre> | |
| $ bitbake meta-toolchain-qt5
| |
| </pre>
| |
| Install:
| |
| <pre>
| |
| $ tmp/deploy/sdk/poky-glibc-x86_64-meta-toolchain-qt5-cortexa9hf-vfp-neon-toolchain-1.8.sh
| |
| Keep the default install directory /opt/poky/1.8
| |
| </pre> | |
| | |
| = sample application =
| |
| <pre>
| |
| $ cd ~/var-som-mx6-yocto-fido/
| |
| $ mkdir qtapps
| |
| $ cd qtapps
| |
| $ cp -a ../build_x11/tmp/work/cortexa9hf-vfp-neon-mx6qdl-poky-linux-gnueabi/qtbase/5.4.2+gitAUTOINC+2cb17c1fb9-r0/build/examples/opengl/hellowindow ./
| |
| $ cd hellowindow
| |
| $ source /opt/poky/1.8/environment-setup-cortexa9hf-vfp-neon-poky-linux-gnueabi
| |
| </pre> | |
| | |
| Create new file qmake.conf:
| |
| <pre>
| |
| #
| |
| CROSS_COMPILE = arm-poky-linux-gnueabi-
| |
| ROOTFS = /opt/poky/1.8/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi
| |
| #
| |
| QMAKE_CC = $(CROSS_COMPILE)-gcc
| |
| QMAKE_CXX = $(CROSS_COMPILE)-g++
| |
| QMAKE_LINK = $(CROSS_COMPILE)-g++
| |
| QMAKE_LINK_SHLIB = $(CROSS_COMPILE)-g++
| |
| QMAKE_AR = $(CROSS_COMPILE)-ar cr
| |
| QMAKE_OBJCOPY = $(CROSS_COMPILE)-objcopy
| |
| QMAKE_STRIP = $(CROSS_COMPILE)-strip
| |
| #
| |
| QMAKE_LFLAGS_RELEASE = -Wl,-O1,-rpath $(ROOTFS)/usr/lib
| |
| #
| |
| QMAKE_INCDIR = $(ROOTFS)/usr/include
| |
| QMAKE_LIBDIR = $(ROOTFS)/usr/lib
| |
| QMAKE_INCDIR_X11 = $(ROOTFS)/usr/include
| |
| QMAKE_LIBDIR_X11 = $(ROOTFS)/usr/lib
| |
| QMAKE_INCDIR_OPENGL = $(ROOTFS)/usr/include
| |
| QMAKE_LIBDIR_OPENGL = $(ROOTFS)/usr/lib
| |
| #
| |
| </pre>
| |
| <pre>
| |
| $ qmake -makefile qmake.conf
| |
| </pre> | |
| edit the genreated Makefile and insert in the top
| |
| <pre>
| |
| #
| |
| CROSS_COMPILE = arm-poky-linux-gnueabi
| |
| ROOTFS = /opt/poky/1.8/sysroots/cortexa9hf-vfp-neon-poky-linux-gnueabi
| |
| #
| |
| OE_QMAKE_CC = $(CROSS_COMPILE)-gcc
| |
| OE_QMAKE_CXX = $(CROSS_COMPILE)-g++
| |
| OE_QMAKE_LINK = $(CROSS_COMPILE)-g++
| |
| OE_QMAKE_LINK_SHLIB = $(CROSS_COMPILE)-g++
| |
| OE_QMAKE_AR = $(CROSS_COMPILE)-ar cr
| |
| OE_QMAKE_OBJCOPY = $(CROSS_COMPILE)-objcopy
| |
| OE_QMAKE_STRIP = $(CROSS_COMPILE)-strip
| |
| #
| |
| </pre>
| |
| <pre>
| |
| $ make clean
| |
| $ make
| |
| copy the hellowindow to your target and run it
| |
| export DISPLAY=:0.0
| |
| ./hellowindow --platform eglfs | |
| </pre> | |