Public Repository

Last pushed: 2 years ago
Short Description
Raspbian containing Qt 5.3.2 to compile Qt applications for Raspberry Pi
Full Description

WHY this repository

The goal of this repository is to speed up the compiling time of Qt application for Raspberry Pi. This last doesn't have a powerful processor/memory to compile applications quickly. One of the solutions is to use a Docker image. Which, in addition of making the compilation faster, it allows to the team to have the same development environment, thus to get rid off of dependencies issues between team members.

Image Source

This image is based on philipz/rpi-raspbian.

These packages were added :

libicu48 
libglib2.0-dev 
libpng12-dev 
git
make 
build-essential 
g++
nano 
python 
python2.7 
unzip
wget

Qt Source

To install Qt 5.3.2, I followed the steps from this link:

https://theredblacktree.wordpress.com/2015/02/08/compiled-binaries-of-qt-5-3-for-the-raspberry-pi-and-pi-2

The Qt files are in :
/usr/local/qt5

Running container

To run the container in an INTEL/AMD processor pc, you need to use QEMU, as this image was created in raspberry which has ARM processor.

This article shows well how to do it : http://www.instructables.com/id/Uniform-Development-by-Docker-QEMU

To sum up (for this repository):

docker run -it -v /usr/bin/qemu-arm-static:/usr/bin/qemu-arm-static theshadowx/rpiqt /bin/bash

Compiling Qt application for Raspberry Pi

Let's say your application QtApp is located in /home/username/QtApp

And in addition to the source files, there is a folder called build

Here is how to compile it (out of source) :

  • First run the container:
    With binding the application folder to a location in the container.
    And setting the current working directory as the build folder contained in the application folder.
docker run -it -v /home/username/QtApp:/data/QtApp -v /usr/bin/qemu-arm-static:/usr/bin/qemu-arm-static -w /data/QtApp/build theshadowx/rpiqt /bin/bash

So now what left to do : is to generate the Makefile by applying qmake and then make

root@(someID):/data/QtApp/build# /usr/local/qt5/bin/qmake ..
root@(someID):/data/QtApp/build# make -j4

Voilà !!! Now you ready to use your Qt application in Raspberry Pi.

Now each time you modify your code in the host, you just need to do:

root@(someID):/data/QtApp/build# make -j4

The output (lib/executable) will be generated in the build folder /home/username/QtApp/build.

Docker Pull Command
Owner
theshadowx

Comments (0)