0027127: Implementation of compilation of OCCT Products samples on all platforms...
[occt.git] / samples / mfc / standard / msvc.bat
1 @echo off
2
3 Setlocal EnableDelayedExpansion
4
5 rem Setup environment
6 call "%~dp0env.bat" %1 %2 %3
7
8 rem Define path to project file
9 set "PRJFILE=%~dp0All-%VCVER%.sln"
10
11 set "VisualStudioExpressName=VCExpress"
12
13 if /I "%VCVER%" == "vc10" (
14   set "DevEnvDir=%VS100COMNTOOLS%..\IDE"
15 ) else if /I "%VCVER%" == "vc11" (
16   set "DevEnvDir=%VS110COMNTOOLS%..\IDE"
17   rem Visual Studio Express starting from VS 2012 is called "for Windows Desktop"
18   rem and has a new name for executable - WDExpress
19   set "VisualStudioExpressName=WDExpress"
20 ) else if /I "%VCVER%" == "vc12" (
21   set "DevEnvDir=%VS120COMNTOOLS%..\IDE"
22   set "VisualStudioExpressName=WDExpress"
23 ) else if /I "%VCVER%" == "vc14" (
24   set "DevEnvDir=%VS140COMNTOOLS%..\IDE"
25   set "VisualStudioExpressName=WDExpress"
26 ) else (
27   echo Error: wrong VS identifier
28   exit /B
29 )
30
31 rem Launch Visual Studio - either professional (devenv) or Express, as available
32 if exist "%DevEnvDir%\devenv.exe"  (
33   start "%DevEnvDir%\devenv.exe" "%PRJFILE%"
34 ) else if exist "%DevEnvDir%\%VisualStudioExpressName%.exe"  (
35   start "%DevEnvDir%\%VisualStudioExpressName%.exe" "%PRJFILE%"
36 ) else (
37   echo Error: Could not find MS Visual Studio ^(%VCVER%^)
38   echo Check relevant environment variable ^(e.g. VS80COMNTOOLS for vc8^)
39 )