From 3c54b72961678ade0edba3b5edf4f310e437c41b Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Thu, 21 Jan 2021 17:05:19 +0100 Subject: Fix static top-level build MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Commit d0071a4f871 broke static top-level builds: CMake Error at .../qtbase/lib/cmake/Qt6Gui/Qt6GuiPlugins.cmake:17 (set_property): set_property can not be used on an ALIAS target. Fixed by moving the un-aliasing of the target before the set_property call. Pick-to: 6.0 Change-Id: I96c731353798a58ff9b3a664f3614ef03c897dcb Reviewed-by: Tor Arne Vestbø --- cmake/QtPlugins.cmake.in | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/cmake/QtPlugins.cmake.in b/cmake/QtPlugins.cmake.in index ce077a9ebc..8e54eea843 100644 --- a/cmake/QtPlugins.cmake.in +++ b/cmake/QtPlugins.cmake.in @@ -7,6 +7,13 @@ function(__qt_internal_add_static_plugins_once) set(_module_target "@INSTALL_CMAKE_NAMESPACE@::@QT_MODULE@") set(_qt_plugins "") + # Properties can't be set on aliased targets, so make sure to unalias the target. This is needed + # when Qt examples are built as part of the Qt build itself. + get_target_property(_aliased_target ${_module_target} ALIASED_TARGET) + if(_aliased_target) + set(_module_target ${_aliased_target}) + endif() + # Include all PluginConfig.cmake files and update the QT_PLUGINS property of the module. file(GLOB _qt_plugin_config_files "${CMAKE_CURRENT_LIST_DIR}/@INSTALL_CMAKE_NAMESPACE@*PluginConfig.cmake") foreach(_config_file ${_qt_plugin_config_files}) @@ -16,13 +23,6 @@ function(__qt_internal_add_static_plugins_once) endforeach() set_property(TARGET ${_module_target} PROPERTY QT_PLUGINS ${_qt_plugins}) - # Properties can't be set on aliased targets, so make sure to unalias the target. This is needed - # when Qt examples are built as part of the Qt build itself. - get_target_property(_aliased_target ${_module_target} ALIASED_TARGET) - if(_aliased_target) - set(_module_target ${_aliased_target}) - endif() - get_target_property(_have_added_plugins_already ${_module_target} __qt_internal_plugins_added) if(_have_added_plugins_already) return() -- cgit v1.2.3