From 1c2ca4004d75e2ce400733ba14ed452dc3f0ca78 Mon Sep 17 00:00:00 2001 From: Alexey Edelev Date: Mon, 14 Jun 2021 16:58:33 +0200 Subject: [PATCH] Fix invalid path to the qt-cmake.bat when calling qt-internal-configure-tests.bat Since qt-internal-configure-tests.bat is located in the same folder as qt-cmake.bat the relative_path_from_libexec_dir_to_bin_dir is empty. Passing doubled backslash in the windows path causes an issue for the cmd.exe batch interpreter. Extra backslashes are treated by %~dp0 as a start of the relative path. The following error appears: Could not find toolchain file: ...\install\bin\..\/../lib/cmake/Qt6/qt.toolchain.cmake This appends an extra backslash to relative_bin_dir only if relative_path_from_libexec_dir_to_bin_dir is not empty. Change-Id: Id2fd6c5fa9d73060350f298262c6e93a4887eeb3 Reviewed-by: Qt CI Bot Reviewed-by: Alexandru Croitor --- libexec/qt-internal-configure-tests.bat.in | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/libexec/qt-internal-configure-tests.bat.in b/libexec/qt-internal-configure-tests.bat.in index dd2b0cc9c4a..a59db01b14a 100644 --- a/libexec/qt-internal-configure-tests.bat.in +++ b/libexec/qt-internal-configure-tests.bat.in @@ -5,5 +5,10 @@ set script_dir_path=%script_dir_path:~0,-1% set cmake_scripts_dir=%script_dir_path% -call "%script_dir_path%"\"@relative_path_from_libexec_dir_to_bin_dir@"\qt-cmake.bat ^ +set relative_bin_dir=@relative_path_from_libexec_dir_to_bin_dir@ +if NOT "%relative_bin_dir%" == "" ( +set relative_bin_dir="%relative_bin_dir%"\ +) + +call "%script_dir_path%"\%relative_bin_dir%"qt-cmake.bat" ^ @script_passed_args@ %*