Vous êtes sur la page 1sur 5

Building Qt - Texas Instruments Embedded Process... http://processors.wiki.ti.com/index.

php/Building_Qt

Building Qt
From Texas Instruments Embedded Processors Wiki

Building Qt

Search for an article here:

Contents
1 Useful Links
1.1 Qt Embedded Download Location
1.2 TI software Package Download Location
1.3 Getting Started Guides
2 Setting up Target before Qt Build
3 Building Qt with OpenGL ES accelerated by SGX
4 Building Qt
5 Creating Project in Qt
6 Configuration Examples
6.1 Qt 4.5.x Embedded Linux: Configuration for OMAP-L137
6.2 Qt 4.5.x WinCE: Configuration for OMAP3
6.3 Qt 4.5.x Embedded Linux: Configuration for DM365 with Avnet LCD
7 See Also

Useful Links
Qt Embedded Download Location

You can download the Open Source LGPL version of Qt libraries 4.6.2 for embedded Linux here (http://get.qt.nokia.com/qt/source
/qt-everywhere-opensource-src-4.6.2.tar.gz)

TI software Package Download Location

DVSDK (http://software-dl.ti.com/dsps/dsps_public_sw/sdo_sb/targetcontent/dvsdk/DVSDK_3_00/latest/index_FDS.html) - Compare


the versions of PSP & GFX-SDK on this link against the individual versions below
PSP (http://software-dl.ti.com/dsps/dsps_public_sw/psp/omap3_00/03_00_00_04/index_FDS.html) - 03.00.00.04
GFX SDK (http://software-dl.ti.com/dsps/dsps_public_sw/gfxsdk/3_01_00_06/index_FDS.html) - 03.01.00.06

Getting Started Guides

DVSDK GSG
Graphics SDK GSG

Qt 4.7

Using Qt4.7 - Refer to this page for an overview of using QtQuick feature introduced in Qt 4.7

Setting up Target before Qt Build


You may use the already built MLO, u-boot, uImage and filesystem under AM35x-OMAP35x-PSP-SDK-xx.xx.xx.xx/images/ or rebuild
as per GSG

Please follow Graphics SDK GSG for getting started on SGX if you need 3D Graphics (OpenGL ES xx) in you Qt GUI Application
and your processor has SGX

1 of 5 02/01/2011 01:41 PM
Building Qt - Texas Instruments Embedded Process... http://processors.wiki.ti.com/index.php/Building_Qt

-You may need to refer the Technical Reference Manual of your Processor to determine whether it has SGX or not

FileSystem:

Use the PSP file system from AM35x-OMAP35x-PSP-SDK-xx.xx.xx.xx

Code Sourcery Toolchain:

Please click here (http://processors.wiki.ti.com/index.php


/GSG:_AM35x_and_OMAP35x_DVEVM_Software_Setup_for_Graphics_SDK#Installing_the_Toolchain) for instructions

Note: For BeagleBoard, please use the same toolchain as the one used to compile your kernel & filesystem
Bootargs:

Refer this GSG: OMAP35x DVEVM Additional Procedures#Changing_the_Output_Display_to_DVI_link

Building Qt with OpenGL ES accelerated by SGX


The Processors listed below has SGX (GPU for 3D Graphics Acceleration). These processors are capable of 3D Graphics using
OpenGL ES/OpenVG via SGX.

- OMAP3515/30

- DM3715/30

- AM3517

- AM3717

If you are making your Qt GUI Application using OpenGL ES 1.1/2.0 (3D Graphics), then you need to build Qt with OpenGL
ES support.

Please refer Building_Qt_with_OpenGL_ES_accelerated_by_SGX, which is an article dedicated for this configuration.

For Building Qt without OpenGL ES support, follow this procedure

Building Qt
You can follow these steps to build Qt without OpenGL ES support for any ARM based TI Processor.

Step 1:

It is assumed that you have downloaded Qt embedded libraries and have set up the target board as mentioned above in this wiki

Step 2:

Copy the qmake conf for your processor. Replace <NAME_OF_PROCESSOR> with the name of your target in all the steps below:

cp -R [qt-install-dir]/mkspecs/qws/linux-arm-g++/ [qt-install-dir]/mkspecs/qws/linux-<NAME_OF_PROCESSOR>-g++/

Fix/Add qmake.conf under [qt-install-dir]/mkspecs/qws/linux-<NAME_OF_PROCESSOR>-g++/qmake.conf

2 of 5 02/01/2011 01:41 PM
Building Qt - Texas Instruments Embedded Process... http://processors.wiki.ti.com/index.php/Building_Qt

#
# qmake configuration for building with arm-linux-g++
#

include(../../common/g++.conf)
include(../../common/linux.conf)
include(../../common/qws.conf)

# modifications to g++.conf
#Toolchain

#Compiler Flags to take advantage of the ARM architecture


QMAKE_CFLAGS_RELEASE = Please update this flag with your arm family specific compiler optimization options
QMAKE_CXXFLAGS_RELEASE = Please update this flag with your arm family specific compiler optimization options

QMAKE_CC = arm-none-linux-gnueabi-gcc
QMAKE_CXX = arm-none-linux-gnueabi-g++
QMAKE_LINK = arm-none-linux-gnueabi-g++
QMAKE_LINK_SHLIB = arm-none-linux-gnueabi-g++

# modifications to linux.conf
QMAKE_AR = arm-none-linux-gnueabi-ar cqs
QMAKE_OBJCOPY = arm-none-linux-gnueabi-objcopy
QMAKE_STRIP = arm-none-linux-gnueabi-strip

load(qt_config)

Note: For a different toolchain, please change the qmake.conf above accordingly. e.g For Angstrom Toolchain, you may need to change
arm-none-linux-gnueabi-gcc to arm-angstrom-linux-gnueabi-gcc

sample qmake.conf for AM35xx/OMAP35xx (Cortex-A8 family)

#
# qmake configuration for building with arm-linux-g++
#

include(../../common/g++.conf)
include(../../common/linux.conf)
include(../../common/qws.conf)

# modifications to g++.conf
#Toolchain

#Compiler Flags to take advantage of the ARM architecture


QMAKE_CFLAGS_RELEASE = -O3 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp
QMAKE_CXXFLAGS_RELEASE = -O3 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp

QMAKE_CC = arm-none-linux-gnueabi-gcc
QMAKE_CXX = arm-none-linux-gnueabi-g++
QMAKE_LINK = arm-none-linux-gnueabi-g++
QMAKE_LINK_SHLIB = arm-none-linux-gnueabi-g++

# modifications to linux.conf
QMAKE_AR = arm-none-linux-gnueabi-ar cqs
QMAKE_OBJCOPY = arm-none-linux-gnueabi-objcopy
QMAKE_STRIP = arm-none-linux-gnueabi-strip

load(qt_config)

Step 3:

The steps below will list all the configure feature options available in Qt. You can add/remove feature using these configure options.

cd [qt-install-dir]

./configure --help

Sample Configure for Qt embedded:

./configure -prefix <PATH> -embedded arm -platform /qws/linux-x86-g++ -xplatform /qws/linux-omap3-g++ -depths 16,24,32 -no-mmx
-no-3dnow -no-sse -no-sse2 -no-glib -no-cups -no-largefile -no-accessibility -no-openssl -no-gtkstyle -qt-mouse-pc -qt-mouse-linuxtp
-qt-mouse-linuxinput -plugin-mouse-linuxtp -plugin-mouse-pc -fast

Note:

"-prefix" <PATH> option in the configure above points to the path inside the rootfs where qt-e will be installedon Target
FileSystem
'"-platform '/qws/linux-x86-g++" in configure above assumes your host machine CPU to be of 32-bit. For 64-bit, use "-platform
/qws/linux-x86_64-g++"
For TouchScreen, you need to append the configure options "-qt-mouse-tslib" in above mentioned recommended options

Step 4:

> make

> make install

You can also use "make install INSTALL_ROOT=<PATH_TO_APPEND_TO_PREFIX_INSTALLPATH_OF_CONFIGURE>" to append


path to -prefix

3 of 5 02/01/2011 01:41 PM
Building Qt - Texas Instruments Embedded Process... http://processors.wiki.ti.com/index.php/Building_Qt

e.g. if the path in "-prefix" option of configure is "-prefix /opt/qt" and you use "make install INSTALL_ROOT=/home/alpha/nfs/", then the
qt binaries will be installed at "/home/alpha/nfs/opt/qt"

Step 5:

Running the Qt Application:

After copying/installing the qt binaries in the target filesystem, you can run the qt examples & qt demos

For the commands below, I have installed my qt-embedded in the path: /opt/qt-embedded

[mailto:root@arago root@arago]:~# export LD_LIBRARY_PATH=/lib:/usr/lib:/usr/local/lib:/opt/qt-embedded/lib

root@arago:~# cd /opt/qt-embedded/demos/

root@arago:~# cd composition
root@arago:~# ./composition -qws

You can see the output either on the lcd or dvi output depending on how you configured your target board to output

Creating Project in Qt
Export the toolchain to be used for cross-compiling
Export "qmake" under [qt-install-dir]/bin/qmake
cd path/to/project
qmake -project
qmake -spec qws/linux-<NAME_OF_PROCESSOR>-g++ (From Step 2 of Building Qt above)
make

Configuration Examples
Comment: examples below are taken from real-world tests but don't mean you shouldn't consider other options. Especially where
modules are not build you might remove that option to get the full Qt functionality (e.g. -no-phonon was used in one case to reduce
compile time as we had no need for phonon in our application demo).

Qt 4.5.x Embedded Linux: Configuration for OMAP-L137

#./configure -prefix /opt/qt -embedded arm -platform /qws/linux-x86-g++ -xplatform /qws/linux-omapl1-mv-g++ -qt-kbd-usb -depths 16 -no-cups -no-largefile
-no-accessibility -no-opengl -no-openssl

Qt 4.5.x WinCE: Configuration for OMAP3

Make sure that your path contains <wince_qt_dir>\bin. Then open a Visual Studio shell and enter:

configure.exe -platform win32-msvc2005 -xplatform wince60standard-armv4i-msvc2005

Here we assume that WinCE Platform Builder and the OMAP3 WinCE BSP are installed. Now type "nmake" inside a Platform Builder
build shell to generate Qt DLLs. The DLLs maybe installed into C:/Windows on the WinCE file system or reside in the same folder as the
Qt application (e.g. on SD card or USB disk). This is especially useful for testing.

For generating the run-time tree do this:

set INSTALL_ROOT=\some_path

nmake install

This will copy all relevant files into C:\some_path. From there copy to the WinCE target.

4 of 5 02/01/2011 01:41 PM
Building Qt - Texas Instruments Embedded Process... http://processors.wiki.ti.com/index.php/Building_Qt

Qt 4.5.x Embedded Linux: Configuration for DM365 with Avnet LCD

If using the Avnet LCD kit (http://www.em.avnet.com/evk/home


/0,1719,RID%253D0%2526CID%253D54922%2526CAT%253D0%2526CCD%253DUSA%2526SID%253D32214%2526DID%253DDF2%25
, some patches need to be applied to the kernel. Follow the instructions on DM365 touchscreen with Qt.

For touchscreen support, ensure the following lines are in the gmake.conf file:

#modifications to include ts-lib


QMAKE_INCDIR = /home/user/workdir/dm365/usr/include
QMAKE_LIBDIR = /home/user/workdir/dm365/lib

Add the following lines to the /root/.profile file on the target. This sets the environment variables for touch screen support, and for Qt to
use the second OSD window (/dev/fb2 ).

export QWS_MOUSE_PROTO=tslib:/dev/input/event0
export QWS_DISPLAY=LinuxFb:/dev/fb2

See Also
Building Qt to make use of the Beagle board’s SGX GPU (http://labs.trolltech.com/blogs/2009/11/20/building-qt-to-make-use-of-the-
beagle-boards-sgx-gpu/)
Beagle is the first officially verified Qt Board under "The Qt Board Verification Program" - March 02, 2010 (http://qt.nokia.com
/about/news/qt-launches-qt-board-verification-program/)
Qt on BeagleBoard

For technical support please post your questions at http://e2e.ti.com. Please post only comments about the article Building Qt here.
Retrieved from "http://processors.wiki.ti.com/index.php/Building_Qt"
Categories: OpenGL ES | Qt | OMAPL1 | Sitara Linux | OMAP35x
Leave a Comment

Comments
Comments on Building Qt

Fk jiang said ...


Hi all, I have built my QT according to the page,and I can see the surface of the demos,but cannot use my mouse and keyboard to
control it,what's the problem? (The output is on dvi) Bestregards,

--Fk jiang 03:28, 26 July 2010 (CDT)

Cvalicka said ...


I seem to have keyboard input but not mouse input. Any luck?

--Cvalicka 17:15, 8 September 2010 (CDT)

PeterJerald said ...


Hi all, I have successfully built QT and also i can able to see the applications but i cant able to enable the remote functionality in QT.
Any body Please help me,Thanks in advance. Regards, Peter Jerald

--PeterJerald 00:40, 15 September 2010 (CDT)

This page was last modified on 1 December 2010, at 06:18.


This page has been accessed 49,057 times.
Content is available under Creative Commons Attribution-Share Alike 3.0 license.

Privacy policy
About Texas Instruments Embedded Processors Wiki
Disclaimers

5 of 5 02/01/2011 01:41 PM

Vous aimerez peut-être aussi