On Saturday 04 June 2011, Alexander Neundorf wrote: > Hi, > > one feature which all KDE developers are used to and which is also used by > qmake when building Qt is "automoc". > > This means that you don't have to write > qt4_wrap_cpp(srcs ${filesToBeMoced}) > > but instead you simply do > kde4_add_executable(hello ${srcs}) > and everything including moc is handled automatically. > > This is done so that in your foo.cpp file you include the moc-file e.g. at > the end: > > ------------------- > > Foo::Foo() > > :QObject() > > { > } > ... > > void Foo::doSomething() > { > } > > #include "foo.moc"
There is now a branch AutomocForQt on the cmake stage. Docs and a test are still missing. To enable automoc, set the target property AUTOMOC to TRUE. As discussed, this is now handled in cmGlobalGenerator::Generate(). There was one more feature which I didn't actually know about: even without a #include "foo.moc", automoc still parses the source files for "Q_OBJECT", and if it finds some, it runs moc and includes all generates moc files (which are not used anywhere else) in a generated foo_automoc.cpp file. Alex
_______________________________________________ cmake-developers mailing list cmake-developers@cmake.org http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers