From 35fbe525fe88b5c87b2e0ab5353c749d571b167e Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Mon, 22 Jul 2019 17:44:55 +0200 Subject: [PATCH] Fix warnings regarding QML plugins Some author warnings don't make sense when dealing with QML plugins, like the messages regarding CLASS_NAME or not belonging to a certain module. Take care not to print those warnings in those cases. Change-Id: I017bd63cca650dc262337949242e813b7b6a56cc Reviewed-by: Simon Hausmann --- cmake/QtBuild.cmake | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index 306cf5ba27..e6384ceb5c 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -1534,7 +1534,7 @@ function(add_qt_plugin target) set(archive_install_directory_default "${INSTALL_QMLDIR}/${target_path}") endif() - if ("x${arg_CLASS_NAME}" STREQUAL x) + if ("x${arg_CLASS_NAME}" STREQUAL "x" AND NOT "${arg_TYPE}" STREQUAL "qml_plugin") message(AUTHOR_WARNING "add_qt_plugin called without setting CLASS_NAME.") endif() @@ -1574,8 +1574,10 @@ function(add_qt_plugin target) endif() # Save the Qt module in the plug-in's properties - qt_get_module_for_plugin("${target}" "${arg_TYPE}") - get_target_property(qt_module "${target}" QT_MODULE) + if(NOT arg_TYPE STREQUAL "qml_plugin") + qt_get_module_for_plugin("${target}" "${arg_TYPE}") + get_target_property(qt_module "${target}" QT_MODULE) + endif() # Add the plug-in to the list of plug-ins of this module if(TARGET "${qt_module}")