Boost logo

Boost-Build :

From: Vladimir Prus (ghost_at_[hidden])
Date: 2004-07-12 08:35:53

Hi Jürgen,

> Unfortunately, the moc has one other way.
> This is to to convert
> b.cpp -> b.moc
> and in b.cpp
> #include "b.moc"
> if b.cpp contains the famous "Q_OBJECT" makro.
> (Way 2)
> This is the way the Qt Library handles private implementations, *sigh*

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

> And I'd like to have V2 Jamfiles for the upcoming Qt4 ;-))

That would be cool.

> So, I'm searching for a way to tell V2 that it should
> a) check b.cpp for the Q_OBJECT makro.
> b) run the moc if the search returns true.
> c) before b.cpp is compiled.
> It would be great if I could check the headers from Way 1, too.
> This would make the life easier.
> It think for a) I need some kind of scanner, right ?

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.

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?

- Volodya


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