]> git.sesse.net Git - casparcg/blob - build-scripts/build-windows.bat
[logos] Included vector versions of the CasparCG logo.
[casparcg] / build-scripts / build-windows.bat
1 @echo off
2
3 :: Fail early if environment not set
4 if not defined BUILD_VCVARSALL exit /b 1
5 if not defined BUILD_ARCHIVE_NAME exit /b 1
6 if not defined BUILD_PARALLEL_THREADS exit /b 1
7 if not defined BUILD_7ZIP exit /b 1
8
9 :: Clean and enter shadow build folder
10 echo Cleaning...
11 cd .. || goto :error
12 if exist build rmdir build /s /q || goto :error
13 mkdir build || goto :error
14
15 :: Unpack archived dependencies
16 echo Unpacking archived dependencies...
17 "%BUILD_7ZIP%" x -y -odependencies64 dependencies64\large_files_win32.7z || goto :error
18
19 :: Setup VC++ environment
20 echo Setting up VC++...
21 call "%BUILD_VCVARSALL%" amd64 || goto :error
22
23 :: Run cmake
24 cd build || goto :error
25 cmake -G "Visual Studio 14 2015" -A x64 .. || goto :error
26
27 :: Build with MSBuild
28 echo Building...
29 msbuild "CasparCG Server.sln" /t:Clean /p:Configuration=RelWithDebInfo || goto :error
30 msbuild "CasparCG Server.sln" /p:Configuration=RelWithDebInfo /m:%BUILD_PARALLEL_THREADS% || goto :error
31
32 :: Create server folder to later zip
33 set SERVER_FOLDER=CasparCG Server
34 if exist "%SERVER_FOLDER%" rmdir "%SERVER_FOLDER%" /s /q || goto :error
35 mkdir "%SERVER_FOLDER%" || goto :error
36
37 :: Copy media files
38 echo Copying media...
39 xcopy ..\deploy\general\server "%SERVER_FOLDER%\server" /E /I /Y || goto :error
40 xcopy ..\deploy\general\wallpapers "%SERVER_FOLDER%\wallpapers" /E /I /Y || goto :error
41 xcopy ..\deploy\general\logos "%SERVER_FOLDER%\logos" /E /I /Y || goto :error
42 copy ..\deploy\general\CasparCG_Server_2.0-brochure.pdf "%SERVER_FOLDER%" || goto :error
43
44 :: Copy binaries
45 echo Copying binaries...
46 copy shell\*.dll "%SERVER_FOLDER%\server" || goto :error
47 copy shell\RelWithDebInfo\casparcg.exe "%SERVER_FOLDER%\server" || goto :error
48 copy shell\RelWithDebInfo\casparcg.pdb "%SERVER_FOLDER%\server" || goto :error
49 copy ..\shell\casparcg_auto_restart.bat "%SERVER_FOLDER%\server" || goto :error
50 copy shell\casparcg.config "%SERVER_FOLDER%\server" || goto :error
51 copy shell\*.ttf "%SERVER_FOLDER%\server" || goto :error
52 copy shell\*.pak "%SERVER_FOLDER%\server" || goto :error
53 xcopy shell\locales "%SERVER_FOLDER%\server\locales" /E /I /Y || goto :error
54
55 :: Copy documentation
56 echo Copying documentation...
57 copy ..\CHANGELOG "%SERVER_FOLDER%" || goto :error
58 copy ..\LICENSE "%SERVER_FOLDER%" || goto :error
59 copy ..\README "%SERVER_FOLDER%" || goto :error
60
61 :: Create zip file
62 echo Creating zip...
63 "%BUILD_7ZIP%" a "%BUILD_ARCHIVE_NAME%.zip" "%SERVER_FOLDER%" || goto :error
64
65 :: Skip exiting with failure
66 goto :EOF
67
68 :error
69 exit /b %errorlevel%