Use the INSTALL_CMAKE_NAMESPACE to locate module tools target

Replace hardcoded Qt6 prefix of module tools target when setting
the name of tools package.

Change-Id: Icb6f38cce766c9d32216a65a8a5ce9552d622b72
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This commit is contained in:
Alexey Edelev 2022-09-01 15:46:36 +02:00
parent 54aa7e75b8
commit 0255cce4de

View File

@ -89,7 +89,7 @@ function(qt_internal_add_tool target_name)
set(search_for_host_package TRUE)
endif()
if(search_for_host_package AND NOT imported_tool_target_already_found)
set(tools_package_name "Qt6${arg_TOOLS_TARGET}Tools")
set(tools_package_name "${INSTALL_CMAKE_NAMESPACE}${arg_TOOLS_TARGET}Tools")
message(STATUS "Searching for tool '${full_name}' in package ${tools_package_name}.")
# Create the tool targets, even if QT_NO_CREATE_TARGETS is set.