From cd08a709dbeee7a2ac66c6dab0025029e6036f6b Mon Sep 17 00:00:00 2001 From: Geoff McLane Date: Wed, 30 Mar 2016 15:16:44 +0200 Subject: [PATCH] Some improvements in build-me.bat --- build/cmake/build-me.bat | 84 +++++++++++++++++++++++++--------------- 1 file changed, 53 insertions(+), 31 deletions(-) diff --git a/build/cmake/build-me.bat b/build/cmake/build-me.bat index 9c9323c..6a69d67 100644 --- a/build/cmake/build-me.bat +++ b/build/cmake/build-me.bat @@ -5,15 +5,19 @@ @set TMPSRC=..\.. @set TMPBGN=%TIME% @set TMPINS=..\..\..\software -@set DOTINST=0 @set TMPLOG=bldlog-1.txt +@set DOPAUSE=1 @set TMPOPTS=-DCMAKE_INSTALL_PREFIX=%TMPINS% @set TMPOPTS=%TMPOPTS% -DBUILD_SHARED_LIB=ON :RPT @if "%~1x" == "x" goto GOTCMD -@set TMPOPTS=%TMPOPTS% %1 +@if "%~1x" == "NOPAUSEx" ( + @set DOPAUSE=0 +) else ( + @set TMPOPTS=%TMPOPTS% %1 +) @shift @goto RPT :GOTCMD @@ -34,51 +38,63 @@ @if NOT EXIST %TMPSRC%\CMakeLists.txt goto NOCM -cmake %TMPSRC% %TMPOPTS% >> %TMPLOG% 2>&1 +@echo Doing: 'cmake %TMPSRC% %TMPOPTS%' +@echo Doing: 'cmake %TMPSRC% %TMPOPTS%' >> %TMPLOG% 2>&1 +@cmake %TMPSRC% %TMPOPTS% >> %TMPLOG% 2>&1 @if ERRORLEVEL 1 goto ERR1 -cmake --build . --config Debug >> %TMPLOG% 2>&1 +@echo Doing: 'cmake --build . --config Debug' +@echo Doing: 'cmake --build . --config Debug' >> %TMPLOG% 2>&1 +@cmake --build . --config Debug >> %TMPLOG% 2>&1 @if ERRORLEVEL 1 goto ERR2 -cmake --build . --config Release >> %TMPLOG% 2>&1 +@echo Doing: 'cmake --build . --config Release' +@echo Doing: 'cmake --build . --config Release' >> %TMPLOG% 2>&1 +@cmake --build . --config Release >> %TMPLOG% 2>&1 @if ERRORLEVEL 1 goto ERR3 @fa4 "***" %TMPLOG% @call elapsed %TMPBGN% @echo Appears a successful build... see %TMPLOG% - -@if "%DOTINST%x" == "0x" goto DNTINST -@echo Building installation zips... moment... -@call build-zips Debug -@call build-zips Release -@echo Done installation zips... -:DNTINST - +@echo Note install location %TMPINS% @echo. -@REM echo No install at this time, but there is a updexe.bat to copy the EXE to c:\MDOS... -@REM goto END - -@echo Continue with install? Only Ctrl+c aborts... +@REM ############################################## +@REM Check if should continue with install +@REM ############################################## +@if "%DOPAUSE%x" == "0x" goto DOINST +@choice /? >nul 2>&1 +@if ERRORLEVEL 1 goto NOCHOICE +@choice /D N /T 10 /M "Pausing for 10 seconds. Def=N" +@if ERRORLEVEL 2 goto GOTNO +@goto DOINST +:NOCHOICE +@echo Appears OS does not have the 'choice' command! +@ask *** CONTINUE with install? *** Only y continues +@if ERRORLEVEL 2 goto NOASK +@if ERRORLEVEL 1 goto DOINST +@echo Skipping install to %TMPINST% at this time... +@echo. +@goto END +:NOASK +@echo 'ask' utility not found in path... +@echo. +@echo *** CONTINUE with install? *** Only Ctrl+c aborts... +@echo. @pause -cmake --build . --config Debug --target INSTALL >> %TMPLOG% 2>&1 +:DOINST +@echo Proceeding with INSTALL... +@echo. +@echo Doing: 'cmake --build . --config Debug --target INSTALL' +@echo Doing: 'cmake --build . --config Debug --target INSTALL' >> %TMPLOG% 2>&1 +@cmake --build . --config Debug --target INSTALL >> %TMPLOG% 2>&1 @if ERRORLEVEL 1 goto ERR4 -@REM if EXIST install_manifest.txt ( -@REM copy install_manifest.txt install_manifest_dbg.txt >nul -@REM echo. >> %TMPINS%/installed.txt -@REM echo = %TMPRJ% Debug install %DATE% %TIME% >> %TMPINS%/installed.txt -@REM type install_manifest.txt >> %TMPINS%/installed.txt -@REM ) -cmake --build . --config Release --target INSTALL >> %TMPLOG% 2>&1 +@echo Doing: 'cmake --build . --config Release --target INSTALL' +@echo Doing: 'cmake --build . --config Release --target INSTALL' >> %TMPLOG% 2>&1 +@cmake --build . --config Release --target INSTALL >> %TMPLOG% 2>&1 @if ERRORLEVEL 1 goto ERR5 -@REM if EXIST install_manifest.txt ( -@REM copy install_manifest.txt install_manifest_rel.txt >nul -@REM echo. >> %TMPINS%/installed.txt -@REM echo = %TMPRJ% Release install %DATE% %TIME% >> %TMPINS%/installed.txt -@REM type install_manifest.txt >> %TMPINS%/installed.txt -@REM ) @fa4 " -- " %TMPLOG% @@ -87,6 +103,12 @@ cmake --build . --config Release --target INSTALL >> %TMPLOG% 2>&1 @goto END +:GOTNO +@echo. +@echo No install at this time, but there may be an updexe.bat to copy the EXE to c:\MDOS... +@echo. +@goto END + :NOSRC @echo Can NOT locate source %TMPSRC%! *** FIX ME *** @echo Can NOT locate source %TMPSRC%! *** FIX ME *** >> %TMPLOG%