Boost logo

Boost-Build :

From: Juergen Hunold (hunold_at_[hidden])
Date: 2004-07-12 13:34:02

Hi Volodya !

On Monday 12 July 2004 15:35, Vladimir Prus wrote:
> Hi Jürgen,

> > (Way 2)
> > This is the way the Qt Library handles private implementations,
> > *sigh*

> Oh... the moc C++ source, not header. Wow.

Yes, indeed. But this approach solves some of the problems generated by
the "moc-approach". But I think thats OT here ;-))

> > And I'd like to have V2 Jamfiles for the upcoming Qt4 ;-))
> That would be cool.

Yep. I happily started coding Jamfiles for Qt-4-tp1 but then ran into
this moc issue...

> > So, I'm searching for a way to tell V2 that it should

> Hmm.... I think I can imagine a solution which create _moc virtual
> targets for all cpp files, creates real jam targets for them but does
> not add dependency from "all" to those targets. So, you don't even
> have to look for Q_OBJECT macro. If you see "#include b_moc.cpp" the
> created but unused moc target will be picked up.

Sounds good. But the #include's are typical
#include "qsomething.moc"
but this should be handled by the standard c/c++ scanner, which does not
look at the files extentions

> Before I go on thinking about the above solution, which might work
> but it a bit dirty, can you tell how Qt determines which sources to
> run though moc? Maybe, specifying explicit list is OK?

Of course. It is all easy if you use qmake, Trolltechs
qmake projects typically contain three lists:
a) headers
b) sources
c) ui-files from Designer

qmake then scans these files and builds a Makefile containing rules
and dependencies for all files which must be
a) run through uic
b) moc'ed
c) compiled

Files to be moc'ed must have a Q_OBJECT macro in them.

If I think about it, an explicit file list would be ok.

I think I must take a closer at qmake and see whether I can teach it to
generate Jamfiles as well. In this case a separate list of source to be
moc'ed would be good, too.



* Dipl.-Math. Jürgen Hunold ! Institut für Verkehrswesen, Eisenbahnbau
* voice: ++49 511 762-2529 ! und -betrieb, Universität Hannover 
* fax : ++49 511 762-3001 ! Appelstrasse 9a, D-30167 Hannover
* hunold_at_[hidden] !

Boost-Build list run by bdawes at, david.abrahams at, gregod at, cpdaniel at, john at