KDE/kdelibs

Alexander Neundorf neundorf at kde.org
Fri Dec 4 22:35:32 CET 2009


On Friday 04 December 2009, Mike Arthur wrote:
> On 4 Dec 2009, at 18:14, Alexander Neundorf wrote:
> > Kitware uses cmake on the Mac, also with frameworks, so it must be
> > working...
>
> Correction, it must be possible :)
>
> > Ah, yes, that may be. I added support for that to the normal moc macros
> > last year or so, maybe we didn't do this for automoc.
>
> Yeh, I guess not. I'm curious, why do we use automoc rather than the
> built-in CMake stuff for this? 

Because automoc supports all automoc-features qmake provides, while cmake in 
general does not support automoc'ing (and the qt4_automoc() macro has by far 
not all these features and it would be unfeasible to try to do this in cmake 
script).

> Is there an easy test I can use to acertain this?

Write a simple hello-worl with Qt which needs to be mocced, and just use 
kde4_add_executable(). This should run automoc. Is this what you mean ?
Or just use add_executable(), and use qt4_wrap_cpp() to process the moc file.

>
> > Please try that with the FindQt4.cmake from cmake 2.8.0 and a simple
> > "hello world"-style app. It should really work.
>
> There's two ways of doing Qt with CMake, includes-wise. You either use the
> QT_USE_FILE (as CMake and I prefer to do) or you do INCLUDE_DIRECTORIES for
> each of the Qt includes (what KDE does). In a small test project I've made,
> the prior works and the latter doesn't. 

Can you please post both build trees or the compile commands, so I can see 
where they differ ?
The UseQt4.cmake file does also not set any -F options.

> As to how to solve it? I'm not entirely sure. Assuming we want KDE to keep
> using INCLUDE_DIRECTORIES then there will probably need to be a C++ level
> fix for this inside CMake. 

Hmm, not sure. Let's figure it out (but not today...).

> Regardless, I see it as a bug. You shouldn't 
> have to know about this, in my opinion, to be able to compile Qt
> applications and pretty soon the Qt/Cocoa port (using frameworks) will be
> the default.

Alex


More information about the Kde-buildsystem mailing list