From 2d2cb6434f1d6e00f421c98b20467ff3f4388319 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Thu, 17 Sep 2015 18:17:40 -0700 Subject: Move the official Qt version from qglobal.h to .qmake.conf It's easier to parse than qglobal.h. The objective is actually to have macros with parts of the version number, so the major or minor numbers could be used in other preprocessor macros. Change-Id: I42e7ef1a481840699a8dffff1404eda1dd5c308d Reviewed-by: Oswald Buddenhagen --- configure.bat | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'configure.bat') diff --git a/configure.bat b/configure.bat index 1220bfedc2..47acf26d62 100644 --- a/configure.bat +++ b/configure.bat @@ -34,6 +34,7 @@ @echo off set QTSRC=%~dp0 set QTDIR=%CD% + if not exist %QTSRC%.gitignore goto sconf echo Please wait while bootstrapping configure ... @@ -47,7 +48,18 @@ if not exist mkspecs ( md mkspecs if errorlevel 1 goto exit ) -perl %QTSRC%bin\syncqt.pl -minimal -module QtCore -outdir "%QTDIR%" %QTSRC% + +rem Extract Qt's version from .qmake.conf +for /f "eol=# tokens=1,2,3,4 delims=.= " %%i in (%QTSRC%.qmake.conf) do ( + if %%i == MODULE_VERSION ( + set QTVERMAJ=%%j + set QTVERMIN=%%k + set QTVERPAT=%%l + ) +) +set QTVERSION=%QTVERMAJ%.%QTVERMIN%.%QTVERPAT% + +perl %QTSRC%bin\syncqt.pl -minimal -version %QTVERSION% -module QtCore -outdir "%QTDIR%" %QTSRC% if errorlevel 1 goto exit if not exist tools\configure ( @@ -62,7 +74,11 @@ if not "%jom.exe%" == "" set make=jom echo #### Generated by configure.bat - DO NOT EDIT! ####> Makefile echo/>> Makefile -for /f "tokens=3 usebackq" %%V in (`findstr QT_VERSION_STR %QTSRC%src\corelib\global\qglobal.h`) do @echo QTVERSION = %%~V>> Makefile +echo QTVERSION = %QTVERSION%>> Makefile +rem These must have trailing spaces to avoid misinterpretation as 5>>, etc. +echo QT_VERSION_MAJOR = %QTVERMAJ% >> Makefile +echo QT_VERSION_MINOR = %QTVERMIN% >> Makefile +echo QT_VERSION_PATCH = %QTVERPAT% >> Makefile if not "%icl.exe%" == "" ( echo CXX = icl>>Makefile echo EXTRA_CXXFLAGS = /Zc:forScope>>Makefile -- cgit v1.2.1