b5dc7726584d3bc92f73801a76b3452e88e80fad
[occt.git] / samples / CSharp / msvc_D3D.bat
1 @echo off
2
3 Setlocal EnableDelayedExpansion
4
5 rem Setup environment
6 call "%~dp0env.bat" %1 %2 %3
7
8 if NOT DEFINED DXSDK_DIR (
9   if /I "%VCVER%" == "vc9" (
10     echo ERROR: DirectX SDK is required in order to build the sample but it is not found in your system. Please install DirectX SDK and retry.
11     exit /B
12   )
13   if /I "%VCVER%" == "vc10" (
14     echo ERROR: DirectX SDK is required in order to build the sample but it is not found in your system. Please install DirectX SDK and retry.
15     exit /B
16   )
17 )
18
19 rem Define path to project file
20 set "PRJFILE=%~dp0\CSharp_D3D.sln"
21
22 set "VisualStudioExpressName=VCExpress"
23
24 if /I "%VCVER%" == "vc8" (
25   set "DevEnvDir=%VS80COMNTOOLS%..\IDE"
26 ) else if /I "%VCVER%" == "vc9" (
27   set "DevEnvDir=%VS90COMNTOOLS%..\IDE"
28 ) else if /I "%VCVER%" == "vc10" (
29   set "DevEnvDir=%VS100COMNTOOLS%..\IDE"
30 ) else if /I "%VCVER%" == "vc11" (
31   set "DevEnvDir=%VS110COMNTOOLS%..\IDE"
32   rem Visual Studio Express starting from VS 2012 is called "for Windows Desktop"
33   rem and has a new name for executable - WDExpress
34   set "VisualStudioExpressName=WDExpress"
35 ) else if /I "%VCVER%" == "vc12" (
36   set "DevEnvDir=%VS120COMNTOOLS%..\IDE"
37   set "VisualStudioExpressName=WDExpress"
38 ) else (
39   echo Error: wrong VS identifier
40   exit /B
41 )
42
43 rem Launch Visual Studio - either professional (devenv) or Express, as available
44 if exist "%DevEnvDir%\devenv.exe"  (
45   start "%DevEnvDir%\devenv.exe" "%PRJFILE%"
46 ) else if exist "%DevEnvDir%\%VisualStudioExpressName%.exe"  (
47   start "%DevEnvDir%\%VisualStudioExpressName%.exe" "%PRJFILE%"
48 ) else (
49   echo Error: Could not find MS Visual Studio ^(%VCVER%^)
50   echo Check relevant environment variable ^(e.g. VS80COMNTOOLS for vc8^)
51 )