RFC: automoc changes

David Faure faure at kde.org
Mon Nov 6 10:41:51 CET 2006


On Mon Nov 6 2006, Laurent Montel wrote:
> On Sunday 05 November 2006 13:48, Alexander Neundorf wrote:
> > Hi,
> {......}
> Hi,
> 
> > I see three options:
> > 1) disabled by default and require the argument AUTOMOC:
> > kde4_add_executable(kblub AUTOMOC ${mySrcs} )   # with automoc
> > kde4_add_executable(kblah ${myOtherSrcs} )      # no automoc
> >
> When we look at CMakeLists.txt into kde project we can see that all program 
> have a automoc (I didn't see a lot of cmakelists.txt which have not a automoc 
> macro) => for me it will better to use a NO_AUTOMOC argument to disable it.
I agree.

> > 2) enabled by default and require NO_AUTOMOC for disabling it:
> > kde4_add_executable(kblub ${mySrcs} )                 # with automoc
> > kde4_add_executable(kblah NO_AUTMOC ${myOtherSrcs} )  # no automoc
> > pro: no need to modify all kde4_add_*() calls
> > con: cmake will do something implicitely, which I don't really like
Well, it also handles RPATH implicitely anyway.
I know that you always wanted to avoid "too much hidden magic", but I think that's
the only way buildsystems can work: they exist in order to do the job for you, so
they -have- to do some magic so that you don't have to do it all by hand.
Having my .moc files be created is really not something I want to care about when
writing some code, it should just happen. Same for all the RPATH stuff :)
Most people don't want to know about how that stuff works, it should just work :)

> > 3) use a variable which will decide whether the functions will use automoc
> > or not:
> > set(KDE4_AUTOMOC TRUE)
> > kde4_add_executable(kblub ${mySrcs} )                 # with automoc
> > set(KDE4_AUTOMOC FALSE)
> > kde4_add_executable(kblah ${mySrcs} )                 # no automoc
> 
> I don't like it, because we must set/unset variable, and it's easy to forgot 
> to unset it into same CMakeLists.txt

I agree with Laurent, solution 2) is the nice one.

> > Btw. can we please archive this mailing list on lists.kde.org ?
Hmm, it broke again, I'll mail the guy.

-- 
David Faure, faure at kde.org, sponsored by Trolltech to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).


More information about the Kde-buildsystem mailing list