Skip to content
Snippets Groups Projects
Commit ccc1df52 authored by Ming Rui Zhang's avatar Ming Rui Zhang
Browse files

win32 build: parametrize Qt version

Change-Id: I1d3eb5745720804546f737a685c926a2c471a7c9
parent d4104b7b
No related branches found
No related tags found
No related merge requests found
:: Ring - native Windows LRC project generator :: Ring - native Windows LRC project generator
@echo off @echo off
setlocal
if "%1" == "/?" goto Usage if "%1" == "/?" goto Usage
if "%~1" == "" goto Usage if "%~1" == "" goto Usage
...@@ -13,12 +11,34 @@ set SCRIPTNAME=%~nx0 ...@@ -13,12 +11,34 @@ set SCRIPTNAME=%~nx0
if "%1"=="gen" ( if "%1"=="gen" (
set doGen=Y set doGen=Y
set command=Generate
) else if "%1"=="build" ( ) else if "%1"=="build" (
set doBuild=Y set doBuild=Y
set command=Build
) else ( ) else (
goto Usage goto Usage
) )
if "%doGen%"=="Y" (
if NOT "%4"=="" goto Version_New
goto Default_version
) else (
goto StartLocal
)
:Version_New
set QtDir=C:\\Qt\\%4%
set Version=%4%
if not exist "%QtDir%" echo This Qt path does not exist, using default version.
if exist "%QtDir%" goto StartLocal
:Default_version
set QtDir=C:\\Qt\\5.9.4
set Version=5.9.4
if not exist "%QtDir%" echo Default Qt path does not exist, check your installation path. &goto Usage
setlocal
:StartLocal
set arch=N set arch=N
shift shift
...@@ -28,6 +48,8 @@ if /I "%1"=="x86" ( ...@@ -28,6 +48,8 @@ if /I "%1"=="x86" (
set arch=x86 set arch=x86
) else if /I "%1"=="x64" ( ) else if /I "%1"=="x64" (
set arch=x64 set arch=x64
) else if /I "%1"=="version" (
shift
) else ( ) else (
goto Usage goto Usage
) )
...@@ -86,6 +108,7 @@ if "%arch%" neq "N" ( ...@@ -86,6 +108,7 @@ if "%arch%" neq "N" (
goto Usage goto Usage
:genLRC :genLRC
echo Generating using Qt version: %Version%
setlocal EnableDelayedExpansion setlocal EnableDelayedExpansion
set DaemonDir=%cd%\\..\\daemon set DaemonDir=%cd%\\..\\daemon
mkdir msvc mkdir msvc
...@@ -122,19 +145,28 @@ goto cleanup ...@@ -122,19 +145,28 @@ goto cleanup
echo: echo:
echo The correct usage is: echo The correct usage is:
echo: echo:
echo %0 [action] [architecture] echo %SCRIPTNAME% [action] [architecture] [version] [version_para]
echo: echo:
echo where echo where
echo: echo:
echo [action] is: gen ^| build echo [action] is: gen ^| build
echo [architecture] is: x86 ^| x64 echo [architecture] is: x86 ^| x64
echo [version] is: version - optional
echo [version_para] is: 5.9.4 ^| Qt version installed
echo: echo:
echo For example: echo For example:
echo %SCRIPTNAME% gen x86 - gen x86 static lib vs projects for qtwrapper/lrc echo %SCRIPTNAME% gen x86 - gen x86 static lib vs projects for qtwrapper/lrc for Qt version 5.9.4
echo %SCRIPTNAME% build x64 - build x64 qtwrapper/lrc static libs echo %SCRIPTNAME% gen x86 version 5.12.0 - gen x86 static lib vs projects for qtwrapper/lrc for Qt version 5.12.0
echo %SCRIPTNAME% build x64 - build x64 qtwrapper/lrc static libs
echo: echo:
goto :eof goto :eof
:cleanup :cleanup
endlocal endlocal
exit /B %ERRORLEVEL% if %ERRORLEVEL% geq 1 (
\ No newline at end of file echo %command% failed
exit %ERRORLEVEL%
) else (
echo %command% succeeded
exit /B %ERRORLEVEL%
)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment