KDE/kdelibs

Alexander Neundorf neundorf at kde.org
Sat Dec 5 16:54:56 CET 2009


On Friday 04 December 2009, Mike Arthur wrote:
> On 4 Dec 2009, at 21:35, Alexander Neundorf wrote:
> > 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).
>
> Ok, cool. With this in mind, do you think there would ever be any chance of
> getting this inside CMake itself (out of interest)?

Yes. It "just" needs to be ported away from Qt. CMake itself uses STL and has 
its own cross platform helper classes. I think the biggest change would 
probably be QProcess.
That's the list of includes used in kde4automoc.cpp (it's really just one 
file):

#include <QtCore/QCoreApplication>
#include <QtCore/QDateTime>
#include <QtCore/QDir>
#include <QtCore/QFile>
#include <QtCore/QFileInfo>
#include <QtCore/QHash>
#include <QtCore/QProcess>
#include <QtCore/QQueue>
#include <QtCore/QRegExp>
#include <QtCore/QStringList>
#include <QtCore/QTextStream>
#include <QtCore/QtDebug>

Matthias relicensed it already to BSD some time ago for that purpose.

> > 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.
>
> Cool, thanks!
>
> > 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.
>
> They are both entered in the following attachment to the last mail which
> you should have got. Attached it again to this just in case. It should be
> obvious from looking at the CMakeLists.txt what to modify to see it
> work/not work.

Hmm, the attached archive doesn't really help me.
What I'd like to see is one complete (but maybe unbuilt) build tree with cmake 
with UseQt4.cmake, and one without UseQt4.cmake, so I can have a look what 
the differences are.
Or you post the compile commands for one file got both cases.

Alex


More information about the Kde-buildsystem mailing list