Skip to contentSkip to conversation

qt4-embedded and cmake

DISCUSSION Valentin Longchamp 1 participant 1 message Jun 23, 2009

lore
Share & tools
lore
#0 lore raw

Hello,

I am struggling to cross-compile a cmake based recipe that has qt4-embedded as a dependance (but it is the same for qt4).

My problem is that qmake that is used by OE is the one built by qt4-tools-native and it has all the paths (that are determined at configure time with the -prefix option) set to ${STAGING_DIR}/${BUILD_SYS}. Here is the output of {STAGING_DIR}/${BUILD_SYS}/usr/bin/qmake4 -query:

Quoted 7 lines
valentin@thinkpad:/usr/local/OE/angstrom$ staging/i686-linux/usr/bin/qmake4 -query
QT_INSTALL_PREFIX:/usr/local/OE/angstrom/staging/i686-linux
QT_INSTALL_DATA:/usr/local/OE/angstrom/staging/i686-linux
QT_INSTALL_DOCS:/usr/local/OE/angstrom/staging/i686-linux/doc
QT_INSTALL_HEADERS:/usr/local/OE/angstrom/staging/i686-linux/include
QT_INSTALL_LIBS:/usr/local/OE/angstrom/staging/i686-linux/lib
QT_INSTALL_BINS:/usr/local/OE/angstrom/staging/i686-linux/bin
Quoted 8 lines
QT_INSTALL_PLUGINS:/usr/local/OE/angstrom/staging/i686-linux/plugins
QT_INSTALL_TRANSLATIONS:/usr/local/OE/angstrom/staging/i686-linux/translations
QT_INSTALL_CONFIGURATION:/etc/xdg
QT_INSTALL_EXAMPLES:/usr/local/OE/angstrom/staging/i686-linux/examples
QT_INSTALL_DEMOS:/usr/local/OE/angstrom/staging/i686-linux/demos
QMAKE_MKSPECS:/usr/local/OE/angstrom/staging/i686-linux/mkspecs
QMAKE_VERSION:2.01a
QT_VERSION:4.5.1

But, in cmake, when you want to use qt4 or qt4-embedded, you need to use the FindQt4 module. What this module does is querying qmake to find out where the QT libraries are installed. These should point to ${STAGING_DIR_HOST}, because that's where the lib dir and headers that we aim at are. I changed a little bit the FindQt4.cmake module so that it is more verbose and here is the ouptut:

Quoted 15 lines

QMAKE found : /usr/local/OE/angstrom/staging/i686-linux/usr/bin/qmake4 QT_LIBRARY_DIR is /usr/local/OE/angstrom/staging/i686-linux/usr/lib QT_BINARY_DIR is /usr/local/OE/angstrom/staging/i686-linux/usr/bin QT_HEADERS_DIR is /usr/local/OE/angstrom/staging/i686-linux/usr/include
Looking for QtCore in /usr/local/OE/angstrom/staging/i686-linux/usr/include/QtCore Looking for QtGui in /usr/local/OE/angstrom/staging/i686-linux/usr/include/QtGui Looking for Qt3Support in /usr/local/OE/angstrom/staging/i686-linux/usr/include/Qt3Support Looking for QtSvg in /usr/local/OE/angstrom/staging/i686-linux/usr/include/QtSvg Looking for QtScript in /usr/local/OE/angstrom/staging/i686-linux/usr/include/QtScript Looking for QtTest in /usr/local/OE/angstrom/staging/i686-linux/usr/include/QtTest Looking for QtUiTools in /usr/local/OE/angstrom/staging/i686-linux/usr/include/QtUiTools Looking for QtHelp in /usr/local/OE/angstrom/staging/i686-linux/usr/include/QtHelp Looking for QtWebKit in /usr/local/OE/angstrom/staging/i686-linux/usr/include/QtWebKit Looking for QtXmlPatterns in /usr/local/OE/angstrom/staging/i686-linux/usr/include/QtXmlPatterns Looking for phonon in /usr/local/OE/angstrom/staging/i686-linux/usr/include/phonon

Quoted 8 lines

Looking for QtMotif in /usr/local/OE/angstrom/staging/i686-linux/usr/include/QtMotif Looking for QtNetwork in /usr/local/OE/angstrom/staging/i686-linux/usr/include/QtNetwork Looking for QtNsPlugin in /usr/local/OE/angstrom/staging/i686-linux/usr/include/QtNsPlugin Looking for QtOpenGL in /usr/local/OE/angstrom/staging/i686-linux/usr/include/QtOpenGL Looking for QtSql in /usr/local/OE/angstrom/staging/i686-linux/usr/include/QtSql Looking for QtXml in /usr/local/OE/angstrom/staging/i686-linux/usr/include/QtXml Looking for QtDesigner in /usr/local/OE/angstrom/staging/i686-linux/usr/include/QtDesigner Looking for QtDBus in /usr/local/OE/angstrom/staging/i686-linux/usr/include/QtDBus

Of course they are not found, because they are located in
/usr/local/OE/angstrom/staging/armv6-angstrom-linux-gnueabi/usr/include/qtopia/ (or ${STAGING_HOST_DIR}/usr/include/qtopia) (and it is the same for the library files, not only the headers).

I would like some input on how to handle this cleanly ? I see two solutions:

- we make qt4-tools-native point towards ${STAGING_DIR_HOST} (complicated, because qt4-tools-native inherits native, I did not succeed)
- we make the staging of qt4.inc copy the headers and libs to ${STAGING_DIR}/${BUILD_SYS}

Your comments and help are greatly appreciated.

Best Regards

Signature · 4 lines
Valentin Longchamp, PhD Student, EPFL-STI-LSRO1
[email protected], Phone: +41216937827
http://people.epfl.ch/valentin.longchamp
MEA3485, Station 9, CH-1015 Lausanne