Back to Blog home

Cross compiling Qt for the masses

Published on Friday April 13, 2012 by dcarr in Contributors Embedded Qt Open Governance | Comments

Cross compiling Qt for particular devices/BSPs can be frustrating when operating from first principles and we are trying to improve the existing configure/qmake build infrastructure in Qt 5, as well as the associated documentation, in order to ease this burden. We are approaching the problem from 2 angles:

  • General cross compilation support
  • Direct target support

The general cross compilation support is being improved by:

  • Reworking the pkg-config logic
  • Introducing the -device flag to configure
  • Introducing the -sysroot flag to configure

The supported targets are documented here:

http://wiki.qt-project.org/Devices

and as you can see in the Raspberry Pi documentation, we have reduced compilation for this target down to:

./configure -prefix <your prefix> -release
-device linux-rasp-pi-g++ -make libs
-device-option CROSS_COMPILE=<your toolchain path>/bin/arm-none-linux-gnueabi-
-sysroot <your sysroot path>

The resulting build has full (single process) OpenGL ES 2 support and keyboard support for the Raspberry Pi.

There is no need to patch any files as all the relevant changes have been upstreamed into Qt 5 where they can be adequately reviewed and QAed like any other Qt contribution. Needless to say this drastically increases the quality of the code finding its way on to these devices and should drastically improve the user experience when dealing with this kind of hardware for prototyping/productization/recreation. Sunlight is the best disinfectant, and we delight in consuming this dog food.

We heartily invite any (all!) chipset vendors/chipset customers/BSP vendors or interested parties to upstream relevant mkspecs and the associated code changes to Qt, in order to extend the breadth of Qt 5's out-of-the-box device support. The move to Open Governance has made extending this support increasingly achievable, feasible and convenient and we are very excited about both Qt 5 as a whole and the current rate of development towards embedded (read constrained) Linux platforms.

Subscribe to Our Blog

Stay up to date with the latest marketing, sales and service tips and news.

The blog comment system has been migrated to a new platform. If you face any issues, please let us know via feedback@qt.io.