[CMake] [PATCH] FindQt4.cmake qt4_automoc improvements

clinton at elemtech.com clinton at elemtech.com
Tue May 27 12:17:04 EDT 2008


On Tuesday 27 May 2008 9:53:34 am Tanguy Krotoff wrote:
> Again on the INCLUDE_DIRECTORIES(${QT_${module}_INCLUDE_DIR}) from
> UseQt4.cmake Since it is confirmed that Trolltech and kdelibs devs take
> care about the #include <QtCore/Q...>

Yes, Qt does take care with their public headers to let you do that.

But, it is interesting that most of the Qt examples don't follow this 
convention.

There are 3 conventions in the Qt examples (from most common to least common):
1.  #include <QtGui>
2.  #include <QWidget>
3.  #include <QtGui/QWidget>

Both 1 and 2 require the include paths you're trying to get rid of.

>
> Will a patch like this would be OK?
>
> It simply add a variable set to ON by default.
> If OFF then UseQt4.cmake does not do
> INCLUDE_DIRECTORIES(${QT_${module}_INCLUDE_DIR})

If we do this, I'd rather have a variable initially unset.  Then let you set 
it to exclude the inlude paths.

>
> And maybe one day, this variable will be set to OFF by default...

I don't think we can ever make it the default.

I'm curious what the timings are with and without the include paths.  Can you 
give some data?
If I remember right, this thread started by talking about compile times.

Clint


More information about the CMake mailing list