From: Helge Norberg Date: Thu, 21 May 2015 19:56:18 +0000 (+0200) Subject: * Build script for Windows. X-Git-Tag: 2.1.0_Beta1~347 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=616cbec012ccfba29942e6649d945074161f5ce3;p=casparcg * Build script for Windows. --- diff --git a/build-scripts/build-windows.bat b/build-scripts/build-windows.bat index b2e73b78c..adccea7f5 100644 --- a/build-scripts/build-windows.bat +++ b/build-scripts/build-windows.bat @@ -9,41 +9,45 @@ if not defined BUILD_7ZIP exit /b 1 :: Clean and enter shadow build folder echo Cleaning... cd .. || goto :error -if exist bin rmdir bin /s /q || goto :error -if exist ipch rmdir ipch /s /q || goto :error -if exist tmp rmdir tmp /s /q || goto :error if exist build rmdir build /s /q || goto :error mkdir build || goto :error :: Unpack archived dependencies echo Unpacking archived dependencies... -"%BUILD_7ZIP%" x -y -odependencies dependencies\cef.7z || goto :error +"%BUILD_7ZIP%" x -y -odependencies64 dependencies64\large_files_win32.7z || goto :error :: Setup VC++ environment echo Setting up VC++... -call "%BUILD_VCVARSALL%" x86 || goto :error +call "%BUILD_VCVARSALL%" x64 || goto :error + +:: Run cmake +cd build || goto :error +cmake -G "Visual Studio 12 2013" -A x64 .. || goto :error :: Build with MSBuild echo Building... -msbuild /t:Clean /p:Configuration=Release || goto :error -msbuild /p:Configuration=Release /m:%BUILD_PARALLEL_THREADS% || goto :error +msbuild "CasparCG Server.sln" /t:Clean /p:Configuration=RelWithDebInfo || goto :error +msbuild "CasparCG Server.sln" /p:Configuration=RelWithDebInfo /m:%BUILD_PARALLEL_THREADS% || goto :error :: Create server folder to later zip -cd build || goto :error set SERVER_FOLDER=CasparCG Server if exist "%SERVER_FOLDER%" rmdir "%SERVER_FOLDER%" /s /q || goto :error mkdir "%SERVER_FOLDER%" || goto :error :: Copy media files echo Copying media... -xcopy ..\deploy\Server "%SERVER_FOLDER%\Server" /E /I /Y || goto :error -xcopy ..\deploy\Wallpapers "%SERVER_FOLDER%\Wallpapers" /E /I /Y || goto :error -copy ..\deploy\CasparCG_Server_2.0-brochure.pdf "%SERVER_FOLDER%" || goto :error +xcopy ..\deploy\general\Server "%SERVER_FOLDER%\Server" /E /I /Y || goto :error +xcopy ..\deploy\general\Wallpapers "%SERVER_FOLDER%\Wallpapers" /E /I /Y || goto :error +copy ..\deploy\general\CasparCG_Server_2.0-brochure.pdf "%SERVER_FOLDER%" || goto :error :: Copy binaries echo Copying binaries... -copy ..\bin\Release\* "%SERVER_FOLDER%\Server" || goto :error -xcopy ..\bin\Release\locales "%SERVER_FOLDER%\Server\locales" /E /I /Y || goto :error +copy shell\*.dll "%SERVER_FOLDER%\Server" || goto :error +copy shell\RelWithDebInfo\casparcg.exe "%SERVER_FOLDER%\Server" || goto :error +copy shell\RelWithDebInfo\casparcg.pdb "%SERVER_FOLDER%\Server" || goto :error +copy shell\casparcg.config "%SERVER_FOLDER%\Server" || goto :error +copy shell\*.ttf "%SERVER_FOLDER%\Server" || goto :error +xcopy shell\locales "%SERVER_FOLDER%\Server\locales" /E /I /Y || goto :error :: Copy documentation echo Copying documentation... diff --git a/build-scripts/set-variables-and-build-windows.bat b/build-scripts/set-variables-and-build-windows.bat index bc3cbc1d6..69afa6105 100644 --- a/build-scripts/set-variables-and-build-windows.bat +++ b/build-scripts/set-variables-and-build-windows.bat @@ -1,6 +1,6 @@ @echo off -set BUILD_VCVARSALL=C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall.bat +set BUILD_VCVARSALL=C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat set BUILD_ARCHIVE_NAME=CasparCG Server set BUILD_PARALLEL_THREADS=12 set BUILD_7ZIP=C:\Program Files\7-Zip\7z.exe diff --git a/shell/CMakeLists.txt b/shell/CMakeLists.txt index 800c2e810..ecd77f976 100644 --- a/shell/CMakeLists.txt +++ b/shell/CMakeLists.txt @@ -64,6 +64,7 @@ casparcg_add_runtime_dependency("${LIBERATION_FONTS_BIN_PATH}/LiberationSans-Reg casparcg_add_runtime_dependency("${CMAKE_CURRENT_SOURCE_DIR}/casparcg.config") set(OUTPUT_FOLDER "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}") +add_custom_command(TARGET casparcg_copy_dependencies POST_BUILD COMMAND ${CMAKE_COMMAND} -E make_directory \"${OUTPUT_FOLDER}\") foreach(FILE_TO_COPY ${CASPARCG_RUNTIME_DEPENDENCIES}) if(IS_DIRECTORY ${FILE_TO_COPY})