diff --git a/make-lrc.bat b/make-lrc.bat index 262b7db9fdea624aed9465cb6329f7d47f61818a..3f2929a45c8e57adfbaf097ad38aad10f3cdb40a 100644 --- a/make-lrc.bat +++ b/make-lrc.bat @@ -1,8 +1,6 @@ :: Ring - native Windows LRC project generator @echo off -setlocal - if "%1" == "/?" goto Usage if "%~1" == "" goto Usage @@ -13,12 +11,34 @@ set SCRIPTNAME=%~nx0 if "%1"=="gen" ( set doGen=Y + set command=Generate ) else if "%1"=="build" ( set doBuild=Y + set command=Build ) else ( 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 shift @@ -28,6 +48,8 @@ if /I "%1"=="x86" ( set arch=x86 ) else if /I "%1"=="x64" ( set arch=x64 +) else if /I "%1"=="version" ( + shift ) else ( goto Usage ) @@ -86,6 +108,7 @@ if "%arch%" neq "N" ( goto Usage :genLRC +echo [96mGenerating using Qt version: %Version%[0m setlocal EnableDelayedExpansion set DaemonDir=%cd%\\..\\daemon mkdir msvc @@ -122,19 +145,28 @@ goto cleanup echo: echo The correct usage is: echo: -echo %0 [action] [architecture] +echo %SCRIPTNAME% [action] [architecture] [version] [version_para] echo: echo where echo: echo [action] is: gen ^| build echo [architecture] is: x86 ^| x64 +echo [version] is: version - optional +echo [version_para] is: 5.9.4 ^| Qt version installed echo: echo For example: -echo %SCRIPTNAME% gen x86 - gen x86 static lib vs projects for qtwrapper/lrc -echo %SCRIPTNAME% build x64 - build x64 qtwrapper/lrc static libs +echo %SCRIPTNAME% gen x86 - gen x86 static lib vs projects for qtwrapper/lrc for Qt version 5.9.4 +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: goto :eof :cleanup endlocal -exit /B %ERRORLEVEL% \ No newline at end of file +if %ERRORLEVEL% geq 1 ( + echo [91m%command% failed[0m + exit %ERRORLEVEL% +) else ( + echo [92m%command% succeeded[0m + exit /B %ERRORLEVEL% +)