CMake: Don't load QtAutoDetect for top-level standalone tests

We don't load it for qtbase standalone tests, we shouldn't for
top-level builds as well.

This brings us one step closer to fixing top-level standalone tests.

Change-Id: I7c2710e61951f6789fea63422bc575a1ac611cdc
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit c971db7e5b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Alexandru Croitor
2023-07-07 13:54:11 +02:00
committed by Qt Cherry-pick Bot
parent d6fdf2d843
commit 1207e2ebcd

View File

@@ -12,7 +12,12 @@ include("${__qt6_qtbase_src_path}/.cmake.conf")
# Run platform auto-detection /before/ the first project() call and thus
# before the toolchain file is loaded.
include("${__qt6_qtbase_src_path}/cmake/QtAutoDetect.cmake")
# Don't run auto-detection when doing standalone tests. In that case, the detection
# results are taken from either QtBuildInternals or the qt.toolchain.cmake file.
if(NOT QT_BUILD_STANDALONE_TESTS)
include("${__qt6_qtbase_src_path}/cmake/QtAutoDetect.cmake")
endif()
project(Qt
VERSION "${QT_REPO_MODULE_VERSION}"