summaryrefslogtreecommitdiff
path: root/msvc.bat
blob: 1811f36e96d50f3b31049b43a207661ace458f9d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
@echo off
rem Launch MS VC with environment prepared for building OCCT

rem Use:
rem - first argument specifies version of Visual Studio (vc8, vc9, or vc10),
rem - second argument specifies mode (win32 or win64),
rem - third argument specifies building mode (Release or Debug)
rem - fourth argument is path to MS project solution
rem Default options are:
rem   vc8 win32 Debug adm\win32\vc8\OCCT.sln

rem Set build mode
set CASDEB=d
if not "%3" == "" (
    if /I "%3" == "Debug" (
        set CASDEB=d
    ) else if /I "%3" == "Release" (
        set CASDEB=
    ) else (
        echo Error: third argument ^(%3^) should specify build mode,
        echo one of: Debug or Release
        exit
    )
)

rem Set build environment 
call "%~dp0env_build.bat" %1 %2

rem Define path to project file
set "PRJFILE=%~dp0\adm\win%ARCH%\%VCVER%\OCCT.sln"
if not "%4" == "" (
    set "PRJFILE=%4"
)

rem Launch Visual Studio - either professional (devenv) or Express, as available
if exist "%DevEnvDir%\devenv.exe"  (
    start devenv.exe "%PRJFILE%" /useenv
) else if exist "%DevEnvDir%\VCExpress.exe"  (
    start VCExpress.exe "%PRJFILE%" /useenv
) else (
    echo Error: Could not find MS Visual Studio ^(%VCVER%^)
    echo Check relevant environment variable ^(e.g. VS80COMNTOOLS for vc8^)
)