diff options
author | Joerg Bornemann <joerg.bornemann@qt.io> | 2021-01-21 17:05:19 +0100 |
---|---|---|
committer | Joerg Bornemann <joerg.bornemann@qt.io> | 2021-01-22 09:16:10 +0100 |
commit | 3c54b72961678ade0edba3b5edf4f310e437c41b (patch) | |
tree | ebb076b30cacb26d46ffdef0140ee8c6da76f38e /cmake | |
parent | 7cf8e5ada9eac00b200141fdc80a2e76c0422411 (diff) |
Fix static top-level build
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ø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/QtPlugins.cmake.in | 14 |
1 files 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() |