[Kde-bindings] Qt Compile Flags (Was: Compiling Without Installing)

Richard Dale rdale at foton.es
Tue Jun 2 10:51:09 UTC 2009


On Monday 01 June 2009 11:13:31 pm Jonathan Yu wrote:
> Hm.
>
> I did manage to track down the issue.
>
> Your Makefile.PL expects stuff to be in /opt... However on Debian it is
> not.
>
> On GNOME and other packages, it comes with a command (GNOME has
> pkg-config) which will return compiler flags, so when you do
> Makefile.PL you can do: `pkg-config --cflags` to get compiler flags,
> which get passed directly to gcc.
>
> From Google it seems there is no established way to do this (ie via
> pkg-config), which is too bad. So that means for the purpose of
> developing bindings, we need to figure out a list of common places Qt4
> is going to be installed. The problem is, too, that we want our
> bindings to be compatible with the whole of Qt, rather than just Qt
> 4.5.2 or whatever. So that's a lot of work to do.
>
> What I'd really like to see is a command like pkg-config for Qt. How
> hasn't this come up before?
>
> Cheers,
>
> Jonathan
>
> On Mon, Jun 1, 2009 at 5:59 PM, Jonathan Yu <jonathan.i.yu at gmail.com> wrote:
> > Hi:
> >
> > I'll get you a build log as soon as I can. I got it to build on my
> > system following your instructions in README, but the Perl stuff
> > didn't compile, so you can't load Qt.
> >
> > Based on what I understand of the instructions, cmake seems like a
> > precompiler type thing that doesn't actually build anything - that's
> > what the 'make' part  after is for. Does that mean we can distribute
> > the CMake'd stuff without doing the final compilation?
> >
> > Cheers,
> >
> > Jonathan
> >
> > On Mon, Jun 1, 2009 at 2:58 PM, Chris Burel <chrisburel at gmail.com> wrote:
> >> Hey Jonathan,
> >> CMake actually builds the bindings.  So if this completes successfully:
> >> mkdir PerlQt4/build && cd PerlQt4/build
> >> cmake .. <with any additional options>
> >> make
> >>
> >> then there should now be a PerlQt4/build/perl/blib directory that
> >> contains the compiled parts of the bindings.  However, it doesn't
> >> contain the .pm files, because I couldn't figure out how to get CMake
> >> to put them there, because they're not compiled.  All that needs to
> >> happen is to do
> >> cp -r PerlQt4/perl/lib PerlQt4/build/perl/blib
> >>
> >> Then, in order to be able to run the examples:
> >> ln -s ../build/perl/blib PerlQt4/perl/blib
> >>
> >> Using CMake, you don't have to run the Makefile.PL at all.
> >>
> >> The reason I switched to CMake is because that's what the kdebindings
> >> package uses, and the Smoke object gets built using CMake.  Since I
> >> knew what it took to compile the bindings, but didn't necessarily know
> >> what it took to generate and compile smokeqt, I converted the build
> >> system over to cmake so that you could build the smokeqt object and
> >> the bindings at the same time.  I understand that that presents a
> >> problem for uploading it onto CPAN.  If you want to figure out how to
> >> build the smokeqt object with the Makefile.PL file, go right ahead.
> >> If you don't want to use CMake, you can still build the bindings with
> >> the Makefile.PL method, but it requires you to build smokeqt
> >> externally.  There's a couple paths in Makefile.PL that are
> >> hard-coded; you could easily externalize those paths and have them
> >> passed in via flags.  But integrating the smokeqt build is a bit more
> >> work.
> >>
> >> On Mon, Jun 1, 2009 at 11:14 AM, Jonathan Yu <jonathan.i.yu at gmail.com> 
wrote:
> >>> Hi Chris:
> >>>
> >>> I have been trying to install your bindings.
> >>>
> >>> I do the cmake and everything completes properly.
> >>>
> >>> However, once I try to compile the Perl bindings themselves by doing:
> >>> cd PerlQt4/perl
> >>> perl Makefile.PL
> >>> make
> >>>
> >>> I get a bunch of errors like: Qt.xs:2:24: error: QtCore/QHash: No such
> >>> file or directory
> >>>
> >>> So I'm guessing it's something perhaps missing from the include paths
> >>> (in -I)
> >>>
> >>> As well, the distribution itself doesn't seem very Perl-ish at all. Is
> >>> CMake a precompiler-type language, where we will distribute a copy of
> >>> the perl directory that has already been cmake'd?
> >>>
> >>> Lastly, I think 'use blib' can be replaced with 'use
> >>> ExtUtils::testlib' which is more appropriate, since it makes it look
> >>> in blib as necessary. That module is also a core module which is nice.
Although Ruby has a standard build system for extensions, it isn't used in 
QtRuby because it isn't really powerful enough. So the QtRuby extensions are 
built with cmake. Isn't it possible to adapt PerlQt and Perl to work with 
cmake too?

-- Richard



More information about the Kde-bindings mailing list