[CMake] [PATCH] FindQt4.cmake qt4_automoc improvements

Alexander Neundorf a.neundorf-work at gmx.net
Mon May 19 14:20:36 EDT 2008


On Monday 19 May 2008, you wrote:
> > Phonon is about to move to kdesupport (i.e. outside KDE), and or that to
> > work it will use the new KDE-independent automoc4 (also in kdesupport
> > since two weeks), which supports all automoc features. We (KDE) will do a
> > reparate release of automoc4 in the foreseeable future, so it can be used
> > by non-KDE projects.
> > http://websvn.kde.org/trunk/kdesupport/
>
> This is a really good news! it will help my work on VLC and MPlayer
> backends for Phonon http://code.google.com/p/phonon-vlc-mplayer/
> and other Qt4 only projects

Cool :-)

> As I have the right guy to discuss this in front of me, I noticed that
> UseQt4.cmake includes all the Qt modules inside the include path. This
> allows devs to write #include <QMainWindow> directly instead of
> #include <QtGui/QMainWindow>
> Problem is that it increases compilation time (more path in the
> include path) + the make line is less readable (longer)

If you don't want that you don't have to use UseQt4.cmake and use 
FindQt4.cmake directly.
There you have fine grained control over that.

> So my request would be to remove
> INCLUDE_DIRECTORIES(${QT_${module}_INCLUDE_DIR}) from UseQt4.cmake
> People that still want to use #include <QMainWindow> can manually add
> include_directories(${QT_QTGUI_INCLUDE_DIR}) in their CMakeLists.txt
> What do you think about this?

By default this is not possible since it would break backwards compatibility.
It could be possible as an option for UseQt4.cmake, but I guess Clinton should 
comment on that (he is the official FindQt4.cmake maintainer)

Alex


More information about the CMake mailing list