Commit Graph

12 Commits

Author SHA1 Message Date
Stephen Kelly fa55751f83 QtAutomoc: Get the Qt version through the target link interface
In Qt 5.1, Qt5::Core has a INTERFACE_QT_MAJOR_VERSION property
of '5', and since CMake 2.8.11, Qt4::QtCore has an
INTERFACE_QT_MAJOR_VERSION of '4'. This was introduced in
commit 4aa10cd6 (FindQt4: Set the INTERFACE_QT_MAJOR_VERSION for
Qt4::QtCore, 2013-03-16), to produce an error if Qt 4 and Qt 5
are erroneously used by the same target. This can also be used
however to determine the Qt major version, and therefore the
particular moc executable to use during automoc steps. This means
that targets in a single buildsystem can use a selection of Qt 4
and Qt 5, and still take advantage of the CMAKE_AUTOMOC feature
without conflicting.
2013-05-28 01:19:37 +02:00
Stephen Kelly f776316721 Use the qt5::moc imported target instead of a variable.
The variable is provided in the Qt5 config files only for compatibility
with this automoc feature, so use the more-future-proof method instead.
2013-05-27 20:56:07 +02:00
Alex Neundorf 894e91a945 Automoc: do not use DEFINITIONS, but only COMPILE_DEFINITIONS
The docs say that this is for cmake 2.4 backwards compatibility only,
so we probably don't need to support it.

Alex
2012-09-05 22:13:30 +02:00
Alex Neundorf 2066511ca9 automoc: fix #13018, proper cmake escaping to avoid false rebuilds
The variables stored in the AutomocInfo.cmake file were not properly
escaped, so when reading them back they could turn into lists, if they
contained double quotes initially.
This patch fixes this by using cmLocalGenerator::EscapeForCMake() to
escape the variables properly.

Alex
2012-03-26 21:45:27 +02:00
Alex Neundorf 96fc5d5d07 automoc: default to strict mode, use CMAKE_AUTOMOC_RELAXED_MODE
automoc now defaults to strict mode, also with Qt4, i.e. it behaves as
the documentation says by default. I also inverted the switch
CMAKE_AUTOMOC_STRICT_MODE to CMAKE_AUTOMOC_RELAXED_MODE.
Docs and test adapted accordingly.

Alex
2011-12-13 22:11:47 +01:00
David Cole 2d1195123e Merge branch 'master' into AutomocIncludedDotMocFileHandling
Conflicts:
	Source/cmTarget.cxx
2011-12-07 16:29:13 -05:00
Alex Neundorf 62e223e8fa automoc: add variable CMAKE_AUTOMOC_STRICT_MODE, to enable strict parsing
Alex
2011-12-02 22:08:06 +01:00
Stephen Kelly a8286235a3 moc is now part of the Qt5Core module
There is no separate SrcTools module anymore.
2011-11-26 15:15:33 +01:00
Stephen Kelly b8c8cab242 Merge remote-tracking branch 'origin/master' into automoc_qt5 2011-11-10 15:46:13 +01:00
Stephen Kelly 812dab067e Don't assume the existence of QT_MAJOR_VERSION.
Also handle Qt5SrcTools_MAJOR_VERSION.
2011-11-09 23:20:20 +01:00
Alex Neundorf 52719a1d66 automoc: fix #12541, support moc options
This commit adds a new target property AUTOMOC_MOC_OPTIONS, which
can be set to add extra options for the moc invocations done via automoc.
This is equivalent to the OPTIONS parameter in the qt4_wrap_cpp() macro.

Alex
2011-11-01 14:33:11 +01:00
Alex Neundorf 126c6ead77 Add the cmake module required currently for automoc
Alex
2011-08-14 15:58:00 +02:00