[cmake-developers] Automoc in cmake

Brad King brad.king at kitware.com
Mon Jun 6 09:37:16 EDT 2011


On 06/06/2011 03:56 AM, Alexander Neundorf wrote:
> On Saturday, June 04, 2011 10:24:52 AM 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.

I agree with Nico's response that this is too specific to integrate into
CMake itself.  That level of automagic processing puts too much inside
the add_executable and add_library commands.  This kind of customization
belongs in macros.

> Yesterday we finished porting our automoc away from Qt to pure STL/cmsys.
> It is now a small executable of 300kb and linking to nothing special.
> It is also BSD-licensed.

Great!  I suggest you package this in a distribution that provides the
executable and CMake macros to use it:

  find_package(Automoc) # substitute better name here?
  Automoc_add_executable(...)

-Brad



More information about the cmake-developers mailing list