madduci
madduci

Reputation: 2883

Compile Qt5 without GUI support on Linux ARM

I'm having troubles getting Qt5 working without GUI elements on my Cortex-A9 board due the OpenGL dependencies (i.e. OpenGL ES2). I am running a Ubuntu 14.04 rootfs.

Is there any way to disable the generation of GUI classes, starting from git repository? (Target version 5.3). The only modules I need are QtCore, QtXML and QtWebSockets/QtNetwork

Upvotes: 4

Views: 4581

Answers (3)

juzzlin
juzzlin

Reputation: 47875

It seems that at least Qt 5.6.2 supports -no-gui and -no-widgets configuration options.

Upvotes: 4

madduci
madduci

Reputation: 2883

Ubuntu team itself declared that Qt5.3. is still under investigation for armhf platforms and that probably it will be available from 14.10 release. Somehow, crawling on Qt forums, there are missing dependencies and compiling errors when there's no OpenGL/GUI module.

I resolved it installing 1t 5.2.1 from repositories and then the missing QWebSocket module from git repository.

In order to make this module compatible with older Qt version, the file .qmake.conf:

MODULE_VERSION = 5.3.2 --> to desired one (i.e. 5.2.1)

Upvotes: 1

artless-noise-bye-due2AI
artless-noise-bye-due2AI

Reputation: 22420

The following seems to get Qt5 to compile with a LinuxFB driver and no OpenGL.

./configure -qpa linuxfb -no-largefile -opensource -verbose -release \
 -no-accessibility  -confirm-license -no-sse -no-sse2 \
 -qt-zlib -qt-libpng -nomake examples -nomake demos -nomake docs -nomake tests \
 -make libs --prefix=/usr -no-pch -no-iconv -no-nis -no-xkb -no-xshape \
 -no-xvideo -no-xsync -no-xinerama -no-xcursor -no-xfixes -no-xrandr -no-kms \
 -no-directfb -no-eglfs -no-xcb -no-dbus -no-icu -no-cups -no-gif \
 -no-accessibility -no-opengl -nomake quick -make quick1  \
 -skip multimedia -skip webkit -nomake webkit -no-pkg-config \
 -no-sql-db2 -no-sql-ibase -no-sql-mysql -no-sql-oci \
 -no-sql-odbc -no-sql-psql -no-sql-sqlite -no-sql-sqlite2 \
 -no-sql-sqlite_symbian -no-sql-tds -nomake tools \
 -device linux-custom-g++ -device-option CROSS_COMPILE=$TGT_TOOL_NAME-

The keys are, -no-opengl and -nomake quick. QtQuick2 will pull in OpenGL.

Also it seems I must do the following,

touch module_qtwebkit-make_first

This stops the build system from trying to make QtWebKit; it seems buggy. This still has the GUI classes, but don't link to them. That is before the plain make. For the install target,

touch module_qtwebkit-install_subtargets

was required. Later Qt5 releases may have fixed the QtWebkit build issues.

Upvotes: 5

Related Questions