[Clam-devel] Re: [scons-dev] Updating Qt4 tool and policy questions
David García Garzón
dgarcia at iua.upf.edu
Wed Dec 19 03:28:59 PST 2007
Another update of the tool. Now all qt4 examples in Qt 4.3.3 are compiling!
The problem of the scanner happened because i was adding a 'moc_' prefix not
just to the moc'ed header but also to the moc'ed sources. So instead of
generating file.cpp -> file.moc, i was generating file.cpp -> moc_file.moc
and dependencies were not resolved.
Detailed changelog follows:
* Qt4 scons tool:
** Fix: adding moc_ prefix to Moc4 target for cpp files prevented
the scanner to find such dependencies
** Fix: recursive including a dir in qrc files was not working
** Fix: calling pkg-config after QtAssistant hack to make it work
** Fix: QtDesigerComponents moved to the list of modules not
supported by pkg-config
* Qt4 examples SConstruct:
** All the examples are compiling now!!
** Compiling extra single source binaries in a project
*** A list of such files is done first and later built explicitly
** Explicitly added Moc4 builder call for mocable headers not
following the convention (same name as the cpp)
On Dimarts 18 Desembre 2007, David Garcia Garzon wrote:
> First update. I pasted the changelog below. Next to be addressed: mac,
> mingw and the moc scanner bugs. Any help with the scanner will be
> appreciated as it is not specially my competence. I also copied the Qt4
> examples sconstruct into CLAM subversion, so i can have it under svn
> control too until integrated.
>
> http://iua-share.upf.edu/svn/clam/trunk/CLAM/scons/sconstools/qt4.py
> http://iua-share.upf.edu/svn/clam/trunk/CLAM/scons/sconstools/SConstruct.qt
>4examples
>
> I hope to update the links and the documentation on the page soon.
> http://www.iua.upf.edu/~dgarcia/Codders/sconstools.html
>
> Changelog:
>
> * Updated qt4 scons tool
> ** Extended copyright notice years
> ** Fix: moc uses _CPPINCFLAGS to add cpp include flags
> ** Copied new way of adding the builder from Qt3 tool
> ** Added new modules in qt4: QtAssistant, QtScript, QtDesignerComponents
> ** Added new module QtWebKit (still not in qt4 but already available as
> separate package)
> ** Fix: QtDBus module was missspelled as QtDBUS
> ** QtUiTools has pkg-config file so it uses it
> ** Kludge hacks to overcome bugs in .pc files distributed with qt:
> *** QtAssistant/QtAssistantClient: the names used for the module (libs,
> pkg-config, include) is not consistent
> *** QtDBus: .pc file didnt include the /usr/include/qt4/QtDBus,
> just /usr/include/qt4/
> ** Added QT_*module*_LIB macros whenever module is used (just the ones i
> saw in mkspecs/features/qt.prf)a
>
> * Added the SConstruct.qt4examples that builds Qt4 examples
> ** Compiles 170 binaries, just 12 are not working
> ** Considering static libraries, dynamic libraries and programs
> ** Now compiles plugins and designer dependant modules
> ** Avoids 'main' symbol collisions when extra binaries in a package (TODO:
> compile them)
> ** The ones that do not work are just for one of these reasons:
> *** (6) They have the .moc files generated for a .cpp and the scanner is
> not working
> *** (2) The mocable header has a different name than the expected (added
> _p.h instead of .h)
> *** (2) Auxiliar binaries are not being generated (main with single cxx
> are discarded)
> *** (2) The same project generates two binaries both of them using many
> files *** (1) A collision between the automatically chosen binary name and
> an existing path
> ** Just the first two cases are due to a bug in the tool :-) The later 3
> are because the SConstruct intended to be too generic.
>
> On Dimarts 18 Desembre 2007, David Garcia Garzon wrote:
> > I am updating the Qt4 SCons tool[1] to the latest Qt version (mostly
> > adding new modules such as QtDBus, QtWebKit...) and addressing some long
> > standing bugs. I am not addressing at all any integration into scons
> > (unit testing, documentation and so on). My current goal is just having
> > my own project done and (as an extra) having most of the Qt examples also
> > working while fixing some nagging bugs. This is also a call for sync to
> > people in this mailing list maybe doing the integration (are you still
> > there?).
> >
> > [1] http://www.iua.upf.edu/~dgarcia/Codders/sconstools.html
> >
> > Two questions:
> >
> > First question: In order to address the 'undefined interface' error bug
> > when compiling designer plugins examples i had to turn this:
> > QT4_MOCFROMHCOM = '$QT4_MOC $QT4_MOCFROMHFLAGS -o $TARGET
> > $SOURCE', QT4_MOCFROMCXXCOM = [
> > '$QT4_MOC $QT4_MOCFROMCXXFLAGS -o $TARGET $SOURCE',
> > Action(checkMocIncluded,None)],
> > Into this:
> > QT4_MOCFROMHCOM = '$QT4_MOC $QT4_MOCFROMHFLAGS $_CPPINCFLAGS -o
> > $TARGET $SOURCE',
> > QT4_MOCFROMCXXCOM = [
> > '$QT4_MOC $QT4_MOCFROMCXXFLAGS $_CPPINCFLAGS -o $TARGET
> > $SOURCE', Action(checkMocIncluded,None)],
> >
> > That means, moc needs some include paths that are added normally into
> > CPPPATH and then translated into _CPPINCFLAGS. It works for me, but my
> > question is, am i doing something ugly doing that? Should i add a
> > QT4_MOCINCLUDEPATH or something like that instead the underscored
> > _CPPINCFLAGS?
> >
> > Second one: diffing with qt3 tool (v0.97.0d20071203.r2509) i found this
> > change:
> > env['BUILDERS']['Moc4'] = mocBld
> > instead of previous:
> > env.Append( BUILDERS = { 'Moc4': mocBld } )
> > Both seems to work. Should I change it? Karl?
> >
> > I would also like to remove the bugs on the moc scanner. But they will be
> > harder to solve. So i will post asking for further guidance. Such bugs
> > are: - A moc from a header is not generated if a homonimous source
> > doesn't include it, so headers without homonimous source will not be
> > moc'ed. - A moc from a source is never generated
> > Current moc scan is slow. If i extend it to those cases, it will be even
> > slower. Optimization hints would be appreciated.
--
David García Garzón
(Work) dgarcia at iua dot upf anotherdot es
http://www.iua.upf.edu/~dgarcia
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.clam-project.org/pipermail/clam-devel-clam-project.org/attachments/20071219/a6130c15/attachment.sig>
More information about the clam-devel
mailing list