diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2015-09-17 18:17:40 -0700 |
---|---|---|
committer | Thiago Macieira <thiago.macieira@intel.com> | 2015-10-14 20:12:57 +0000 |
commit | 2d2cb6434f1d6e00f421c98b20467ff3f4388319 (patch) | |
tree | feae43744e8bbcd35f5f4d30fbc0b348051c73a6 /configure.bat | |
parent | e9121328866efa6ba3eb78a991fef785338fd55e (diff) |
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 <oswald.buddenhagen@theqtcompany.com>
Diffstat (limited to 'configure.bat')
-rw-r--r-- | configure.bat | 20 |
1 files changed, 18 insertions, 2 deletions
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 |