From 80c2a3987a06abd850944aaa3f88974e157c4c02 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Fri, 20 Aug 2021 14:34:37 +0200 Subject: Fix our usage of CMake script mode in Windows configure This is a preparation for adding the -help argument to qt-configure-module.bat. Consider the call qt-configure-module.bat path/to/qt-module -help Internally, we called cmake ... -P .../QtWriteArgsFile.cmake path/to/qt-module -help which was supposed to separate the arguments and write them into config.opt. However, passing arbitrary arguments after "-P script.cmake" only worked by accident and is not supported. As soon as arguments are passed that are valid CMake arguments, like -help or -G, the CMake call would fail. Now, we let configure.bat and qt-configure-module.bat write the arguments as is into config.opt.in and let QtWriteArgsFile.cmake read this file, separate the arguments and write config.opt. Task-number: QTBUG-95943 Change-Id: I80f298a2aaf55b0f79fed86320a055eb2d2b6faa Reviewed-by: Alexey Edelev Reviewed-by: Alexandru Croitor (cherry picked from commit 57ad532e75f62212f24dd2791583b975d09aca9d) Reviewed-by: Qt Cherry-pick Bot --- bin/qt-configure-module.bat.in | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'bin') diff --git a/bin/qt-configure-module.bat.in b/bin/qt-configure-module.bat.in index 9d9243f5b8..c963111017 100644 --- a/bin/qt-configure-module.bat.in +++ b/bin/qt-configure-module.bat.in @@ -18,8 +18,9 @@ if not exist "%module_root%\CMakeLists.txt" ( ) set cmake_scripts_dir=%script_dir_path%\@__relative_path_to_cmake_scripts_dir@ -call "%script_dir_path%"\qt-cmake.bat -DSKIP_ARGS=1 -DOUT_FILE=config.opt ^ - -P "%cmake_scripts_dir%\QtWriteArgsFile.cmake" %* +echo %*>config.opt.in +call "%script_dir_path%"\qt-cmake.bat -DSKIP_ARGS=1 -DIN_FILE=config.opt.in -DOUT_FILE=config.opt ^ + -P "%cmake_scripts_dir%\QtWriteArgsFile.cmake" call "%script_dir_path%"\qt-cmake-private.bat -DOPTFILE=config.opt -DMODULE_ROOT="%module_root%" ^ -DCMAKE_COMMAND="%script_dir_path%\qt-cmake-private.bat" ^ -P "%cmake_scripts_dir%\QtProcessConfigureArgs.cmake" -- cgit v1.2.3