Several of the cmake bat files sets "script_dir_path". The problem is that those assignments are not local to the script files. E.g when qt-configure-module.bat gives it a value, and then call qt-cmake.bat, qt-cmake.bat will assign it a different value. And this value will overwrite the original value in qt-configure-module.bat. So when the call returns, that script can sometimes fail. This happens (for unknown reasons) if the Qt source code path contains a link to a different drive, created with mklink /d. This is typical if Windows is running in a virtual machine, and the Qt source code is shared with the host on e.g drive Q:. In that case you might want to a folder on C: be a symlink to Q:, in order to build Qt. This patch will make sure we add "setlocal" in all the affected bat files, so that any changes done to e.g "script_dir_path" stays local to each file. Pick-to: 6.5 6.6 6.7 Change-Id: Iee18e06eb0beece0c85c4345d9bfc0194e466e56 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
12 lines
516 B
Batchfile
12 lines
516 B
Batchfile
@echo off
|
|
setlocal
|
|
:: The directory of this script is the expanded absolute path of the "$qt_prefix/bin" directory.
|
|
set script_dir_path=%~dp0
|
|
|
|
:: Try to use original cmake, otherwise to make it relocatable, use any cmake found in PATH.
|
|
set cmake_path=@CMAKE_COMMAND@
|
|
if not exist "%cmake_path%" set cmake_path=cmake
|
|
|
|
set toolchain_path=%script_dir_path%\@__GlobalConfig_relative_path_from_bin_dir_to_cmake_config_dir@\qt.toolchain.cmake
|
|
"%cmake_path%" -DCMAKE_TOOLCHAIN_FILE="%toolchain_path%" @__qt_cmake_extra@ %*
|