Qt update

Thiago Macieira thiago at macieira.org
Tue Apr 9 09:19:21 PDT 2013


On terça-feira, 9 de abril de 2013 09.02.27, Dirk Hohndel wrote:
> > +OBJS_NEEDING_MOC =
> > +OBJS_NEEDING_UIC =
> > +HEADERS_NEEDING_MOC =
> > +
> > +# Add the objects for the header files which define QObject subclasses
> > +HEADERS_NEEDING_MOC += $(shell grep -l -s 'Q_OBJECT' $(OBJS:.o=.h))
> > +MOC_OBJS = $(HEADERS_NEEDING_MOC:.h=.moc.o)
> 
> So this assumes that every Q_OBJECT will have both a .cpp and a .h file.
> I guess that is normal in Qt...

I'd like to change the entire Makefile. Instead of listing the object files, I'd 
like to list the source files.

We'd have:

SOURCES = file1.c file2.c file3.c file4.cpp file5.cpp qt-ui/file6.cpp

With the sources list, we can use the preprocessor's -MG mode to create the 
list of dependencies. That way, we'll find whether the C++ source #includes any 
moc or uic output, which will then trigger the creation of such file. I need to 
study how to make that work, since it will require make to run in two passes 
(as when the Makefile updates).

The one remaining thing is grepping a list of headers for Q_OBJECT macros. So 
I'd like to list headers too, at least the ones with the macro.

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
   Software Architect - Intel Open Source Technology Center
      PGP/GPG: 0x6EF45358; fingerprint:
      E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.hohndel.org/pipermail/subsurface/attachments/20130409/5b41e4b4/attachment.sig>


More information about the subsurface mailing list