2018-01-28 22:32:11 +00:00
|
|
|
@echo off
|
|
|
|
|
2018-03-01 18:05:53 +00:00
|
|
|
REM defaults - override them by creating a build_env.bat file
|
2018-01-28 22:32:11 +00:00
|
|
|
set B_BUILD_TYPE=Debug
|
2018-02-10 18:44:33 +00:00
|
|
|
set B_QT_ROOT=C:\Qt
|
2018-08-05 17:08:42 +00:00
|
|
|
set B_QT_VER=5.11.1
|
|
|
|
set B_QT_MSVC=msvc2017_64
|
2018-01-28 22:32:11 +00:00
|
|
|
set B_BONJOUR=C:\Program Files\Bonjour SDK
|
|
|
|
|
|
|
|
set savedir=%cd%
|
|
|
|
cd /d %~dp0
|
|
|
|
|
2019-04-10 22:36:42 +00:00
|
|
|
REM cmake generator name for the target build system
|
|
|
|
if "%VisualStudioVersion%"=="15.0" (
|
2019-04-11 15:42:59 +00:00
|
|
|
set cmake_gen=Visual Studio 15 2017
|
2019-04-10 22:36:42 +00:00
|
|
|
) else if "%VisualStudioVersion%"=="16.0" (
|
|
|
|
set cmake_gen=Visual Studio 16 2019
|
|
|
|
) else (
|
|
|
|
echo Visual Studio version was not detected.
|
|
|
|
echo Did you forget to run inside a VS developer prompt?
|
|
|
|
echo Using the default cmake generator.
|
|
|
|
set cmake_gen=Visual Studio 16 2019
|
|
|
|
)
|
|
|
|
|
2018-03-01 18:05:53 +00:00
|
|
|
if exist build_env.bat call build_env.bat
|
2018-01-28 22:32:11 +00:00
|
|
|
|
2018-02-10 18:44:33 +00:00
|
|
|
REM needed by cmake to set bonjour include dir
|
|
|
|
set BONJOUR_SDK_HOME=%B_BONJOUR%
|
|
|
|
|
|
|
|
REM full path to Qt stuff we need
|
|
|
|
set B_QT_FULLPATH=%B_QT_ROOT%\%B_QT_VER%\%B_QT_MSVC%
|
|
|
|
|
2018-02-23 19:02:38 +00:00
|
|
|
echo Bonjour: %BONJOUR_SDK_HOME%
|
|
|
|
echo Qt: %B_QT_FULLPATH%
|
|
|
|
|
2020-05-30 21:33:08 +00:00
|
|
|
git submodule update --init --recursive
|
|
|
|
|
2018-01-28 22:32:11 +00:00
|
|
|
rmdir /q /s build
|
|
|
|
mkdir build
|
2018-02-06 22:13:35 +00:00
|
|
|
if ERRORLEVEL 1 goto failed
|
2018-01-28 22:32:11 +00:00
|
|
|
cd build
|
2019-04-11 15:42:59 +00:00
|
|
|
cmake -G "%cmake_gen%" -A x64 -D CMAKE_BUILD_TYPE=%B_BUILD_TYPE% -D CMAKE_PREFIX_PATH="%B_QT_FULLPATH%" -D DNSSD_LIB="%B_BONJOUR%\Lib\x64\dnssd.lib" -D QT_VERSION=%B_QT_VER% ..
|
2018-01-28 22:32:11 +00:00
|
|
|
if ERRORLEVEL 1 goto failed
|
2018-03-13 21:06:16 +00:00
|
|
|
echo @msbuild barrier.sln /p:Platform="x64" /p:Configuration=%B_BUILD_TYPE% /m %B_BUILD_OPTIONS% > make.bat
|
2018-01-28 22:32:11 +00:00
|
|
|
call make.bat
|
|
|
|
if ERRORLEVEL 1 goto failed
|
|
|
|
if exist bin\Debug (
|
2018-02-10 18:44:33 +00:00
|
|
|
copy %B_QT_FULLPATH%\bin\Qt5Cored.dll bin\Debug\ > NUL
|
|
|
|
copy %B_QT_FULLPATH%\bin\Qt5Guid.dll bin\Debug\ > NUL
|
|
|
|
copy %B_QT_FULLPATH%\bin\Qt5Networkd.dll bin\Debug\ > NUL
|
|
|
|
copy %B_QT_FULLPATH%\bin\Qt5Widgetsd.dll bin\Debug\ > NUL
|
|
|
|
copy %B_QT_FULLPATH%\bin\Qt5Cored.dll bin\Debug\ > NUL
|
2018-01-28 22:32:11 +00:00
|
|
|
copy ..\ext\openssl\windows\x64\bin\* bin\Debug\ > NUL
|
|
|
|
copy ..\res\openssl\barrier.conf bin\Debug\ > NUL
|
2019-09-19 20:41:51 +00:00
|
|
|
mkdir bin\Debug\platforms
|
|
|
|
copy %B_QT_FULLPATH%\plugins\platforms\qwindowsd.dll bin\Debug\platforms\ > NUL
|
2018-01-28 22:32:11 +00:00
|
|
|
) else if exist bin\Release (
|
2018-02-10 18:44:33 +00:00
|
|
|
copy %B_QT_FULLPATH%\bin\Qt5Core.dll bin\Release\ > NUL
|
|
|
|
copy %B_QT_FULLPATH%\bin\Qt5Gui.dll bin\Release\ > NUL
|
|
|
|
copy %B_QT_FULLPATH%\bin\Qt5Network.dll bin\Release\ > NUL
|
|
|
|
copy %B_QT_FULLPATH%\bin\Qt5Widgets.dll bin\Release\ > NUL
|
|
|
|
copy %B_QT_FULLPATH%\bin\Qt5Core.dll bin\Release\ > NUL
|
2018-01-28 22:32:11 +00:00
|
|
|
copy ..\ext\openssl\windows\x64\bin\* bin\Release\ > NUL
|
|
|
|
copy ..\res\openssl\barrier.conf bin\Release\ > NUL
|
2018-02-10 21:46:50 +00:00
|
|
|
mkdir bin\Release\platforms
|
|
|
|
copy %B_QT_FULLPATH%\plugins\platforms\qwindows.dll bin\Release\platforms\ > NUL
|
2018-01-28 22:32:11 +00:00
|
|
|
) else (
|
2021-09-22 20:43:29 +00:00
|
|
|
echo Remember to copy supporting binaries and configuration files!
|
2018-01-28 22:32:11 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
echo Build completed successfully
|
2020-06-03 14:03:14 +00:00
|
|
|
set BUILD_FAILED=0
|
2018-01-28 22:32:11 +00:00
|
|
|
goto done
|
|
|
|
|
|
|
|
:failed
|
2020-06-03 14:03:14 +00:00
|
|
|
set BUILD_FAILED=%ERRORLEVEL%
|
2018-01-28 22:32:11 +00:00
|
|
|
echo Build failed
|
|
|
|
|
|
|
|
:done
|
2018-02-07 21:33:48 +00:00
|
|
|
cd /d %savedir%
|
|
|
|
|
2018-01-28 22:32:11 +00:00
|
|
|
set B_BUILD_TYPE=
|
|
|
|
set B_QT_ROOT=
|
2018-02-10 18:44:33 +00:00
|
|
|
set B_QT_VER=
|
|
|
|
set B_QT_MSVC=
|
2018-01-28 22:32:11 +00:00
|
|
|
set B_BONJOUR=
|
2018-02-10 18:44:33 +00:00
|
|
|
set BONJOUR_SDK_HOME=
|
|
|
|
set B_QT_FULLPATH=
|
2018-02-06 22:13:35 +00:00
|
|
|
set savedir=
|
2019-04-10 18:08:09 +00:00
|
|
|
set cmake_gen=
|
2020-06-03 14:03:14 +00:00
|
|
|
|
|
|
|
EXIT /B %BUILD_FAILED%
|