のねのBlog

パソコンの問題や、ソフトウェアの開発で起きた問題など書いていきます。よろしくお願いします^^。

build scribus in msvc2015

MSVC2015

build-all-platform-libs.bat x64 v140

@echo off

set MSVC_INSTALL_PATH="C:\Program Files (x86)\Microsoft Visual Studio 14.0"
if not exist %MSVC_INSTALL_PATH% (
	set MSVC_INSTALL_PATH="C:\Program Files\Microsoft Visual Studio 14.0"
)
if not exist %MSVC_INSTALL_PATH% (
	set MSVC_INSTALL_PATH="D:\Program Files (x86)\Microsoft Visual Studio 14.0"
)
if not exist %MSVC_INSTALL_PATH% (
	echo Incorrect Visual Studio install path defined in script.
	echo Please open script and fix MSVC_INSTALL_PATH.
	exit /b 1
)

set SCRIBUS_LIB_PLATFORM=Unknown
set SCRIBUS_LIB_TOOLSET=Unknown

if "%1"=="Win32" set SCRIBUS_LIB_PLATFORM=Win32
if "%1"=="x64"   set SCRIBUS_LIB_PLATFORM=x64

if "%2"=="v140"    set SCRIBUS_LIB_TOOLSET=v140

if "%SCRIBUS_LIB_PLATFORM%"=="Unknown" (
	echo Incorrect platform specified on command line
	echo on
	exit /b 1
)

if "%SCRIBUS_LIB_TOOLSET%"=="Unknown" (
	echo Incorrect toolset specified on command line
	echo on
	exit /b 1
)

echo Building for %SCRIBUS_LIB_PLATFORM% platform and %SCRIBUS_LIB_TOOLSET% toolset
if "%SCRIBUS_LIB_PLATFORM%"=="x64" (
	echo Setting up Visual Studio environment for x64 platform
	call %MSVC_INSTALL_PATH%\VC\vcvarsall.bat x86_amd64
) else (
	echo Setting up Visual Studio environment for Win32 platform
	call %MSVC_INSTALL_PATH%\VC\vcvarsall.bat x86
)
echo on

pushd %~dp0
msbuild.exe scribus-libs-msvc2012.sln /t:Clean /p:Configuration="Release" /p:Platform="%SCRIBUS_LIB_PLATFORM%" /p:PlatformToolset="%SCRIBUS_LIB_TOOLSET%"
msbuild.exe scribus-libs-msvc2012.sln /t:Clean /p:Configuration="Debug" /p:Platform="%SCRIBUS_LIB_PLATFORM%" /p:PlatformToolset="%SCRIBUS_LIB_TOOLSET%"
msbuild.exe scribus-libs-msvc2012.sln /t:Build /p:Configuration="Release" /p:Platform="%SCRIBUS_LIB_PLATFORM%" /p:PlatformToolset="%SCRIBUS_LIB_TOOLSET%"
msbuild.exe scribus-libs-msvc2012.sln /t:Build /p:Configuration="Debug" /p:Platform="%SCRIBUS_LIB_PLATFORM%" /p:PlatformToolset="%SCRIBUS_LIB_TOOLSET%"
popd

if errorlevel 1 PAUSE