@@ -1052,6 +1052,7 @@ def _create_module(module, requires, has_include_dir=True):
10521052 componentname = f"qt{ module } "
10531053 assert componentname not in self .cpp_info .components , f"Module { module } already present in self.cpp_info.components"
10541054 self .cpp_info .components [componentname ].set_property ("cmake_target_name" , f"Qt6::{ module } " )
1055+ self .cpp_info .components [componentname ].set_property ("cmake_target_aliases" , [f"Qt::{ module } " ])
10551056 self .cpp_info .components [componentname ].set_property ("pkg_config_name" , f"Qt6{ module } " )
10561057 if module .endswith ("Private" ):
10571058 libname = module [:- 7 ]
@@ -1069,6 +1070,7 @@ def _create_plugin(pluginname, libname, plugintype, requires):
10691070 componentname = f"qt{ pluginname } "
10701071 assert componentname not in self .cpp_info .components , f"Plugin { pluginname } already present in self.cpp_info.components"
10711072 self .cpp_info .components [componentname ].set_property ("cmake_target_name" , f"Qt6::{ pluginname } " )
1073+ self .cpp_info .components [componentname ].set_property ("cmake_target_aliases" , [f"Qt::{ pluginname } " ])
10721074 if not self .options .shared :
10731075 self .cpp_info .components [componentname ].libs = [libname + libsuffix ]
10741076 self .cpp_info .components [componentname ].libdirs = [os .path .join ("plugins" , plugintype )]
@@ -1079,6 +1081,7 @@ def _create_plugin(pluginname, libname, plugintype, requires):
10791081
10801082 # https://github.com/qt/qtbase/blob/v6.7.3/cmake/QtPlatformTargetHelpers.cmake
10811083 self .cpp_info .components ["qtPlatform" ].set_property ("cmake_target_name" , "Qt6::Platform" )
1084+ self .cpp_info .components ["qtPlatform" ].set_property ("cmake_target_aliases" , ["Qt::Platform" ])
10821085 self .cpp_info .components ["qtPlatform" ].includedirs = [os .path .join ("mkspecs" , self ._xplatform ())]
10831086 if self .settings .os == "Android" :
10841087 self .cpp_info .components ["qtPlatform" ].system_libs .append ("log" )
@@ -1292,6 +1295,7 @@ def _create_plugin(pluginname, libname, plugintype, requires):
12921295 _add_build_module ("qtQml" , self ._cmake_qt6_private_file ("Qml" ))
12931296 _create_module ("QmlModels" , ["Qml" ])
12941297 self .cpp_info .components ["qtQmlImportScanner" ].set_property ("cmake_target_name" , "Qt6::QmlImportScanner" )
1298+ self .cpp_info .components ["qtQmlImportScanner" ].set_property ("cmake_target_aliases" , ["Qt::QmlImportScanner" ])
12951299 self .cpp_info .components ["qtQmlImportScanner" ].requires = _get_corrected_reqs (["Qml" ])
12961300 if qt_quick_enabled :
12971301 _create_module ("Quick" , ["Gui" , "Qml" , "QmlModels" ])
@@ -1304,6 +1308,7 @@ def _create_plugin(pluginname, libname, plugintype, requires):
13041308
13051309 if self .options .qttools and self .options .gui and self .options .widgets :
13061310 self .cpp_info .components ["qtLinguistTools" ].set_property ("cmake_target_name" , "Qt6::LinguistTools" )
1311+ self .cpp_info .components ["qtLinguistTools" ].set_property ("cmake_target_aliases" , ["Qt::LinguistTools" ])
13071312 _create_module ("UiPlugin" , ["Gui" , "Widgets" ])
13081313 self .cpp_info .components ["qtUiPlugin" ].libs = [] # this is a collection of abstract classes, so this is header-only
13091314 self .cpp_info .components ["qtUiPlugin" ].libdirs = []
@@ -1481,15 +1486,18 @@ def _create_plugin(pluginname, libname, plugintype, requires):
14811486 if self .settings .os in ["Windows" , "iOS" ]:
14821487 if self .settings .os == "Windows" :
14831488 self .cpp_info .components ["qtEntryPointImplementation" ].set_property ("cmake_target_name" , "Qt6::EntryPointImplementation" )
1489+ self .cpp_info .components ["qtEntryPointImplementation" ].set_property ("cmake_target_aliases" , ["Qt::EntryPointImplementation" ])
14841490 self .cpp_info .components ["qtEntryPointImplementation" ].libs = [f"Qt6EntryPoint{ libsuffix } " ]
14851491 self .cpp_info .components ["qtEntryPointImplementation" ].system_libs = ["shell32" ]
14861492
14871493 if self .settings .compiler == "gcc" :
14881494 self .cpp_info .components ["qtEntryPointMinGW32" ].set_property ("cmake_target_name" , "Qt6::EntryPointMinGW32" )
1495+ self .cpp_info .components ["qtEntryPointMinGW32" ].set_property ("cmake_target_aliases" , ["Qt::EntryPointMinGW32" ])
14891496 self .cpp_info .components ["qtEntryPointMinGW32" ].system_libs = ["mingw32" ]
14901497 self .cpp_info .components ["qtEntryPointMinGW32" ].requires = ["qtEntryPointImplementation" ]
14911498
14921499 self .cpp_info .components ["qtEntryPointPrivate" ].set_property ("cmake_target_name" , "Qt6::EntryPointPrivate" )
1500+ self .cpp_info .components ["qtEntryPointPrivate" ].set_property ("cmake_target_aliases" , ["Qt::EntryPointPrivate" ])
14931501 if self .settings .os == "Windows" :
14941502 if self .settings .compiler == "gcc" :
14951503 self .cpp_info .components ["qtEntryPointPrivate" ].defines .append ("QT_NEEDS_QMAIN" )
0 commit comments