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.
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
To install Qt 5.3.2, I followed the steps from this link:
The Qt files are in :
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
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