[cmake-developers] A few more changes to automoc before 2.8.7
neundorf at kde.org
Sun Dec 11 12:40:00 EST 2011
in current CMake HEAD automoc has two modes: strict and not strict.
In strict mode it is behaves exactly how the documentation says:
"If an #include statement like #include "moc_foo.cpp" is found, the Q_OBJECT
class declaration is expected in the header, and moc is run on the header
If an #include statement like #include "foo.moc" is found, then a Q_OBJECT is
expected in the current source file and moc is run on the file itself."
In non-strict mode it accepts more, which makes it kdelibs4-compatible.
The strict mode should be qmake-compatible AFAIK.
Currently, if Qt4 is detected CMAKE_AUTOMOC_STRICT_MODE is initialized to
FALSE, if Qt5 is detected it is initialized to TRUE.
I'd like to change that so that it is always initialized to TRUE, so everybody
gets strict mode by default (which is easier to understand).
Then, if STRICT mode is default, I'm thinking about inverting the variable,
i.e. from CMAKE_AUTOMOC_STRICT_MODE to CMAKE_AUTOMOC_RELAXED_MODE or
something. This way the other non-standard mode would be enabled by setting a
variable to TRUE instead to FALSE, which would be better IMO.
Makes sense ?
And I would need a better name than "CMAKE_AUTOMOC_RELAXED_MODE", FORGIVING,
LOOSE, better ideas ?
And, again a question regarding wording, currently the warnings generated by
automoc say "Better <do this and that> for a more robust build."
I'd like to have a better way to express it.
"Use <this and that> for STRICT mode compatibility." ?
or "for qmake compatibility" ?
Better ideas ?
More information about the cmake-developers