[CMake] Building a main.cpp containing a QObject subclass

Andreas Pakulat apaku at gmx.de
Mon Oct 31 07:31:39 EDT 2011


On 31.10.11 13:10:28, Laszlo Papp wrote:
> Thank you for your help Andreas. I have tried your approach. Please
> see the attached logs. The moc files are now somehow not generated. I
> might need to use qt4_wrap_cpp after all ?

Sorry, seems like my local experiments led to wrong conclusions here. At
least CMake 2.8.5-rc2 ships with a Qt4Macros.cmake file in which
QT4_AUTOMOC can only QObject subclasses in header files (i.e. the
foo.moc form). Don't know about the cmake-builtin automoc support since
I don't have 2.8.6 at hand here.

So yes, at least with the macro's you'll have to go with qt4_wrap_cpp or
write your own automoc macro, which shouldn't be too hard if you look at
the existing one.

Andreas



More information about the CMake mailing list