diff options
| author | Joerg Bornemann <joerg.bornemann@qt.io> | 2025-12-03 15:31:05 +0100 |
|---|---|---|
| committer | Joerg Bornemann <joerg.bornemann@qt.io> | 2025-12-05 13:47:20 +0100 |
| commit | e29f355c4d80d311c2d096724cc8d15982b69e4b (patch) | |
| tree | dfee7200db4e1747d75c2e4a4b09d97c1adde0e8 /bin/qt-cmake.in | |
| parent | ac0aac35d7e4381aec9497084716bb4f92817923 (diff) | |
It wasn't possible to use the qt-cmake script with, e.g. the --build or
--install argument, because we called cmake with
-DCMAKE_TOOLCHAIN_FILE=..., and such arguments must be passed as the
first argument.
Since CMake 3.21 it's possible to pass the toolchain file via an
environment variable. This patch changes qt-cmake and qt-cmake.bat
accordingly.
This is safe, because we require CMake 3.22 for building Qt since Qt
6.9.
Pick-to: 6.10
Fixes: QTBUG-140785
Change-Id: I4b4bc729e80a0ab9fbe275cf2d3900111be3c1a3
Reviewed-by: Alexey Edelev <semlanik@gmail.com>
Diffstat (limited to 'bin/qt-cmake.in')
| -rwxr-xr-x | bin/qt-cmake.in | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/bin/qt-cmake.in b/bin/qt-cmake.in index 363c490960c..5203e49f878 100755 --- a/bin/qt-cmake.in +++ b/bin/qt-cmake.in @@ -16,4 +16,7 @@ toolchain_path="$script_dir_path/@__GlobalConfig_relative_path_from_bin_dir_to_c @extra_qt_cmake_code@ # Find the qt toolchain relative to the absolute bin dir path where the script is located. -exec "$cmake_path" -DCMAKE_TOOLCHAIN_FILE="$toolchain_path" @__qt_cmake_extra@ "$@" +CMAKE_TOOLCHAIN_FILE="$toolchain_path" +export CMAKE_TOOLCHAIN_FILE + +exec "$cmake_path" @__qt_cmake_extra@ "$@" |
