diff options
author | Alexandru Croitor <alexandru.croitor@qt.io> | 2019-07-22 17:44:55 +0200 |
---|---|---|
committer | Alexandru Croitor <alexandru.croitor@qt.io> | 2019-07-22 16:02:30 +0000 |
commit | 35fbe525fe88b5c87b2e0ab5353c749d571b167e (patch) | |
tree | 806bafc913394006a61ee255b705a6aa5bd034c8 /cmake/QtBuild.cmake | |
parent | f60e4058aa27d19fcbb5dbde3d179ccbc6655003 (diff) |
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 <simon.hausmann@qt.io>
Diffstat (limited to 'cmake/QtBuild.cmake')
-rw-r--r-- | cmake/QtBuild.cmake | 8 |
1 files 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}") |