diff options
author | Alexandru Croitor <alexandru.croitor@qt.io> | 2019-07-11 16:23:54 +0200 |
---|---|---|
committer | Alexandru Croitor <alexandru.croitor@qt.io> | 2019-07-11 15:16:09 +0000 |
commit | 078cd61751aeaa310d35a3d596a21a36004a1a0f (patch) | |
tree | 35978cb5ed6c6db773c2ecf2ed76eaf1ed0ff2ea | |
parent | a5b78a3660d9b92d12c950eddb4cb3ccc43893b1 (diff) |
Fix CMake moc scanner to look for new macro Q_NAMESPACE_EXPORT
f66c1db16c050c9d685a44a38ad7c5cf9f6fcc96 in qtbase introduced a new
macro that the moc scanner has to look for.
Set an explicit list of macros to look for in the
CMAKE_AUTOMOC_MACRO_NAMES property of every target that has AUTOMOC
enabled, otherwise CMake AUTOMOC won't run moc on files that contain
the new macro.
Change-Id: Id991a70d773cef66716621803a88e96b44a80650
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
-rw-r--r-- | cmake/QtBuild.cmake | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index df9e9008ce..fc2007517a 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -735,6 +735,13 @@ function(qt_enable_autogen_tool target tool enable) list(REMOVE_ITEM autogen_target_depends ${tool_target_name}) endif() + # f66c1db16c050c9d685a44a38ad7c5cf9f6fcc96 in qtbase introduced a new macro + # that the moc scanner has to look for. Inform the CMake moc scanner about it. + if(tool STREQUAL "moc" AND enable) + set_target_properties("${target}" PROPERTIES + AUTOMOC_MACRO_NAMES "Q_OBJECT;Q_GADGET;Q_NAMESPACE;Q_NAMESPACE_EXPORT") + endif() + set_target_properties("${target}" PROPERTIES AUTO${captitalAutogenTool} "${enable}" |