Do not use qt_internal_module_info for non-module targets

The qt_internal_module_info function suppose to provide the information
only about the Qt modules. Avoid using it for the tool and extra
package dependencies, since some targets do not always exist, when
function is called.
Add the qt_internal_qtfy_target function to make the prefixed target
names.

Change-Id: Ifa8c61064d9c6c430889f00a4ead304029da711b
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This commit is contained in:
Alexey Edelev 2021-04-28 17:24:30 +02:00
parent deda40b859
commit 5ae7527411
2 changed files with 10 additions and 4 deletions

View File

@ -211,9 +211,9 @@ endfunction()
function(qt_record_extra_qt_package_dependency main_target_name dep_target_name
dep_package_version)
# EntryPoint -> Qt6EntryPoint.
qt_internal_module_info(qtfied_target_name "${dep_target_name}")
qt_record_extra_package_dependency("${main_target_name}" "${qtfied_target_name_versioned}"
"${dep_package_version}")
qt_internal_qtfy_target(qtfied_target_name "${dep_target_name}")
qt_record_extra_package_dependency("${main_target_name}"
"${qtfied_target_name_versioned}" "${dep_package_version}")
endfunction()
# This function records a 'QtFooTools' package dependency for the ${main_target_name} target
@ -249,7 +249,7 @@ function(qt_record_extra_qt_main_tools_package_dependency main_target_name
dep_non_versioned_package_name
dep_package_version)
# WaylandScannerTools -> Qt6WaylandScannerTools.
qt_internal_module_info(qtfied_package_name "${dep_non_versioned_package_name}")
qt_internal_qtfy_target(qtfied_package_name "${dep_non_versioned_package_name}")
qt_record_extra_main_tools_package_dependency(
"${main_target_name}" "${qtfied_package_name_versioned}" "${dep_package_version}")
endfunction()

View File

@ -584,3 +584,9 @@ endfunction()
function(qt_disable_apple_app_extension_api_only target)
set_target_properties("${target}" PROPERTIES QT_NO_APP_EXTENSION_ONLY_API TRUE)
endfunction()
# Common function to add Qt prefixes to the target name
function(qt_internal_qtfy_target out_var target)
set(${out_var} "Qt${target}" PARENT_SCOPE)
set(${out_var}_versioned "Qt${PROJECT_VERSION_MAJOR}${target}" PARENT_SCOPE)
endfunction()