[Development] Installing Qt5Config.cmake from the Qt repo?

Alexander Neundorf neundorf at kde.org
Thu Nov 3 20:01:33 CET 2011


On Wednesday 02 November 2011, Thiago Macieira wrote:
> On Wednesday, 2 de November de 2011 13:38:15 Stephen Kelly wrote:
...
> > http://blogs.kde.org/node/4495
> 
> How does it know which files are my headers? It needs to have a list
> somewhere, which needs to be given to the Qt5 macros. It cannot scan all
> .h in the directory because:
> 
> 1) some files may be somewhere else
> 2) some .h may not belong to this target, so their moc outputs shouldn't be
> linked to this target
> 3) some .h may not belong to any target at all, just legacy stuff we kept
It does not just scan all *.h files, it only looks for headers which seem to 
belong to a cpp file (i.e. for a foo.h if there is a foo.cpp in the target).

> 4) some headers may not be named *.h
Multiple options are checked, *.h, *.hpp, *.hxx


You are right, this is guessing, and I don't like it.
But this is what automoc has been doing all the time since autotools time, so 
it has to be this way to be compatible.

I would prefer if it would not search for header files, but only use those 
header files which are listed as part of the sources for the target.

But this means you have to edit your cmake files if you add a Q_OBJECT in a 
header, and this was not wanted for KDE developers.

But we may be able to change this for Qt5.

Alex



More information about the Development mailing list