2012-04-29 22:52:25 +04:00
|
|
|
@echo off
|
2012-07-13 08:43:16 +04:00
|
|
|
setlocal enabledelayedexpansion
|
2012-04-29 22:52:25 +04:00
|
|
|
|
|
|
|
rem
|
|
|
|
rem buildwin.cmd
|
|
|
|
rem
|
|
|
|
rem POCO C++ Libraries command-line build script
|
2014-01-31 19:50:33 +04:00
|
|
|
rem for MS Visual Studio 2003 to 2013
|
2012-04-29 22:52:25 +04:00
|
|
|
rem
|
2012-07-13 08:43:16 +04:00
|
|
|
rem $Id: //poco/1.4/dist/buildwin.cmd#2 $
|
2012-04-29 22:52:25 +04:00
|
|
|
rem
|
2014-01-31 19:50:33 +04:00
|
|
|
rem Copyright (c) 2006-2014 by Applied Informatics Software Engineering GmbH
|
2012-04-29 22:52:25 +04:00
|
|
|
rem and Contributors.
|
|
|
|
rem
|
|
|
|
rem Original version by Aleksandar Fabijanic.
|
|
|
|
rem Modified by Guenter Obiltschnig.
|
|
|
|
rem
|
|
|
|
rem Usage:
|
|
|
|
rem ------
|
2012-11-10 15:46:34 +04:00
|
|
|
rem buildwin VS_VERSION [ACTION] [LINKMODE] [CONFIGURATION] [PLATFORM] [SAMPLES] [TESTS] [TOOL]
|
2014-01-31 19:50:33 +04:00
|
|
|
rem VS_VERSION: 71|80|90|100|110|120
|
2012-11-10 15:46:34 +04:00
|
|
|
rem ACTION: build|rebuild|clean
|
|
|
|
rem LINKMODE: static_mt|static_md|shared|all
|
|
|
|
rem CONFIGURATION: release|debug|both
|
2014-03-27 18:48:25 +04:00
|
|
|
rem PLATFORM: Win32|x64|WinCE|WEC2013
|
2012-11-10 15:46:34 +04:00
|
|
|
rem SAMPLES: samples|nosamples
|
|
|
|
rem TESTS: tests|notests
|
2013-02-25 15:04:32 +04:00
|
|
|
rem TOOL: devenv|vcexpress|wdexpress|msbuild
|
2012-04-29 22:52:25 +04:00
|
|
|
rem
|
2012-11-10 15:46:34 +04:00
|
|
|
rem VS_VERSION is required argument. Default is build all.
|
2012-04-29 22:52:25 +04:00
|
|
|
|
|
|
|
rem Change OPENSSL_DIR to match your setup
|
2012-07-13 08:43:16 +04:00
|
|
|
set OPENSSL_DIR=C:\OpenSSL
|
2012-04-29 22:52:25 +04:00
|
|
|
set OPENSSL_INCLUDE=%OPENSSL_DIR%\include
|
2012-09-23 10:28:42 +04:00
|
|
|
set OPENSSL_LIB=%OPENSSL_DIR%\lib;%OPENSSL_DIR%\lib\VC
|
2012-04-29 22:52:25 +04:00
|
|
|
set INCLUDE=%INCLUDE%;%OPENSSL_INCLUDE%
|
|
|
|
set LIB=%LIB%;%OPENSSL_LIB%
|
|
|
|
|
2012-07-13 08:43:16 +04:00
|
|
|
rem Change MYSQL_DIR to match your setup
|
|
|
|
set MYSQL_DIR=C:\PROGRA~1\MySQL\MYSQLS~1.5
|
|
|
|
set MYSQL_INCLUDE=%MYSQL_DIR%\include
|
|
|
|
set MYSQL_LIB=%MYSQL_DIR%\lib
|
|
|
|
set INCLUDE=%INCLUDE%;%MYSQL_INCLUDE%
|
|
|
|
set LIB=%LIB%;%MYSQL_LIB%
|
|
|
|
|
2012-04-29 22:52:25 +04:00
|
|
|
set POCO_BASE=%CD%
|
2013-01-13 20:41:50 +04:00
|
|
|
set PATH=%POCO_BASE%\bin64;%POCO_BASE%\bin;%PATH%
|
2012-04-29 22:52:25 +04:00
|
|
|
|
2014-01-31 19:50:33 +04:00
|
|
|
rem VS_VERSION {71 | 80 | 90 | 100 | 110 | 120}
|
2012-04-29 22:52:25 +04:00
|
|
|
if "%1"=="" goto usage
|
2012-09-23 10:28:42 +04:00
|
|
|
set VS_VERSION=vs%1
|
2013-06-18 09:02:04 +04:00
|
|
|
set VS_64_BIT_ENV=VC\bin\x86_amd64\vcvarsx86_amd64.bat
|
2012-09-23 10:28:42 +04:00
|
|
|
|
2014-06-25 07:13:28 +04:00
|
|
|
rem PLATFORM [Win32|x64|WinCE|WEC2013]
|
|
|
|
set PLATFORM=%5
|
|
|
|
if "%PLATFORM%"=="" (set PLATFORM=Win32)
|
|
|
|
if not "%PLATFORM%"=="Win32" (
|
|
|
|
if not "%PLATFORM%"=="x64" (
|
|
|
|
if not "%PLATFORM%"=="WinCE" (
|
|
|
|
if not "%PLATFORM%"=="WEC2013" goto usage)))
|
|
|
|
|
2012-09-23 10:28:42 +04:00
|
|
|
if not defined VCINSTALLDIR (
|
2014-01-31 20:15:54 +04:00
|
|
|
if %VS_VERSION%==vs71 (
|
|
|
|
call "%VS71COMNTOOLS%vsvars32.bat"
|
|
|
|
) else (
|
|
|
|
if %VS_VERSION%==vs80 (
|
|
|
|
call "%VS80COMNTOOLS%vsvars32.bat"
|
|
|
|
) else (
|
|
|
|
if %VS_VERSION%==vs90 (
|
2014-06-25 07:13:28 +04:00
|
|
|
if %PLATFORM%==x64 (
|
2014-01-31 20:15:54 +04:00
|
|
|
call "%VS90COMNTOOLS%..\..\%VS_64_BIT_ENV%"
|
|
|
|
) else (
|
|
|
|
call "%VS90COMNTOOLS%vsvars32.bat"
|
|
|
|
)
|
|
|
|
) else (
|
|
|
|
if %VS_VERSION%==vs100 (
|
2014-06-25 07:13:28 +04:00
|
|
|
if %PLATFORM%==x64 (
|
2014-01-31 20:15:54 +04:00
|
|
|
call "%VS100COMNTOOLS%..\..\%VS_64_BIT_ENV%"
|
|
|
|
) else (
|
|
|
|
call "%VS100COMNTOOLS%vsvars32.bat"
|
|
|
|
)
|
|
|
|
) else (
|
|
|
|
if %VS_VERSION%==vs110 (
|
2014-06-25 07:13:28 +04:00
|
|
|
if %PLATFORM%==x64 (
|
2014-01-31 20:15:54 +04:00
|
|
|
call "%VS110COMNTOOLS%..\..\%VS_64_BIT_ENV%"
|
|
|
|
) else (
|
|
|
|
call "%VS110COMNTOOLS%vsvars32.bat"
|
|
|
|
)
|
|
|
|
) else (
|
|
|
|
if %VS_VERSION%==vs120 (
|
2014-06-25 07:13:28 +04:00
|
|
|
if %PLATFORM%==x64 (
|
2014-01-31 20:15:54 +04:00
|
|
|
call "%VS120COMNTOOLS%..\..\%VS_64_BIT_ENV%"
|
|
|
|
) else (
|
|
|
|
call "%VS120COMNTOOLS%vsvars32.bat
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
2012-09-24 07:51:40 +04:00
|
|
|
|
2014-01-31 20:15:54 +04:00
|
|
|
if not defined VSINSTALLDIR (
|
|
|
|
echo Error: No Visual C++ environment found.
|
|
|
|
echo Please run this script from a Visual Studio Command Prompt
|
|
|
|
echo or run "%%VSnnCOMNTOOLS%%\vsvars32.bat" first.
|
|
|
|
goto :EOF
|
2012-07-13 08:43:16 +04:00
|
|
|
)
|
2012-04-29 22:52:25 +04:00
|
|
|
|
2012-08-24 07:35:23 +04:00
|
|
|
set VCPROJ_EXT=vcproj
|
|
|
|
if %VS_VERSION%==vs100 (set VCPROJ_EXT=vcxproj)
|
2012-09-25 09:35:44 +04:00
|
|
|
if %VS_VERSION%==vs110 (set VCPROJ_EXT=vcxproj)
|
2014-01-31 19:50:33 +04:00
|
|
|
if %VS_VERSION%==vs120 (set VCPROJ_EXT=vcxproj)
|
2012-04-29 22:52:25 +04:00
|
|
|
|
2012-11-10 15:46:34 +04:00
|
|
|
if "%8"=="" goto use_devenv
|
2013-01-13 20:41:50 +04:00
|
|
|
set BUILD_TOOL=%8
|
2012-11-10 15:46:34 +04:00
|
|
|
goto use_custom
|
|
|
|
:use_devenv
|
|
|
|
set BUILD_TOOL=devenv
|
|
|
|
if "%VS_VERSION%"=="vs100" (set BUILD_TOOL=msbuild)
|
|
|
|
if "%VS_VERSION%"=="vs110" (set BUILD_TOOL=msbuild)
|
2014-01-31 19:50:33 +04:00
|
|
|
if "%VS_VERSION%"=="vs120" (set BUILD_TOOL=msbuild)
|
2012-11-10 15:46:34 +04:00
|
|
|
:use_custom
|
|
|
|
if not "%BUILD_TOOL%"=="msbuild" (set USEENV=/useenv)
|
|
|
|
if "%BUILD_TOOL%"=="msbuild" (
|
2013-07-23 17:04:48 +04:00
|
|
|
set ACTIONSW=/t:
|
|
|
|
set CONFIGSW=/p:Configuration=
|
|
|
|
set EXTRASW=/m
|
|
|
|
set USEENV=/p:UseEnv=true
|
|
|
|
)
|
|
|
|
if not "%BUILD_TOOL%"=="msbuild" (
|
|
|
|
set ACTIONSW=/
|
2012-11-10 15:46:34 +04:00
|
|
|
)
|
|
|
|
if "%VS_VERSION%"=="vs100" (goto msbuildok)
|
|
|
|
if "%VS_VERSION%"=="vs110" (goto msbuildok)
|
2014-01-31 19:50:33 +04:00
|
|
|
if "%VS_VERSION%"=="vs120" (goto msbuildok)
|
2012-11-10 15:46:34 +04:00
|
|
|
if "%BUILD_TOOL%"=="msbuild" (
|
2013-07-23 17:04:48 +04:00
|
|
|
echo "Cannot use msbuild with Visual Studio 2008 or earlier."
|
|
|
|
exit /b 2
|
2012-11-10 15:46:34 +04:00
|
|
|
)
|
|
|
|
:msbuildok
|
|
|
|
|
|
|
|
rem ACTION [build|rebuild|clean]
|
2012-09-23 10:28:42 +04:00
|
|
|
set ACTION=%2
|
2014-06-25 07:13:28 +04:00
|
|
|
if "%ACTION%"=="" (set ACTION=build)
|
2012-04-29 22:52:25 +04:00
|
|
|
if not "%ACTION%"=="build" (
|
|
|
|
if not "%ACTION%"=="rebuild" (
|
2014-06-25 07:13:28 +04:00
|
|
|
if not "%ACTION%"=="clean" goto usage))
|
2012-04-29 22:52:25 +04:00
|
|
|
|
2014-06-25 07:20:51 +04:00
|
|
|
rem LINKMODE [static_mt|static_md|shared|all]
|
2012-09-23 10:28:42 +04:00
|
|
|
set LINK_MODE=%3
|
2014-06-25 07:20:51 +04:00
|
|
|
if "%LINK_MODE%"=="" (set LINK_MODE=all)
|
2012-04-29 22:52:25 +04:00
|
|
|
if not "%LINK_MODE%"=="static_mt" (
|
|
|
|
if not "%LINK_MODE%"=="static_md" (
|
|
|
|
if not "%LINK_MODE%"=="shared" (
|
2014-06-25 07:13:28 +04:00
|
|
|
if not "%LINK_MODE%"=="all" goto usage)))
|
2012-04-29 22:52:25 +04:00
|
|
|
|
2012-11-10 15:46:34 +04:00
|
|
|
rem CONFIGURATION [release|debug|both]
|
2012-09-23 10:28:42 +04:00
|
|
|
set CONFIGURATION=%4
|
2014-06-25 07:20:51 +04:00
|
|
|
if "%CONFIGURATION%"=="" (set CONFIGURATION=both)
|
2012-04-29 22:52:25 +04:00
|
|
|
if not "%CONFIGURATION%"=="release" (
|
|
|
|
if not "%CONFIGURATION%"=="debug" (
|
2014-06-25 07:13:28 +04:00
|
|
|
if not "%CONFIGURATION%"=="both" goto usage))
|
2012-04-29 22:52:25 +04:00
|
|
|
|
|
|
|
if "%PLATFORM%"=="Win32" (set PLATFORM_SUFFIX=) else (
|
|
|
|
if "%PLATFORM%"=="x64" (set PLATFORM_SUFFIX=_x64) else (
|
2014-03-27 18:48:25 +04:00
|
|
|
if "%PLATFORM%"=="WinCE" (set PLATFORM_SUFFIX=_CE) else (
|
2014-06-25 07:13:28 +04:00
|
|
|
if "%PLATFORM%"=="WEC2013" (set PLATFORM_SUFFIX=_WEC2013))))
|
2014-03-27 18:48:25 +04:00
|
|
|
|
|
|
|
if "%PLATFORM%"=="WEC2013" (
|
|
|
|
if "%WEC2013_PLATFORM%"=="" (
|
|
|
|
echo WEC2013_PLATFORM not set. Exiting.
|
|
|
|
exit /b 1
|
|
|
|
)
|
2014-04-19 21:10:00 +04:00
|
|
|
set PLATFORMSW=/p:Platform=%WEC2013_PLATFORM%
|
2014-03-27 18:48:25 +04:00
|
|
|
set USEENV=
|
2014-04-05 21:26:31 +04:00
|
|
|
if %VS_VERSION%==vs110 (set EXTRASW=/m /p:VisualStudioVersion=11.0)
|
|
|
|
if %VS_VERSION%==vs120 (set EXTRASW=/m /p:VisualStudioVersion=12.0)
|
2014-03-27 18:48:25 +04:00
|
|
|
)
|
2012-04-29 22:52:25 +04:00
|
|
|
|
2012-11-10 15:46:34 +04:00
|
|
|
rem SAMPLES [samples|nosamples]
|
2012-09-23 10:28:42 +04:00
|
|
|
set SAMPLES=%6
|
2012-04-29 22:52:25 +04:00
|
|
|
if "%SAMPLES%"=="" (set SAMPLES=samples)
|
|
|
|
|
2012-11-10 15:46:34 +04:00
|
|
|
rem TESTS [tests|notests]
|
2012-09-23 10:28:42 +04:00
|
|
|
set TESTS=%7
|
2012-07-13 08:43:16 +04:00
|
|
|
if "%TESTS%"=="" (set TESTS=notests)
|
|
|
|
|
2012-11-10 15:46:34 +04:00
|
|
|
|
2012-04-29 22:52:25 +04:00
|
|
|
set DEBUG_SHARED=0
|
|
|
|
set RELEASE_SHARED=0
|
|
|
|
set DEBUG_STATIC_MT=0
|
|
|
|
set RELEASE_STATIC_MT=0
|
|
|
|
set DEBUG_STATIC_MD=0
|
|
|
|
set RELEASE_STATIC_MD=0
|
|
|
|
|
2012-08-24 07:35:23 +04:00
|
|
|
if %LINK_MODE%==shared (
|
|
|
|
if %CONFIGURATION%==release (set RELEASE_SHARED=1) else (
|
|
|
|
if %CONFIGURATION%==both (set RELEASE_SHARED=1) else (
|
2012-04-29 22:52:25 +04:00
|
|
|
if "%CONFIGURATION%"=="" (set RELEASE_SHARED=1))))
|
|
|
|
|
2012-08-24 07:35:23 +04:00
|
|
|
if %LINK_MODE%==shared (
|
|
|
|
if %CONFIGURATION%==debug (set DEBUG_SHARED=1) else (
|
|
|
|
if %CONFIGURATION%==both (set DEBUG_SHARED=1) else (
|
2012-04-29 22:52:25 +04:00
|
|
|
if "%CONFIGURATION%"=="" (set DEBUG_SHARED=1))))
|
|
|
|
|
2012-08-24 07:35:23 +04:00
|
|
|
if %LINK_MODE%==static_mt (
|
|
|
|
if %CONFIGURATION%==release (set RELEASE_STATIC_MT=1) else (
|
|
|
|
if %CONFIGURATION%==both (set RELEASE_STATIC_MT=1) else (
|
2012-04-29 22:52:25 +04:00
|
|
|
if "%CONFIGURATION%"=="" (set RELEASE_STATIC_MT=1))))
|
|
|
|
|
2012-08-24 07:35:23 +04:00
|
|
|
if %LINK_MODE%==static_md (
|
|
|
|
if %CONFIGURATION%==release (set RELEASE_STATIC_MD=1) else (
|
|
|
|
if %CONFIGURATION%==both (set RELEASE_STATIC_MD=1) else (
|
2012-04-29 22:52:25 +04:00
|
|
|
if "%CONFIGURATION%"=="" (set RELEASE_STATIC_MD=1))))
|
|
|
|
|
2012-08-24 07:35:23 +04:00
|
|
|
if %LINK_MODE%==static_mt (
|
|
|
|
if %CONFIGURATION%==debug (set DEBUG_STATIC_MT=1) else (
|
|
|
|
if %CONFIGURATION%==both (set DEBUG_STATIC_MT=1) else (
|
2012-04-29 22:52:25 +04:00
|
|
|
if "%CONFIGURATION%"=="" (set DEBUG_STATIC_MT=1))))
|
|
|
|
|
2012-08-24 07:35:23 +04:00
|
|
|
if %LINK_MODE%==static_md (
|
|
|
|
if %CONFIGURATION%==debug (set DEBUG_STATIC_MD=1) else (
|
|
|
|
if %CONFIGURATION%==both (set DEBUG_STATIC_MD=1) else (
|
2012-04-29 22:52:25 +04:00
|
|
|
if "%CONFIGURATION%"=="" (set DEBUG_STATIC_MD=1))))
|
|
|
|
|
2012-08-24 07:35:23 +04:00
|
|
|
if %LINK_MODE%==all (
|
|
|
|
if %CONFIGURATION%==debug (
|
2012-04-29 22:52:25 +04:00
|
|
|
set DEBUG_STATIC_MT=1
|
|
|
|
set DEBUG_STATIC_MD=1
|
|
|
|
set DEBUG_SHARED=1) else (
|
2012-08-24 07:35:23 +04:00
|
|
|
if %CONFIGURATION%==release (
|
2012-04-29 22:52:25 +04:00
|
|
|
set RELEASE_STATIC_MT=1
|
|
|
|
set RELEASE_STATIC_MD=1
|
|
|
|
set RELEASE_SHARED=1) else (
|
2012-08-24 07:35:23 +04:00
|
|
|
if %CONFIGURATION%==both (
|
2012-04-29 22:52:25 +04:00
|
|
|
set DEBUG_STATIC_MT=1
|
|
|
|
set DEBUG_STATIC_MD=1
|
|
|
|
set DEBUG_SHARED=1
|
|
|
|
set RELEASE_STATIC_MT=1
|
|
|
|
set RELEASE_STATIC_MD=1
|
|
|
|
set RELEASE_SHARED=1) else (
|
|
|
|
if "%CONFIGURATION%"=="" (
|
|
|
|
set DEBUG_STATIC_MT=1
|
|
|
|
set DEBUG_STATIC_MD=1
|
|
|
|
set DEBUG_SHARED=1
|
|
|
|
set RELEASE_STATIC_MT=1
|
|
|
|
set RELEASE_STATIC_MD=1
|
|
|
|
set RELEASE_SHARED=1)))))
|
|
|
|
|
|
|
|
if "%LINK_MODE%"=="" (
|
2012-08-24 07:35:23 +04:00
|
|
|
if %CONFIGURATION%==debug (
|
2012-04-29 22:52:25 +04:00
|
|
|
set DEBUG_STATIC_MT=1
|
|
|
|
set DEBUG_STATIC_MD=1
|
|
|
|
set DEBUG_SHARED=1) else (
|
2012-08-24 07:35:23 +04:00
|
|
|
if %CONFIGURATION%==release (
|
2012-04-29 22:52:25 +04:00
|
|
|
set RELEASE_STATIC_MT=1
|
|
|
|
set RELEASE_STATIC_MD=1
|
|
|
|
set RELEASE_SHARED=1) else (
|
2012-08-24 07:35:23 +04:00
|
|
|
if %CONFIGURATION%==both (
|
2012-04-29 22:52:25 +04:00
|
|
|
set DEBUG_STATIC_MT=1
|
|
|
|
set DEBUG_STATIC_MD=1
|
|
|
|
set DEBUG_SHARED=1
|
|
|
|
set RELEASE_STATIC_MT=1
|
|
|
|
set RELEASE_STATIC_MD=1
|
|
|
|
set RELEASE_SHARED=1) else (
|
|
|
|
if "%CONFIGURATION%"=="" (
|
|
|
|
set DEBUG_STATIC_MT=1
|
|
|
|
set DEBUG_STATIC_MD=1
|
|
|
|
set DEBUG_SHARED=1
|
|
|
|
set RELEASE_STATIC_MT=1
|
|
|
|
set RELEASE_STATIC_MD=1
|
|
|
|
set RELEASE_SHARED=1)))))
|
|
|
|
|
|
|
|
echo.
|
|
|
|
echo.
|
|
|
|
echo ########################################################################
|
|
|
|
echo ####
|
|
|
|
echo #### STARTING VISUAL STUDIO BUILD (%VS_VERSION%, %PLATFORM%)
|
|
|
|
echo ####
|
|
|
|
echo ########################################################################
|
|
|
|
echo.
|
|
|
|
echo.
|
2012-07-13 08:43:16 +04:00
|
|
|
echo The following configurations will be built:
|
2012-04-29 22:52:25 +04:00
|
|
|
|
|
|
|
if %DEBUG_SHARED%==1 (echo debug_shared)
|
|
|
|
if %RELEASE_SHARED%==1 (echo release_shared)
|
|
|
|
if %DEBUG_STATIC_MT%==1 (echo debug_static_mt)
|
|
|
|
if %DEBUG_STATIC_MD%==1 (echo debug_static_md)
|
|
|
|
if %RELEASE_STATIC_MT%==1 (echo release_static_mt)
|
|
|
|
if %RELEASE_STATIC_MD%==1 (echo release_static_md)
|
|
|
|
|
|
|
|
rem build for up to 4 levels deep
|
|
|
|
for /f %%G in ('findstr /R "." components') do (
|
2013-07-23 17:04:48 +04:00
|
|
|
if exist %%G (
|
|
|
|
cd %%G
|
|
|
|
for /f "tokens=1,2,3,4 delims=/" %%Q in ("%%G") do (
|
|
|
|
set PROJECT_FILE=%%Q%PLATFORM_SUFFIX%_%VS_VERSION%.%VCPROJ_EXT%
|
|
|
|
set TEST_PROJECT_FILE=testsuite/TestSuite%PLATFORM_SUFFIX%_%VS_VERSION%.%VCPROJ_EXT%
|
|
|
|
if exist !PROJECT_FILE! (
|
|
|
|
call :build %%G
|
|
|
|
if ERRORLEVEL 1 goto buildfailed
|
|
|
|
)
|
|
|
|
set PROJECT_FILE=%%R%PLATFORM_SUFFIX%_%VS_VERSION%.%VCPROJ_EXT%
|
|
|
|
if exist !PROJECT_FILE! (
|
|
|
|
call :build %%G
|
|
|
|
if ERRORLEVEL 1 goto buildfailed
|
|
|
|
)
|
|
|
|
set PROJECT_FILE=%%S%PLATFORM_SUFFIX%_%VS_VERSION%.%VCPROJ_EXT%
|
|
|
|
if exist !PROJECT_FILE! (
|
|
|
|
call :build %%G
|
|
|
|
if ERRORLEVEL 1 goto buildfailed
|
|
|
|
)
|
|
|
|
set PROJECT_FILE=%%T%PLATFORM_SUFFIX%_%VS_VERSION%.%VCPROJ_EXT%
|
|
|
|
if exist !PROJECT_FILE! (
|
|
|
|
call :build %%G
|
|
|
|
if ERRORLEVEL 1 goto buildfailed
|
|
|
|
)
|
|
|
|
)
|
2012-07-13 08:43:16 +04:00
|
|
|
)
|
2013-10-14 21:27:17 +04:00
|
|
|
cd "%POCO_BASE%"
|
2012-07-13 08:43:16 +04:00
|
|
|
)
|
2012-04-29 22:52:25 +04:00
|
|
|
|
2012-08-24 07:35:23 +04:00
|
|
|
goto samples
|
|
|
|
|
2012-07-13 08:43:16 +04:00
|
|
|
rem ////////////////////
|
|
|
|
rem / build subroutine /
|
|
|
|
rem ////////////////////
|
|
|
|
:build
|
|
|
|
|
2014-04-20 01:42:44 +04:00
|
|
|
echo.
|
|
|
|
echo ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
|
|
|
echo ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
|
|
|
echo ++++ Building [!PROJECT_FILE!]
|
|
|
|
echo ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
|
|
|
echo ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
|
|
|
echo.
|
|
|
|
|
|
|
|
if %DEBUG_SHARED%==1 (
|
|
|
|
!BUILD_TOOL! %USEENV% %EXTRASW% %ACTIONSW%%ACTION% %CONFIGSW%debug_shared %PLATFORMSW% !PROJECT_FILE!
|
|
|
|
if ERRORLEVEL 1 exit /b 1
|
|
|
|
echo. && echo. && echo.
|
|
|
|
if %TESTS%==tests (
|
|
|
|
if exist !TEST_PROJECT_FILE! (
|
|
|
|
!BUILD_TOOL! %USEENV% %EXTRASW% %ACTIONSW%%ACTION% %CONFIGSW%debug_shared %PLATFORMSW% !TEST_PROJECT_FILE!
|
|
|
|
if ERRORLEVEL 1 exit /b 1
|
|
|
|
echo. && echo. && echo.
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
if %RELEASE_SHARED%==1 (
|
|
|
|
!BUILD_TOOL! %USEENV% %EXTRASW% %ACTIONSW%%ACTION% %CONFIGSW%release_shared %PLATFORMSW% !PROJECT_FILE!
|
|
|
|
if ERRORLEVEL 1 exit /b 1
|
|
|
|
echo. && echo. && echo.
|
|
|
|
if %TESTS%==tests (
|
|
|
|
if exist !TEST_PROJECT_FILE! (
|
|
|
|
!BUILD_TOOL! %USEENV% %EXTRASW% %ACTIONSW%%ACTION% %CONFIGSW%release_shared %PLATFORMSW% !TEST_PROJECT_FILE!
|
|
|
|
if ERRORLEVEL 1 exit /b 1
|
|
|
|
echo. && echo. && echo.
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
if %DEBUG_STATIC_MT%==1 (
|
|
|
|
!BUILD_TOOL! %USEENV% %EXTRASW% %ACTIONSW%%ACTION% %CONFIGSW%debug_static_mt %PLATFORMSW% !PROJECT_FILE!
|
|
|
|
if ERRORLEVEL 1 exit /b 1
|
|
|
|
echo. && echo. && echo.
|
|
|
|
if %TESTS%==tests (
|
|
|
|
if exist !TEST_PROJECT_FILE! (
|
|
|
|
!BUILD_TOOL! %USEENV% %EXTRASW% %ACTIONSW%%ACTION% %CONFIGSW%debug_static_mt %PLATFORMSW% !TEST_PROJECT_FILE!
|
|
|
|
if ERRORLEVEL 1 exit /b 1
|
|
|
|
echo. && echo. && echo.
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
if %RELEASE_STATIC_MT%==1 (
|
|
|
|
!BUILD_TOOL! %USEENV% %EXTRASW% %ACTIONSW%%ACTION% %CONFIGSW%release_static_mt %PLATFORMSW% !PROJECT_FILE!
|
|
|
|
if ERRORLEVEL 1 exit /b 1
|
|
|
|
echo. && echo. && echo.
|
|
|
|
if %TESTS%==tests (
|
|
|
|
if exist !TEST_PROJECT_FILE! (
|
|
|
|
!BUILD_TOOL! %USEENV% %EXTRASW% %ACTIONSW%%ACTION% %CONFIGSW%release_static_mt %PLATFORMSW% !TEST_PROJECT_FILE!
|
|
|
|
if ERRORLEVEL 1 exit /b 1
|
|
|
|
echo. && echo. && echo.
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
if %DEBUG_STATIC_MD%==1 (
|
|
|
|
!BUILD_TOOL! %USEENV% %EXTRASW% %ACTIONSW%%ACTION% %CONFIGSW%debug_static_md %PLATFORMSW% !PROJECT_FILE!
|
|
|
|
if ERRORLEVEL 1 exit /b 1
|
|
|
|
echo. && echo. && echo.
|
|
|
|
if %TESTS%==tests (
|
|
|
|
if exist !TEST_PROJECT_FILE! (
|
|
|
|
!BUILD_TOOL! %USEENV% %EXTRASW% %ACTIONSW%%ACTION% %CONFIGSW%debug_static_md %PLATFORMSW% !TEST_PROJECT_FILE!
|
|
|
|
if ERRORLEVEL 1 exit /b 1
|
|
|
|
echo. && echo. && echo.
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
if %RELEASE_STATIC_MD%==1 (
|
|
|
|
!BUILD_TOOL! %USEENV% %EXTRASW% %ACTIONSW%%ACTION% %CONFIGSW%release_static_md %PLATFORMSW% !PROJECT_FILE!
|
|
|
|
if ERRORLEVEL 1 exit /b 1
|
|
|
|
echo. && echo. && echo.
|
|
|
|
if %TESTS%==tests (
|
|
|
|
if exist !TEST_PROJECT_FILE! (
|
|
|
|
!BUILD_TOOL! %USEENV% %EXTRASW% %ACTIONSW%%ACTION% %CONFIGSW%release_static_md %PLATFORMSW% !TEST_PROJECT_FILE!
|
|
|
|
if ERRORLEVEL 1 exit /b 1
|
|
|
|
echo. && echo. && echo.
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
2012-04-29 22:52:25 +04:00
|
|
|
|
2012-09-23 10:28:42 +04:00
|
|
|
echo.
|
|
|
|
echo ------------------------------------------------------------------------
|
|
|
|
echo ------------------------------------------------------------------------
|
2013-07-23 17:04:48 +04:00
|
|
|
echo ---- Done building [!PROJECT_FILE!]
|
2012-09-23 10:28:42 +04:00
|
|
|
echo ------------------------------------------------------------------------
|
|
|
|
echo ------------------------------------------------------------------------
|
|
|
|
echo.
|
2012-07-13 08:43:16 +04:00
|
|
|
|
|
|
|
exit /b
|
|
|
|
|
2012-08-24 07:35:23 +04:00
|
|
|
rem ////////////////////
|
|
|
|
rem / build samples /
|
|
|
|
rem ////////////////////
|
|
|
|
|
|
|
|
:samples
|
|
|
|
|
|
|
|
if %SAMPLES%==nosamples goto :EOF
|
2012-04-29 22:52:25 +04:00
|
|
|
|
|
|
|
rem root level component samples
|
|
|
|
for /f %%G in ('findstr /R "." components') do (
|
2013-07-23 17:04:48 +04:00
|
|
|
if exist %%G\samples\samples%PLATFORM_SUFFIX%_%VS_VERSION%.sln (
|
|
|
|
cd %%G\samples
|
|
|
|
echo.
|
|
|
|
echo.
|
|
|
|
echo ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
|
|
|
echo ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
|
|
|
echo ++++ Building [%%G/samples]
|
|
|
|
echo ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
|
|
|
echo ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
|
|
|
echo.
|
|
|
|
set SOLUTION_FILE=samples%PLATFORM_SUFFIX%_%VS_VERSION%.sln
|
|
|
|
|
|
|
|
if %DEBUG_SHARED%==1 (
|
2014-03-27 18:48:25 +04:00
|
|
|
!BUILD_TOOL! %USEENV% %EXTRASW% %ACTIONSW%%ACTION% %CONFIGSW%debug_shared %PLATFORMSW% !SOLUTION_FILE!
|
2013-07-23 17:04:48 +04:00
|
|
|
if ERRORLEVEL 1 goto buildfailed
|
|
|
|
echo. && echo. && echo.
|
|
|
|
)
|
|
|
|
if %RELEASE_SHARED%==1 (
|
2014-03-27 18:48:25 +04:00
|
|
|
!BUILD_TOOL! %USEENV% %EXTRASW% %ACTIONSW%%ACTION% %CONFIGSW%release_shared %PLATFORMSW% !SOLUTION_FILE!
|
2013-07-23 17:04:48 +04:00
|
|
|
if ERRORLEVEL 1 goto buildfailed
|
|
|
|
echo. && echo. && echo.
|
|
|
|
)
|
|
|
|
if %DEBUG_STATIC_MT%==1 (
|
2014-03-27 18:48:25 +04:00
|
|
|
!BUILD_TOOL! %USEENV% %EXTRASW% %ACTIONSW%%ACTION% %CONFIGSW%debug_static_mt %PLATFORMSW% !SOLUTION_FILE!
|
2013-07-23 17:04:48 +04:00
|
|
|
if ERRORLEVEL 1 goto buildfailed
|
|
|
|
echo. && echo. && echo.
|
|
|
|
)
|
|
|
|
if %RELEASE_STATIC_MT%==1 (
|
2014-03-27 18:48:25 +04:00
|
|
|
!BUILD_TOOL! %USEENV% %EXTRASW% %ACTIONSW%%ACTION% %CONFIGSW%release_static_mt %PLATFORMSW% !SOLUTION_FILE!
|
2013-07-23 17:04:48 +04:00
|
|
|
if ERRORLEVEL 1 goto buildfailed
|
|
|
|
echo. && echo. && echo.
|
|
|
|
)
|
|
|
|
if %DEBUG_STATIC_MD%==1 (
|
2014-03-27 18:48:25 +04:00
|
|
|
!BUILD_TOOL! %USEENV% %EXTRASW% %ACTIONSW%%ACTION% %CONFIGSW%debug_static_md %PLATFORMSW% !SOLUTION_FILE!
|
2013-07-23 17:04:48 +04:00
|
|
|
if ERRORLEVEL 1 goto buildfailed
|
|
|
|
echo. && echo. && echo.
|
|
|
|
)
|
|
|
|
if %RELEASE_STATIC_MD%==1 (
|
2014-03-27 18:48:25 +04:00
|
|
|
!BUILD_TOOL! %USEENV% %EXTRASW% %ACTIONSW%%ACTION% %CONFIGSW%release_static_md %PLATFORMSW% !SOLUTION_FILE!
|
2013-07-23 17:04:48 +04:00
|
|
|
if ERRORLEVEL 1 goto buildfailed
|
|
|
|
echo. && echo. && echo.
|
|
|
|
)
|
|
|
|
|
2013-10-14 21:27:17 +04:00
|
|
|
cd "%POCO_BASE%"
|
2012-09-23 10:28:42 +04:00
|
|
|
|
2013-07-23 17:04:48 +04:00
|
|
|
echo.
|
|
|
|
echo ------------------------------------------------------------------------
|
|
|
|
echo ------------------------------------------------------------------------
|
|
|
|
echo ---- Done building [%%G/samples]
|
|
|
|
echo ------------------------------------------------------------------------
|
|
|
|
echo ------------------------------------------------------------------------
|
|
|
|
echo.
|
|
|
|
)
|
2012-04-29 22:52:25 +04:00
|
|
|
)
|
|
|
|
|
2012-09-23 10:28:42 +04:00
|
|
|
echo.
|
|
|
|
echo ------------------------------------------------------------------------
|
|
|
|
echo ------------------------------------------------------------------------
|
|
|
|
echo ---- Build completed.
|
|
|
|
echo ------------------------------------------------------------------------
|
|
|
|
echo ------------------------------------------------------------------------
|
|
|
|
echo.
|
2012-08-24 07:35:23 +04:00
|
|
|
|
2012-04-29 22:52:25 +04:00
|
|
|
goto :EOF
|
|
|
|
|
2013-07-23 17:04:48 +04:00
|
|
|
rem ////////////////
|
|
|
|
rem / build failed /
|
|
|
|
rem ////////////////
|
|
|
|
|
|
|
|
:buildfailed
|
|
|
|
|
|
|
|
echo.
|
|
|
|
echo.
|
|
|
|
echo XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
|
|
|
|
echo XXX BUILD FAILED. EXITING. XXX
|
|
|
|
echo XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
|
|
|
|
echo.
|
|
|
|
echo.
|
|
|
|
exit /b 1
|
|
|
|
|
2012-04-29 22:52:25 +04:00
|
|
|
:usage
|
|
|
|
echo Usage:
|
|
|
|
echo ------
|
2012-11-10 15:46:34 +04:00
|
|
|
echo buildwin VS_VERSION [ACTION] [LINKMODE] [CONFIGURATION] [PLATFORM] [SAMPLES] [TESTS] [TOOL]
|
2014-01-31 19:50:33 +04:00
|
|
|
echo VS_VERSION: "71|80|90|100|110|120"
|
2012-11-10 15:46:34 +04:00
|
|
|
echo ACTION: "build|rebuild|clean"
|
|
|
|
echo LINKMODE: "static_mt|static_md|shared|all"
|
|
|
|
echo CONFIGURATION: "release|debug|both"
|
2014-03-27 18:48:25 +04:00
|
|
|
echo PLATFORM: "Win32|x64|WinCE|WEC2013"
|
2012-11-10 15:46:34 +04:00
|
|
|
echo SAMPLES: "samples|nosamples"
|
|
|
|
echo TESTS: "tests|notests"
|
2013-02-25 15:04:32 +04:00
|
|
|
echo TOOL: "devenv|vcexpress|wdexpress|msbuild"
|
2012-04-29 22:52:25 +04:00
|
|
|
echo.
|
|
|
|
echo Default is build all.
|
2012-11-10 15:46:34 +04:00
|
|
|
endlocal
|