poco/buildwin.cmd

226 lines
8.9 KiB
Batchfile
Raw Normal View History

2008-02-17 18:29:06 +01:00
@echo off
rem
rem buildwin.cmd
rem
rem command-line build script for MS Visual Studio
rem
rem Usage:
rem ------
rem buildwin VS_VERSION LINKMODE CONFIGURATION SAMPLES
rem buildwin {71|80|90} [static|shared|both] [release|debug|both] [yes|no]
rem
rem VS_VERSION is required argument. Default is build all.
rem Change OPENSSL_DIR to match your setup
set OPENSSL_DIR=c:\OpenSSL
set OPENSSL_INCLUDE=%OPENSSL_DIR%\include
set OPENSSL_LIB=%OPENSSL_DIR%\lib\VC
set INCLUDE=%INCLUDE%;%OPENSSL_INCLUDE%
set LIB=%LIB%;%OPENSSL_LIB%
set POCOBASE=%CD%
rem VS version {71|80|90}
if "%1"=="" goto usage
set VS_VERSION=vs%1
2008-02-25 22:50:48 +01:00
rem Action [build|rebuild|clean]
set ACTION=%2
if not "%ACTION%"=="build" (
if not "%ACTION%"=="rebuild" (
if not "%ACTION%"=="clean" goto usage))
2008-02-17 18:29:06 +01:00
rem Link mode [static|shared|both]
2008-02-25 22:50:48 +01:00
set LINK_MODE=%3
2008-02-17 18:29:06 +01:00
if not "%LINK_MODE%"=="static" (
if not "%LINK_MODE%"=="shared" (
if not "%LINK_MODE%"=="" (
if not "%LINK_MODE%"=="both" goto usage)))
rem Configuration [release|debug|both]
2008-02-25 22:50:48 +01:00
set CONFIGURATION=%4
2008-02-17 18:29:06 +01:00
if not "%CONFIGURATION%"=="release" (
if not "%CONFIGURATION%"=="debug" (
if not "%CONFIGURATION%"=="" (
if not "%CONFIGURATION%"=="both" goto usage)))
rem Samples [yes|no]
2008-02-25 22:50:48 +01:00
set SAMPLES=%5
2008-02-17 18:29:06 +01:00
if "%SAMPLES%"=="" (set SAMPLES=yes)
set RELEASE_SHARED=0
set DEBUG_SHARED=0
set DEBUG_STATIC=0
set RELEASE_STATIC=0
if "%LINK_MODE%"=="shared" (
if "%CONFIGURATION%"=="release" (set RELEASE_SHARED=1) else (
if "%CONFIGURATION%"=="both" (set RELEASE_SHARED=1) else (
if "%CONFIGURATION%"=="" (set RELEASE_SHARED=1))))
if "%LINK_MODE%"=="shared" (
if "%CONFIGURATION%"=="debug" (set DEBUG_SHARED=1) else (
if "%CONFIGURATION%"=="both" (set DEBUG_SHARED=1) else (
if "%CONFIGURATION%"=="" (set DEBUG_SHARED=1))))
if "%LINK_MODE%"=="static" (
if "%CONFIGURATION%"=="release" (set RELEASE_STATIC=1) else (
if "%CONFIGURATION%"=="both" (set RELEASE_STATIC=1) else (
if "%CONFIGURATION%"=="" (set RELEASE_STATIC=1))))
if "%LINK_MODE%"=="static" (
if "%CONFIGURATION%"=="debug" (set DEBUG_STATIC=1) else (
if "%CONFIGURATION%"=="both" (set DEBUG_STATIC=1) else (
if "%CONFIGURATION%"=="" (set DEBUG_STATIC=1))))
if "%LINK_MODE%"=="both" (
if "%CONFIGURATION%"=="debug" (
set DEBUG_STATIC=1
set DEBUG_SHARED=1) else (
if "%CONFIGURATION%"=="release" (
set RELEASE_STATIC=1
set RELEASE_SHARED=1) else (
if "%CONFIGURATION%"=="both" (
set DEBUG_STATIC=1
set DEBUG_SHARED=1
set RELEASE_STATIC=1
set RELEASE_SHARED=1) else (
if "%CONFIGURATION%"=="" (
set DEBUG_STATIC=1
set DEBUG_SHARED=1
set RELEASE_STATIC=1
set RELEASE_SHARED=1)))))
if "%LINK_MODE%"=="" (
if "%CONFIGURATION%"=="debug" (
set DEBUG_STATIC=1
set DEBUG_SHARED=1) else (
if "%CONFIGURATION%"=="release" (
set RELEASE_STATIC=1
set RELEASE_SHARED=1) else (
if "%CONFIGURATION%"=="both" (
set DEBUG_STATIC=1
set DEBUG_SHARED=1
set RELEASE_STATIC=1
set RELEASE_SHARED=1) else (
if "%CONFIGURATION%"=="" (
set DEBUG_STATIC=1
set DEBUG_SHARED=1
set RELEASE_STATIC=1
set RELEASE_SHARED=1)))))
cd CppUnit
2008-02-25 22:50:48 +01:00
if %DEBUG_SHARED%==1 (devenv /useenv /%ACTION% debug_shared CppUnit_%VS_VERSION%.sln)
if %RELEASE_SHARED%==1 (devenv /useenv /%ACTION% release_shared CppUnit_%VS_VERSION%.sln)
if %DEBUG_STATIC%==1 (devenv /useenv /%ACTION% debug_static CppUnit_%VS_VERSION%.sln)
if %RELEASE_STATIC%==1 (devenv /useenv /%ACTION% release_static CppUnit_%VS_VERSION%.sln)
2008-02-17 18:29:06 +01:00
cd %POCOBASE%
cd Foundation
2008-02-25 22:50:48 +01:00
if %DEBUG_SHARED%==1 devenv /useenv /%ACTION% debug_shared Foundation_%VS_VERSION%.sln
if %RELEASE_SHARED%==1 devenv /useenv /%ACTION% release_shared Foundation_%VS_VERSION%.sln
if %DEBUG_STATIC%==1 devenv /useenv /%ACTION% debug_static Foundation_%VS_VERSION%.sln
if %RELEASE_STATIC%==1 devenv /useenv /%ACTION% release_static Foundation_%VS_VERSION%.sln
2008-02-17 18:29:06 +01:00
cd %POCOBASE%
cd XML
2008-02-25 22:50:48 +01:00
if %DEBUG_SHARED%==1 devenv /useenv /%ACTION% debug_shared XML_%VS_VERSION%.sln
if %RELEASE_SHARED%==1 devenv /useenv /%ACTION% release_shared XML_%VS_VERSION%.sln
if %DEBUG_STATIC%==1 devenv /useenv /%ACTION% debug_static XML_%VS_VERSION%.sln
if %RELEASE_STATIC%==1 devenv /useenv /%ACTION% release_static XML_%VS_VERSION%.sln
2008-02-17 18:29:06 +01:00
cd %POCOBASE%
cd Util
2008-02-25 22:50:48 +01:00
if %DEBUG_SHARED%==1 devenv /useenv /%ACTION% debug_shared Util_%VS_VERSION%.sln
if %RELEASE_SHARED%==1 devenv /useenv /%ACTION% release_shared Util_%VS_VERSION%.sln
if %DEBUG_STATIC%==1 devenv /useenv /%ACTION% debug_static Util_%VS_VERSION%.sln
if %RELEASE_STATIC%==1 devenv /useenv /%ACTION% release_static Util_%VS_VERSION%.sln
2008-02-17 18:29:06 +01:00
cd %POCOBASE%
cd Net
2008-02-25 22:50:48 +01:00
if %DEBUG_SHARED%==1 devenv /useenv /%ACTION% debug_shared Net_%VS_VERSION%.sln
if %RELEASE_SHARED%==1 devenv /useenv /%ACTION% release_shared Net_%VS_VERSION%.sln
if %DEBUG_STATIC%==1 devenv /useenv /%ACTION% debug_static Net_%VS_VERSION%.sln
if %RELEASE_STATIC%==1 devenv /useenv /%ACTION% release_static Net_%VS_VERSION%.sln
2008-02-17 18:29:06 +01:00
cd %POCOBASE%
cd NetSSL_OpenSSL
2008-02-25 22:50:48 +01:00
if %DEBUG_SHARED%==1 devenv /useenv /%ACTION% debug_shared NetSSL_OpenSSL_%VS_VERSION%.sln
if %RELEASE_SHARED%==1 devenv /useenv /%ACTION% release_shared NetSSL_OpenSSL_%VS_VERSION%.sln
if %DEBUG_STATIC%==1 devenv /useenv /%ACTION% debug_static NetSSL_OpenSSL_%VS_VERSION%.sln
if %RELEASE_STATIC%==1 devenv /useenv /%ACTION% release_static NetSSL_OpenSSL_%VS_VERSION%.sln
2008-02-17 18:29:06 +01:00
cd %POCOBASE%
cd Data
2008-02-25 22:50:48 +01:00
if %DEBUG_SHARED%==1 devenv /useenv /%ACTION% debug_shared Data_%VS_VERSION%.sln
if %RELEASE_SHARED%==1 devenv /useenv /%ACTION% release_shared Data_%VS_VERSION%.sln
if %DEBUG_STATIC%==1 devenv /useenv /%ACTION% debug_static Data_%VS_VERSION%.sln
if %RELEASE_STATIC%==1 devenv /useenv /%ACTION% release_static Data_%VS_VERSION%.sln
2008-02-17 18:29:06 +01:00
cd %POCOBASE%
cd Data/SQLite
2008-02-25 22:50:48 +01:00
if %DEBUG_SHARED%==1 devenv /useenv /%ACTION% debug_shared SQLite_%VS_VERSION%.sln
if %RELEASE_SHARED%==1 devenv /useenv /%ACTION% release_shared SQLite_%VS_VERSION%.sln
if %DEBUG_STATIC%==1 devenv /useenv /%ACTION% debug_static SQLite_%VS_VERSION%.sln
if %RELEASE_STATIC%==1 devenv /useenv /%ACTION% release_static SQLite_%VS_VERSION%.sln
2008-02-17 18:29:06 +01:00
cd %POCOBASE%
cd Data/ODBC
2008-02-25 22:50:48 +01:00
if %DEBUG_SHARED%==1 devenv /useenv /%ACTION% debug_shared ODBC_%VS_VERSION%.sln
if %RELEASE_SHARED%==1 devenv /useenv /%ACTION% release_shared ODBC_%VS_VERSION%.sln
if %DEBUG_STATIC%==1 devenv /useenv /%ACTION% debug_static ODBC_%VS_VERSION%.sln
if %RELEASE_STATIC%==1 devenv /useenv /%ACTION% release_static ODBC_%VS_VERSION%.sln
2008-02-17 18:29:06 +01:00
cd %POCOBASE%
if "%SAMPLES%"=="no" goto :EOF
cd Foundation/samples
2008-02-25 22:50:48 +01:00
if %DEBUG_SHARED%==1 devenv /useenv /%ACTION% debug_shared samples_%VS_VERSION%.sln
if %RELEASE_SHARED%==1 devenv /useenv /%ACTION% release_shared samples_%VS_VERSION%.sln
if %DEBUG_STATIC%==1 devenv /useenv /%ACTION% debug_static samples_%VS_VERSION%.sln
if %RELEASE_STATIC%==1 devenv /useenv /%ACTION% release_static samples_%VS_VERSION%.sln
2008-02-17 18:29:06 +01:00
cd %POCOBASE%
cd XML/samples
2008-02-25 22:50:48 +01:00
if %DEBUG_SHARED%==1 devenv /useenv /%ACTION% debug_shared samples_%VS_VERSION%.sln
if %RELEASE_SHARED%==1 devenv /useenv /%ACTION% release_shared samples_%VS_VERSION%.sln
if %DEBUG_STATIC%==1 devenv /useenv /%ACTION% debug_static samples_%VS_VERSION%.sln
if %RELEASE_STATIC%==1 devenv /useenv /%ACTION% release_static samples_%VS_VERSION%.sln
2008-02-17 18:29:06 +01:00
cd %POCOBASE%
cd Util/samples
2008-02-25 22:50:48 +01:00
if %DEBUG_SHARED%==1 devenv /useenv /%ACTION% debug_shared samples_%VS_VERSION%.sln
if %RELEASE_SHARED%==1 devenv /useenv /%ACTION% release_shared samples_%VS_VERSION%.sln
if %DEBUG_STATIC%==1 devenv /useenv /%ACTION% debug_static samples_%VS_VERSION%.sln
if %RELEASE_STATIC%==1 devenv /useenv /%ACTION% release_static samples_%VS_VERSION%.sln
2008-02-17 18:29:06 +01:00
cd %POCOBASE%
cd Net/samples
2008-02-25 22:50:48 +01:00
if %DEBUG_SHARED%==1 devenv /useenv /%ACTION% debug_shared samples_%VS_VERSION%.sln
if %RELEASE_SHARED%==1 devenv /useenv /%ACTION% release_shared samples_%VS_VERSION%.sln
if %DEBUG_STATIC%==1 devenv /useenv /%ACTION% debug_static samples_%VS_VERSION%.sln
if %RELEASE_STATIC%==1 devenv /useenv /%ACTION% release_static samples_%VS_VERSION%.sln
2008-02-17 18:29:06 +01:00
cd %POCOBASE%
cd NetSSL_OpenSSL/samples
2008-02-25 22:50:48 +01:00
if %DEBUG_SHARED%==1 devenv /useenv /%ACTION% debug_shared samples_%VS_VERSION%.sln
if %RELEASE_SHARED%==1 devenv /useenv /%ACTION% release_shared samples_%VS_VERSION%.sln
if %DEBUG_STATIC%==1 devenv /useenv /%ACTION% debug_static samples_%VS_VERSION%.sln
if %RELEASE_STATIC%==1 devenv /useenv /%ACTION% release_static samples_%VS_VERSION%.sln
2008-02-17 18:29:06 +01:00
cd %POCOBASE%
cd Data/samples
2008-02-25 22:50:48 +01:00
if %DEBUG_SHARED%==1 devenv /useenv /%ACTION% debug_shared samples_%VS_VERSION%.sln
if %RELEASE_SHARED%==1 devenv /useenv /%ACTION% release_shared samples_%VS_VERSION%.sln
if %DEBUG_STATIC%==1 devenv /useenv /%ACTION% debug_static samples_%VS_VERSION%.sln
if %RELEASE_STATIC%==1 devenv /useenv /%ACTION% release_static samples_%VS_VERSION%.sln
2008-02-17 18:29:06 +01:00
cd %POCOBASE%
goto :EOF
:usage
echo Usage:
echo ------
2008-02-25 22:50:48 +01:00
echo buildwin VS_VERSION ACTION [LINKMODE] [CONFIGURATION] [SAMPLES]
echo "buildwin {71|80|90} [build|rebuild|clean] [static|shared|both] [release|debug|both] [yes|no]"