* Cross-compiling qt based programs with cmake
@ 2009-08-13 9:11 Valentin Longchamp
2009-08-13 9:34 ` Holger Hans Peter Freyther
0 siblings, 1 reply; 4+ messages in thread
From: Valentin Longchamp @ 2009-08-13 9:11 UTC (permalink / raw)
To: openembedded-devel@lists.openembedded.org
Hello,
I am trying to build cmake based programs that use QT with Openembedded.
The actual support for cmake in OE worked until now because I only had
"simple" dependencies. Now with QT as as dependency, I use the cmake
FindQt4 Module that strongly relies on qmake to find the different QT
cmake variables (try to run ${STAGINGBINDIR}/qmake2 -query). The cmake
FindQt4 Module uses the values given by qmake to determine where all the
libraries and tools are installed (and if installed).
The problem is that all the variables defined by qmake2 -query point to
the ${STAGING_DIR}/${HOST_SYS}/ as you can se below:
> valentin@lsro1arena:~/OE/angstrom/staging$ x86_64-linux/usr/bin/qmake2 -query
> QT_INSTALL_PREFIX:/home/valentin/OE/angstrom/staging/x86_64-linux/usr
> QT_INSTALL_DATA:/home/valentin/OE/angstrom/staging/x86_64-linux/usr
> QT_INSTALL_DOCS:/home/valentin/OE/angstrom/staging/x86_64-linux/usr/doc
> QT_INSTALL_HEADERS:/home/valentin/OE/angstrom/staging/x86_64-linux/usr/include
> QT_INSTALL_LIBS:/home/valentin/OE/angstrom/staging/x86_64-linux/usr/lib
> QT_INSTALL_BINS:/home/valentin/OE/angstrom/staging/x86_64-linux/usr/bin
> QT_INSTALL_PLUGINS:/home/valentin/OE/angstrom/staging/x86_64-linux/usr/plugins
> QT_INSTALL_TRANSLATIONS:/home/valentin/OE/angstrom/staging/x86_64-linux/usr/translations
> QT_INSTALL_CONFIGURATION:/etc/xdg
> QT_INSTALL_EXAMPLES:/home/valentin/OE/angstrom/staging/x86_64-linux/usr/examples
> QT_INSTALL_DEMOS:/home/valentin/OE/angstrom/staging/x86_64-linux/usr/demos
> QMAKE_MKSPECS:/home/valentin/OE/angstrom/staging/x86_64-linux/usr/mkspecs
> QMAKE_VERSION:2.01a
> QT_VERSION:4.5.1
But in order to be used, these values should point to a place that is
more like ${STAGING_INCDIR}. If we take the includes example,
QT_INSTALL_HEADERS is
/home/valentin/OE/angstrom/staging/x86_64-linux/usr/include (
${STAGING_DIR}/${HOST_SYS}/include) but it should be
/home/valentin/OE/angstrom/staging/armv6-angstrom-linux-gnueabi/usr/include/qtopia/
(that corresponds to ${STAGING_INCDIR}/qtopia) as you can see below.
> valentin@lsro1arena:~/OE/angstrom$ ll staging/armv6-angstrom-linux-gnueabi/usr/include/qtopia/
> total 160K
> drwxr-xr-x 2 valentin valentin 4.0K 2009-06-17 20:43 phonon
> drwxr-xr-x 2 valentin valentin 32K 2009-06-17 20:43 Qt
> drwxr-xr-x 2 valentin valentin 16K 2009-06-17 20:43 Qt3Support
> drwxr-xr-x 2 valentin valentin 4.0K 2009-06-17 20:43 QtAssistant
> drwxr-xr-x 2 valentin valentin 20K 2009-06-17 20:43 QtCore
> drwxr-xr-x 2 valentin valentin 4.0K 2009-06-17 20:43 QtDBus
> drwxr-xr-x 2 valentin valentin 4.0K 2009-06-17 20:43 QtDesigner
> drwxr-xr-x 2 valentin valentin 36K 2009-06-17 20:43 QtGui
> drwxr-xr-x 2 valentin valentin 4.0K 2009-06-17 20:43 QtHelp
> drwxr-xr-x 2 valentin valentin 4.0K 2009-06-17 20:43 QtNetwork
> drwxr-xr-x 2 valentin valentin 4.0K 2009-06-17 20:43 QtScript
> drwxr-xr-x 2 valentin valentin 4.0K 2009-06-17 20:43 QtScriptTools
> drwxr-xr-x 2 valentin valentin 4.0K 2009-06-17 20:43 QtSql
> drwxr-xr-x 2 valentin valentin 4.0K 2009-06-17 20:43 QtSvg
> drwxr-xr-x 2 valentin valentin 4.0K 2009-06-17 20:43 QtTest
> drwxr-xr-x 2 valentin valentin 4.0K 2009-06-17 20:43 QtUiTools
> drwxr-xr-x 2 valentin valentin 4.0K 2009-06-17 20:43 QtWebKit
> drwxr-xr-x 2 valentin valentin 4.0K 2009-06-17 20:43 QtXml
The problem is that these QT_INSTALL_* values are determined at
configure time, and it is hard to change them.
An inelegant but efficient way to resolve this problem would be to
"double install" the headers and libs of qt (or qtopia) also in
${STAGING_DIR}/${HOST_SYS}.
But I am pretty sure there is a more elegant way to do it, especially
using qt4e.bbclass where all the releveant paths are used.
Is there a qt4 wizard in OE that could help me ?
Val
--
Valentin Longchamp, PhD Student, EPFL-STI-LSRO1
valentin.longchamp@epfl.ch, Phone: +41216937827
http://people.epfl.ch/valentin.longchamp
MEA3485, Station 9, CH-1015 Lausanne
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Cross-compiling qt based programs with cmake
2009-08-13 9:11 Cross-compiling qt based programs with cmake Valentin Longchamp
@ 2009-08-13 9:34 ` Holger Hans Peter Freyther
2009-08-13 13:22 ` Valentin Longchamp
0 siblings, 1 reply; 4+ messages in thread
From: Holger Hans Peter Freyther @ 2009-08-13 9:34 UTC (permalink / raw)
To: openembedded-devel
On Thursday 13 August 2009 11:11:48 Valentin Longchamp wrote:
> Hello,
>
> I am trying to build cmake based programs that use QT with Openembedded.
> The actual support for cmake in OE worked until now because I only had
> "simple" dependencies. Now with QT as as dependency, I use the cmake
> FindQt4 Module that strongly relies on qmake to find the different QT
> cmake variables (try to run ${STAGINGBINDIR}/qmake2 -query). The cmake
> FindQt4 Module uses the values given by qmake to determine where all the
> libraries and tools are installed (and if installed).
Let me throw in some (pseudo) facts:
- We want to use one qmake2 for Qt/X11, Qt/Embedded Linux builds
- qmake is reading a qt.conf from the directory of the binary. In Qt/X11
and Qt/E build we write a custom one.
- the pkg-config files for Qt should be correct.
So my proposals include:
- Consider renaming qmake2 to qmake or qmake-qt4 (and move qt3 to qmake-qt3)
- for X11/Embedded create a separate bin dir for qmake, create a symlink and
place a qt.conf in it.
- maybe convince Alexander Neuendorf to use pkg-config to find Qt too..
what do you think?
z.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Cross-compiling qt based programs with cmake
2009-08-13 9:34 ` Holger Hans Peter Freyther
@ 2009-08-13 13:22 ` Valentin Longchamp
2009-08-13 14:23 ` Holger Hans Peter Freyther
0 siblings, 1 reply; 4+ messages in thread
From: Valentin Longchamp @ 2009-08-13 13:22 UTC (permalink / raw)
To: openembedded-devel@lists.openembedded.org
Holger Hans Peter Freyther wrote:
> On Thursday 13 August 2009 11:11:48 Valentin Longchamp wrote:
>> Hello,
>>
>> I am trying to build cmake based programs that use QT with Openembedded.
>> The actual support for cmake in OE worked until now because I only had
>> "simple" dependencies. Now with QT as as dependency, I use the cmake
>> FindQt4 Module that strongly relies on qmake to find the different QT
>> cmake variables (try to run ${STAGINGBINDIR}/qmake2 -query). The cmake
>> FindQt4 Module uses the values given by qmake to determine where all the
>> libraries and tools are installed (and if installed).
Thanks for your feedback zecke.
>
> Let me throw in some (pseudo) facts:
> - We want to use one qmake2 for Qt/X11, Qt/Embedded Linux builds
> - qmake is reading a qt.conf from the directory of the binary. In Qt/X11
> and Qt/E build we write a custom one.
What do you mean by the binary ? The qmake binary ? Is the custom file
you mention the linux.conf file (like
openembedded/recipes/qt4/files/linux.conf, with some parts defined in
openembedded/classes/qt4e.bbclass) ?
> - the pkg-config files for Qt should be correct.
>
>
> So my proposals include:
> - Consider renaming qmake2 to qmake or qmake-qt4 (and move qt3 to qmake-qt3)
Well, I don't think we need to change this anymore. As I said, a simple
patch would allow FindQt4 cmake module to find qmake2 too (or I did not
get what you meant here).
> - for X11/Embedded create a separate bin dir for qmake, create a symlink and
> place a qt.conf in it.
This seems to be a very interesting. But isn't it qmake.conf now ?
http://doc.trolltech.com/4.5/qmake-variable-reference.html
> - maybe convince Alexander Neuendorf to use pkg-config to find Qt too..
I think he does use qmake, because a qt build needs other tools besides
the libs and headers, and pkg-config does not find them, but qmake does.
But pkg-config could be used to find the libs and headers, you're right.
>
>
> what do you think?
>
If I got what you meant right, your idea of producing an accurate
qmake.conf file that correctly fits the locations of the headers and
libs seems very interesting. But I still need to figure out how
--
Valentin Longchamp, PhD Student, EPFL-STI-LSRO1
valentin.longchamp@epfl.ch, Phone: +41216937827
http://people.epfl.ch/valentin.longchamp
MEA3485, Station 9, CH-1015 Lausanne
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Cross-compiling qt based programs with cmake
2009-08-13 13:22 ` Valentin Longchamp
@ 2009-08-13 14:23 ` Holger Hans Peter Freyther
0 siblings, 0 replies; 4+ messages in thread
From: Holger Hans Peter Freyther @ 2009-08-13 14:23 UTC (permalink / raw)
To: openembedded-devel
On Thursday 13 August 2009 15:22:10 Valentin Longchamp wrote:
> Holger Hans Peter Freyther wrote:
> > On Thursday 13 August 2009 11:11:48 Valentin Longchamp wrote:
> >> Hello,
> >>
> >> I am trying to build cmake based programs that use QT with Openembedded.
> >> The actual support for cmake in OE worked until now because I only had
> >> "simple" dependencies. Now with QT as as dependency, I use the cmake
> >> FindQt4 Module that strongly relies on qmake to find the different QT
> >> cmake variables (try to run ${STAGINGBINDIR}/qmake2 -query). The cmake
> >> FindQt4 Module uses the values given by qmake to determine where all the
> >> libraries and tools are installed (and if installed).
>
> Thanks for your feedback zecke.
>
> > Let me throw in some (pseudo) facts:
> > - We want to use one qmake2 for Qt/X11, Qt/Embedded Linux builds
> > - qmake is reading a qt.conf from the directory of the binary. In Qt/X11
> > and Qt/E build we write a custom one.
>
> What do you mean by the binary ? The qmake binary ? Is the custom file
> you mention the linux.conf file (like
> openembedded/recipes/qt4/files/linux.conf, with some parts defined in
> openembedded/classes/qt4e.bbclass) ?
binary = qmake2
path = /usr/foo/bin/qmake2
strace /usr/foo/bin/qmek2 | grep qt.conf
lstat("/usr/foo/bin/qt.conf")
just look at qt4.inc. With a "qt.conf" you can define every value of qmake2 -
query. So when building Qt we put qmake2 into a special place and put the
qt.conf we want (X11 or Embedded Linux next to it).
You seem to be a bit confused. qmake.conf etc. are part of the QMAKESPEC,
qt.conf is something different for deployment...
z.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2009-08-13 14:40 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-08-13 9:11 Cross-compiling qt based programs with cmake Valentin Longchamp
2009-08-13 9:34 ` Holger Hans Peter Freyther
2009-08-13 13:22 ` Valentin Longchamp
2009-08-13 14:23 ` Holger Hans Peter Freyther
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.