qtbase/cmake/QtBuildInternals
Alexandru Croitor 4f9da08b05 CMake: Fix configuring standalone tests with a cross-compiled Qt
The Qt6 package needs to be found before calling
qt_build_internals_set_up_private_api, otherwise it will fail when
using a cross-compiled Qt, because QT_HOST_PATH will not be set.

The error is:

CMake Error at qtbase/cmake/QtBuildHelpers.cmake:341 (message):
  You need to set QT_HOST_PATH to cross compile Qt.
Call Stack (most recent call first):
  cmake/QtBuildHelpers.cmake:444 (qt_internal_check_host_path_set_for_cross_compiling)
  cmake/QtBuild.cmake:4 (qt_internal_setup_build_and_global_variables)
  cmake/QtSetup.cmake:6 (include)
  cmake/QtBuildRepoHelpers.cmake:21 (include)
  lib/cmake/Qt6BuildInternals/QtStandaloneTestTemplateProject/Main.cmake:7 (qt_build_internals_set_up_private_api)
  cmake/QtBuildRepoHelpers.cmake:1036 (include)
  cmake/QtBuildRepoHelpers.cmake:1053 (qt_internal_setup_standalone_test_when_called_as_a_find_package_component)
  lib/cmake/Qt6BuildInternals/Qt6BuildInternalsConfig.cmake:68 (qt_internal_setup_build_internals)
  CMakeLists.txt:11 (find_package)

Pick-to: 6.5 6.7 6.8
Fixes: QTBUG-127668
Change-Id: I2fb3df05ce7aed3949d428d98657fe61de723abd
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
2024-08-02 14:18:19 +02:00
..