cutter/build.bat

39 lines
1.1 KiB
Batchfile
Raw Normal View History

2018-01-03 18:46:30 +00:00
@ECHO off
SETLOCAL ENABLEDELAYEDEXPANSION
2018-01-03 18:46:30 +00:00
IF NOT DEFINED QT32PATH SET QT32PATH=C:\Qt\5.9.2\msvc2015
IF NOT DEFINED QT64PATH SET QT64PATH=C:\Qt\5.9.2\msvc2015_64
IF NOT DEFINED VSVARSALLPATH SET VSVARSALLPATH=C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat
IF "%1" == "32" (
2018-01-03 18:46:30 +00:00
SET "PATH=%QT32PATH%\bin;%PATH%"
CALL "%VSVARSALLPATH%" x86
SET MSBUILDPLATFORM=Win32
) ELSE IF "%1" == "64" (
2018-01-03 18:46:30 +00:00
SET "PATH=%QT64PATH%\bin;%PATH%"
CALL "%VSVARSALLPATH%" x64
SET MSBUILDPLATFORM=x64
) ELSE (
2018-01-03 18:46:30 +00:00
ECHO Usage: %0 {32^|64}
EXIT /B 1
)
SET BITS=%1
2018-01-03 18:46:30 +00:00
ECHO Preparing directory
RMDIR /S /Q build%BITS%
MKDIR build%BITS%
CD build%BITS%
2018-01-03 18:46:30 +00:00
ECHO Building cutter
qmake ..\src\cutter.pro -config release -tp vc
IF !ERRORLEVEL! NEQ 0 EXIT /B 1
msbuild /m cutter.vcxproj /p:Configuration=Release;Platform=%MSBUILDPLATFORM%
IF !ERRORLEVEL! NEQ 0 EXIT /B 1
2018-01-03 18:46:30 +00:00
ECHO Deploying cutter
MKDIR cutter%BITS%
MOVE release\cutter.exe cutter%BITS%\cutter.exe
XCOPY /S ..\dist%BITS% cutter%BITS%\
windeployqt cutter%BITS%\cutter.exe
2018-01-03 18:46:30 +00:00
CD ..