Wow, epic bump. Ccing the list so others can jump in. On Thu, Jun 03, 2010 at 10:09:04PM +0200, Daniel Dekkers wrote: > Working on Qt and cmake. You wrote. > > > I just spent some time struggling with this macro so I wanted to post an > example. Maybe this can be used to expand on the documentation. > > First you need to collect all the headers on which you want to run moc: > > set (FOO_MOC_HEADERS foo_header.h)
> . now I was wondering if you have to enumerate all the headers by hand. > Can't I just take all header files and "moc" them. I was hoping that moc > would ignore header files without the Q_OBJECT makro (which doesn't seem to > be the case when using cmake). I recommend enumerating all the headers. If you're worried about duplication, you can have a variable MOC_HEADERS and another variable HEADERS, then before your add_library() or add_executable(), combine them into ALL_HEADERS. You can also take a look at the qt4_automoc() macro from FindQt4.cmake. hth, tyler _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake