diff --git a/src/corelib/Qt6CTestMacros.cmake b/src/corelib/Qt6CTestMacros.cmake index d40be5ac61d..e45be20018a 100644 --- a/src/corelib/Qt6CTestMacros.cmake +++ b/src/corelib/Qt6CTestMacros.cmake @@ -125,6 +125,9 @@ function(_qt_internal_get_cmake_test_configure_options out_var) list(APPEND option_list "-DCMAKE_MESSAGE_LOG_LEVEL=DEBUG") list(APPEND option_list "-DCMAKE_AUTOGEN_VERBOSE=TRUE") + if(QT_BUILD_DIR) + list(APPEND option_list "-DQT_BUILD_DIR=${QT_BUILD_DIR}") + endif() if(APPLE AND CMAKE_OSX_ARCHITECTURES) list(LENGTH CMAKE_OSX_ARCHITECTURES osx_arch_count)