2016-01-15 12:36:27 +00:00
|
|
|
:: Copyright (C) 2016 The Qt Company Ltd.
|
2016-01-21 02:33:50 +00:00
|
|
|
:: Copyright (C) 2016 Intel Corporation.
|
2022-05-10 10:06:48 +00:00
|
|
|
:: SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
2012-02-08 10:38:07 +00:00
|
|
|
|
|
|
|
@echo off
|
2016-11-18 15:24:31 +00:00
|
|
|
setlocal ENABLEDELAYEDEXPANSION ENABLEEXTENSIONS
|
2016-08-01 10:40:03 +00:00
|
|
|
set ARGS=%*
|
2012-02-08 10:38:07 +00:00
|
|
|
set QTSRC=%~dp0
|
2016-11-18 15:24:31 +00:00
|
|
|
set QTSRC=%QTSRC:~0,-1%
|
2012-02-08 10:38:07 +00:00
|
|
|
set QTDIR=%CD%
|
2015-09-18 01:17:40 +00:00
|
|
|
|
2016-11-18 15:24:31 +00:00
|
|
|
rem Parse command line
|
|
|
|
|
|
|
|
set TOPLEVEL=false
|
|
|
|
set TOPQTSRC=%QTSRC%
|
|
|
|
set TOPQTDIR=%QTDIR%
|
|
|
|
if /i not "%~1" == "-top-level" goto notoplevel
|
|
|
|
set ARGS=%ARGS:~10%
|
|
|
|
set TOPLEVEL=true
|
|
|
|
for %%P in ("%TOPQTSRC%") do set TOPQTSRC=%%~dpP
|
|
|
|
set TOPQTSRC=%TOPQTSRC:~0,-1%
|
|
|
|
for %%P in ("%QTDIR%") do set TOPQTDIR=%%~dpP
|
|
|
|
set TOPQTDIR=%TOPQTDIR:~0,-1%
|
2017-01-03 19:23:19 +00:00
|
|
|
goto wastoplevel
|
2016-11-18 15:24:31 +00:00
|
|
|
:notoplevel
|
2017-01-03 19:23:19 +00:00
|
|
|
if not exist ..\.qmake.super goto wastoplevel
|
|
|
|
echo ERROR: You cannot configure qtbase separately within a top-level build. >&2
|
|
|
|
exit /b 1
|
|
|
|
:wastoplevel
|
2016-11-18 15:24:31 +00:00
|
|
|
|
|
|
|
call :doargs %ARGS%
|
|
|
|
if errorlevel 1 exit /b
|
|
|
|
goto doneargs
|
|
|
|
|
2016-08-01 10:40:03 +00:00
|
|
|
:doargs
|
2016-11-18 15:24:31 +00:00
|
|
|
if "%~1" == "" exit /b
|
2016-08-01 10:40:03 +00:00
|
|
|
|
|
|
|
if "%~1" == "/?" goto help
|
|
|
|
if "%~1" == "-?" goto help
|
|
|
|
if /i "%~1" == "/h" goto help
|
|
|
|
if /i "%~1" == "-h" goto help
|
|
|
|
if /i "%~1" == "/help" goto help
|
|
|
|
if /i "%~1" == "-help" goto help
|
|
|
|
if /i "%~1" == "--help" goto help
|
|
|
|
|
2016-11-18 15:24:31 +00:00
|
|
|
if /i "%~1" == "-redo" goto redo
|
|
|
|
if /i "%~1" == "--redo" goto redo
|
|
|
|
|
|
|
|
:nextarg
|
2016-08-01 10:40:03 +00:00
|
|
|
shift
|
|
|
|
goto doargs
|
|
|
|
|
2016-11-18 15:24:31 +00:00
|
|
|
:help
|
|
|
|
type %QTSRC%\config_help.txt
|
2017-01-09 19:11:25 +00:00
|
|
|
if %TOPLEVEL% == false exit /b 1
|
|
|
|
for /d %%p in ("%TOPQTSRC%"\qt*) do (
|
|
|
|
if not "%%p" == "%QTSRC%" (
|
|
|
|
if exist "%%p\config_help.txt" (
|
|
|
|
echo.
|
|
|
|
type "%%p\config_help.txt"
|
2016-12-23 19:34:38 +00:00
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
2016-11-18 15:24:31 +00:00
|
|
|
exit /b 1
|
|
|
|
|
|
|
|
:redo
|
|
|
|
if not exist "%TOPQTDIR%\config.opt" goto redoerr
|
2022-11-18 10:31:02 +00:00
|
|
|
echo %ARGS% > %TOPQTDIR%\config.redo.in
|
|
|
|
set redoing=""
|
2016-11-18 15:24:31 +00:00
|
|
|
goto nextarg
|
|
|
|
:redoerr
|
|
|
|
echo No config.opt present - cannot redo configuration. >&2
|
|
|
|
exit /b 1
|
2012-02-08 10:38:07 +00:00
|
|
|
|
2020-12-17 20:44:21 +00:00
|
|
|
:doneargs
|
2020-07-02 20:40:28 +00:00
|
|
|
|
2020-11-02 19:45:01 +00:00
|
|
|
cd "%TOPQTDIR%"
|
2020-07-02 20:40:28 +00:00
|
|
|
|
|
|
|
rem Write config.opt if we're not currently -redo'ing
|
2022-11-18 10:31:02 +00:00
|
|
|
set OPT_FILE_PATH=%TOPQTDIR%\config.opt
|
|
|
|
set OPT_TMP_FILE_PATH=%TOPQTDIR%\config.opt.in
|
2023-09-01 14:39:59 +00:00
|
|
|
set REDO_FILE_PATH=%TOPQTDIR%\config.redo.last
|
2022-11-18 10:31:02 +00:00
|
|
|
set REDO_TMP_FILE_PATH=%TOPQTDIR%\config.redo.in
|
2022-11-11 13:48:57 +00:00
|
|
|
set FRESH_REQUESTED_ARG=
|
2022-11-18 10:31:02 +00:00
|
|
|
if not defined redoing (
|
|
|
|
echo.%*>"%OPT_TMP_FILE_PATH%"
|
2023-02-03 13:38:37 +00:00
|
|
|
|
2022-11-18 10:31:02 +00:00
|
|
|
cmake -DIN_FILE="%OPT_TMP_FILE_PATH%" -DOUT_FILE="%OPT_FILE_PATH%" -DIGNORE_ARGS=-top-level -P "%QTSRC%\cmake\QtWriteArgsFile.cmake"
|
|
|
|
) else (
|
2023-02-03 13:38:37 +00:00
|
|
|
echo. 2> "%OPT_TMP_FILE_PATH%"
|
|
|
|
for /F "usebackq tokens=*" %%A in ("%OPT_FILE_PATH%") do echo "%%A" >> "%OPT_TMP_FILE_PATH%"
|
|
|
|
|
2022-11-18 10:31:02 +00:00
|
|
|
cmake -DIN_FILE="%OPT_TMP_FILE_PATH%" -DREDO_FILE="%REDO_TMP_FILE_PATH%" -DOUT_FILE="%REDO_FILE_PATH%" -DIGNORE_ARGS="-top-level;-redo;--redo" -P "%QTSRC%\cmake\QtWriteArgsFile.cmake"
|
|
|
|
|
|
|
|
set OPT_FILE_PATH=%REDO_FILE_PATH%
|
2022-11-11 13:48:57 +00:00
|
|
|
set FRESH_REQUESTED_ARG=-DFRESH_REQUESTED=TRUE
|
2020-07-02 20:40:28 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
rem Launch CMake-based configure
|
2020-09-17 10:16:47 +00:00
|
|
|
set TOP_LEVEL_ARG=
|
|
|
|
if %TOPLEVEL% == true set TOP_LEVEL_ARG=-DTOP_LEVEL=TRUE
|
2022-11-18 10:31:02 +00:00
|
|
|
cmake -DOPTFILE="%OPT_FILE_PATH%" %TOP_LEVEL_ARG% %FRESH_REQUESTED_ARG% -P "%QTSRC%\cmake\QtProcessConfigureArgs.cmake"
|