qt4-embedded and cmake
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/qmake4QT_LIBRARY_DIRis/usr/local/OE/angstrom/staging/i686-linux/usr/libQT_BINARY_DIRis/usr/local/OE/angstrom/staging/i686-linux/usr/binQT_HEADERS_DIRis/usr/local/OE/angstrom/staging/i686-linux/usr/include
Looking for QtCore in/usr/local/OE/angstrom/staging/i686-linux/usr/include/QtCoreLooking for QtGui in/usr/local/OE/angstrom/staging/i686-linux/usr/include/QtGuiLooking for Qt3Support in/usr/local/OE/angstrom/staging/i686-linux/usr/include/Qt3SupportLooking for QtSvg in/usr/local/OE/angstrom/staging/i686-linux/usr/include/QtSvgLooking for QtScript in/usr/local/OE/angstrom/staging/i686-linux/usr/include/QtScriptLooking for QtTest in/usr/local/OE/angstrom/staging/i686-linux/usr/include/QtTestLooking for QtUiTools in/usr/local/OE/angstrom/staging/i686-linux/usr/include/QtUiToolsLooking for QtHelp in/usr/local/OE/angstrom/staging/i686-linux/usr/include/QtHelpLooking for QtWebKit in/usr/local/OE/angstrom/staging/i686-linux/usr/include/QtWebKitLooking for QtXmlPatterns in/usr/local/OE/angstrom/staging/i686-linux/usr/include/QtXmlPatternsLooking 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/QtMotifLooking for QtNetwork in/usr/local/OE/angstrom/staging/i686-linux/usr/include/QtNetworkLooking for QtNsPlugin in/usr/local/OE/angstrom/staging/i686-linux/usr/include/QtNsPluginLooking for QtOpenGL in/usr/local/OE/angstrom/staging/i686-linux/usr/include/QtOpenGLLooking for QtSql in/usr/local/OE/angstrom/staging/i686-linux/usr/include/QtSqlLooking for QtXml in/usr/local/OE/angstrom/staging/i686-linux/usr/include/QtXmlLooking for QtDesigner in/usr/local/OE/angstrom/staging/i686-linux/usr/include/QtDesignerLooking 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