summaryrefslogtreecommitdiffstats
path: root/configure.bat
diff options
context:
space:
mode:
authorJoerg Bornemann <joerg.bornemann@qt.io>2020-07-02 22:40:28 +0200
committerJoerg Bornemann <joerg.bornemann@qt.io>2020-07-06 17:43:28 +0200
commitdbd3c7596542ab100a794831f1f28ea00be77a0f (patch)
treed9757c07deba88e2695202d743dd6bacd8830cd4 /configure.bat
parentffb8464cefd661cfa3428931bd80ee262cacbe13 (diff)
CMake: Teach configure.bat the -cmake argument
The configure scripts need to translate configure options to CMake arguments. It is not sensible to implement this translation twice, in sh and Windows batch language, so we're doing this once, in CMake language. The configure scripts write their options into config.opt and call a CMake script that reads config.opt, does the translation to CMake arguments and calls CMake to generate the build system. While we're at it, implement some more translations than the sh configure provided, like -extprefix, -top-level and -skip. Fixes: QTBUG-85349 Fixes: QTBUG-85350 Task-number: QTBUG-85373 Change-Id: Ida5d8b2a3c178b9349d41ec76d190c69a9456e74 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Diffstat (limited to 'configure.bat')
-rw-r--r--configure.bat22
1 files changed, 22 insertions, 0 deletions
diff --git a/configure.bat b/configure.bat
index 163e296874..f5f4a2b4cc 100644
--- a/configure.bat
+++ b/configure.bat
@@ -69,6 +69,7 @@ exit /b 1
set SYNCQT=
set PLATFORM=
set MAKE=
+set CMAKE=
call :doargs %ARGS%
if errorlevel 1 exit /b
goto doneargs
@@ -96,6 +97,9 @@ goto doneargs
if /i "%~1" == "-make-tool" goto maketool
if /i "%~1" == "--make-tool" goto maketool
+ if /i "%~1" == "-cmake" goto cmake
+ if /i "%~1" == "--cmake" goto cmake
+
:nextarg
shift
goto doargs
@@ -144,8 +148,14 @@ goto doneargs
set MAKE=%~1
goto nextarg
+:cmake
+ set CMAKE=true
+ goto nextarg
+
:doneargs
+if "%CMAKE%" == "true" goto cmake
+
rem Find various executables
for %%C in (clang-cl.exe clang.exe cl.exe icl.exe g++.exe perl.exe jom.exe) do set %%C=%%~$PATH:C
@@ -294,3 +304,15 @@ rem Launch qmake-based configure
cd "%TOPQTDIR%"
"%QTDIR%\bin\qmake.exe" "%TOPQTSRC%" -- %ARGS%
+goto :eof
+
+:cmake
+
+rem Write config.opt if we're not currently -redo'ing
+if "%rargs%" == "" (
+ if exist "%TOPQTDIR%\config.opt" del "%TOPQTDIR%\config.opt"
+ for %%a in (%ARGS%) do echo %%a >> "%TOPQTDIR%\config.opt"
+)
+
+rem Launch CMake-based configure
+cmake -DOPTFILE="%TOPQTDIR%\config.opt" -P "%QTSRC%\cmake\QtProcessConfigureArgs.cmake"