qt5base-lts/bin/qt-configure-module.bat.in
Joerg Bornemann 2a29426e39 CMake: Fix argument passing for configure.bat / qt-configure-module.bat
Passing arguments with equal signs was broken for configure.bat and
qt-configure-module.bat. An argument FOO=BAR was split at = and written
as
    FOO
    BAR
to config.opt, breaking every attempt of assigning CMake variables.

We must not iterate over %* in batch files to avoid splitting arguments
at equal signs. Instead, pass %* unmodified to a CMake script that
writes config.opt.

Fixes: QTBUG-88019
Change-Id: I7c743a206961d1ed168f2313f864905f6b345b49
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-10-30 08:22:30 +01:00

31 lines
933 B
Batchfile

@echo off
setlocal ENABLEDELAYEDEXPANSION ENABLEEXTENSIONS
set script_dir_path=%~dp0
set script_dir_path=%script_dir_path:~0,-1%
if "%1" == "" (
call :print_usage
exit /b 1
)
set module_root=%1
set module_root=%module_root:\=/%
shift
if not exist "%module_root%\CMakeLists.txt" (
echo Error: %module_root% is not a valid Qt module source directory. >&2
call :print_usage
exit /b 1
)
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" %*
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"
goto :eof
:print_usage
echo Usage: qt-configure-module ^<module-source-dir^> [options]
goto :eof