tidy-html5/build/win64/build-me.bat

170 lines
4.1 KiB
Batchfile
Raw Normal View History

2014-08-06 10:10:29 +00:00
@setlocal
2020-09-28 14:07:35 +00:00
@set TMPVER=1
@set TMPPRJ=tidy
2016-03-30 13:01:40 +00:00
@set TMPSRC=..\..
2020-09-28 14:07:35 +00:00
@set TMPBGN=%TIME%
@set TMPINS=D:\Projects\3rdParty.x64
@set TMPLOG=bldlog-1.txt
2016-03-30 13:01:40 +00:00
@set DOPAUSE=1
2020-09-28 14:07:35 +00:00
@set TMPGEN=Visual Studio 16 2019
@set TMPBR=next
@set TMPINDBG=0
2014-08-06 10:10:29 +00:00
2020-09-28 14:07:35 +00:00
@set TMPOPTS=-G "%TMPGEN%" -A x64
@set TMPOPTS=%TMPOPTS% -DCMAKE_INSTALL_PREFIX=%TMPINS%
@set TMPOPTS=%TMPOPTS% -DBUILD_SHARED_LIB=ON
2015-02-22 17:42:55 +00:00
:RPT
@if "%~1x" == "x" goto GOTCMD
2016-03-30 13:01:40 +00:00
@if "%~1x" == "NOPAUSEx" (
@set DOPAUSE=0
) else (
@set TMPOPTS=%TMPOPTS% %1
)
@shift
@goto RPT
:GOTCMD
2014-08-06 10:10:29 +00:00
@call chkmsvc %TMPPRJ%
2020-09-28 14:07:35 +00:00
@if "%TMPBR%x" == "x" goto DNBR
@call chkbranch %TMPBR%
2020-09-28 14:07:35 +00:00
:DNBR
@echo Build %TMPPRJ% 64-bits %DATE% %TIME%, in %CD%, to %TMPLOG% > %TMPLOG%
@if NOT EXIST %TMPSRC%\nul goto NOSRC
@echo Build source %TMPSRC%... all output to build log %TMPLOG%
@echo Build source %TMPSRC%... all output to build log %TMPLOG% >> %TMPLOG%
@if EXIST build-cmake.bat (
@call build-cmake >> %TMPLOG%
)
2014-08-06 10:10:29 +00:00
2020-09-28 14:07:35 +00:00
@if NOT EXIST %TMPSRC%\CMakeLists.txt goto NOCM
2014-08-06 10:10:29 +00:00
2020-09-28 14:07:35 +00:00
@echo Doing: 'cmake -S %TMPSRC% %TMPOPTS%'
@echo Doing: 'cmake -S %TMPSRC% %TMPOPTS%' >> %TMPLOG% 2>&1
@cmake -S %TMPSRC% %TMPOPTS% >> %TMPLOG% 2>&1
2014-08-06 10:10:29 +00:00
@if ERRORLEVEL 1 goto ERR1
2020-09-28 14:07:35 +00:00
@echo Doing: 'cmake --build . --config Debug'
@echo Doing: 'cmake --build . --config Debug' >> %TMPLOG% 2>&1
@cmake --build . --config Debug >> %TMPLOG% 2>&1
2014-08-06 10:10:29 +00:00
@if ERRORLEVEL 1 goto ERR2
2020-09-28 14:07:35 +00:00
@echo Doing: 'cmake --build . --config Release'
@echo Doing: 'cmake --build . --config Release' >> %TMPLOG% 2>&1
@cmake --build . --config Release >> %TMPLOG% 2>&1
2014-08-06 10:10:29 +00:00
@if ERRORLEVEL 1 goto ERR3
2020-09-28 14:07:35 +00:00
@fa4 "***" %TMPLOG%
@call elapsed %TMPBGN%
@echo Appears a successful build... see %TMPLOG%
@echo Note install location %TMPINS%
@if "%TMPINDBG%x" == "1x" (
@echo Will install Debug and Release
) else (
@echo Will only intall Release
)
2014-08-06 10:10:29 +00:00
@echo.
2016-03-30 13:01:40 +00:00
@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!
2015-02-22 17:42:55 +00:00
@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
2016-03-30 13:01:40 +00:00
@echo 'ask' utility not found in path...
@echo.
@echo *** CONTINUE with install? *** Only Ctrl+c aborts...
@echo.
2014-08-06 10:10:29 +00:00
@pause
2015-02-22 17:42:55 +00:00
:DOINST
2016-03-30 13:01:40 +00:00
@echo Proceeding with INSTALL...
@echo.
2020-09-28 14:07:35 +00:00
@if NOT "%TMPINDBG%x" == "1x" goto DNDBGIN
@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
:DNDBGIN
@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
2014-08-06 10:10:29 +00:00
@fa4 " -- " %TMPLOG%
2020-09-28 14:07:35 +00:00
@call elapsed %TMPBGN%
@echo All done... see %TMPLOG%
2014-08-06 10:10:29 +00:00
@goto END
2016-03-30 13:01:40 +00:00
: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
2020-09-28 14:07:35 +00:00
:NOSRC
@echo Can NOT locate source %TMPSRC%! *** FIX ME ***
@echo Can NOT locate source %TMPSRC%! *** FIX ME *** >> %TMPLOG%
2014-08-06 10:10:29 +00:00
@goto ISERR
2015-02-22 17:42:55 +00:00
:NOCM
2020-09-28 14:07:35 +00:00
@echo Can NOT locate %TMPSRC%\CMakeLists.txt!
@echo Can NOT locate %TMPSRC%\CMakeLists.txt! >> %TMPLOG%
2014-08-06 10:10:29 +00:00
@goto ISERR
:ERR1
2020-09-28 14:07:35 +00:00
@echo cmake configuration or generations ERROR
@echo cmake configuration or generations ERROR >> %TMPLOG%
2014-08-06 10:10:29 +00:00
@goto ISERR
:ERR2
2020-09-28 14:07:35 +00:00
@echo ERROR: Cmake build Debug FAILED!
@echo ERROR: Cmake build Debug FAILED! >> %TMPLOG%
2014-08-06 10:10:29 +00:00
@goto ISERR
:ERR3
2020-09-28 14:07:35 +00:00
@echo ERROR: Cmake build Release FAILED!
@echo ERROR: Cmake build Release FAILED! >> %TMPLOG%
2014-08-06 10:10:29 +00:00
@goto ISERR
2020-09-28 14:07:35 +00:00
:ERR4
@echo ERROR: Install Debug FAILED!
@echo ERROR: Install Debug FAILED! >> %TMPLOG%
@goto ISERR
:ERR5
@echo ERROR: Install Release FAILED!
@echo ERROR: Install Release FAILED! >> %TMPLOG%
@goto ISERR
2014-08-06 10:10:29 +00:00
:ISERR
2020-09-28 14:07:35 +00:00
@echo See %TMPLOG% for details...
2014-08-06 10:10:29 +00:00
@endlocal
@exit /b 1
:END
@endlocal
@exit /b 0
@REM eof