Update of MFC samples for problem "Mouse selection issue is repeatable on all your...
[occt.git] / samples / mfc / standard / env.bat
1 @ECHO OFF
2
3 rem Set environment for building OCCT mfc samples
4 rem Use first argument to specify version of Visual Studio (vc8, vc9, or vc10),
5 rem second argument specifies architecture) (win32 or win64)
6 rem - third argument specifies build mode,
7
8 rem Set build environment 
9 call "%~dp0..\..\ros\env_build.bat" %1 %2
10
11 rem Set build mode
12 set CASDEB=d
13 if not "%3" EQU "" (
14     if /I "%3" == "Release" (
15         set CASDEB=
16     ) else if /I "%3" == "Debug" (
17         set CASDEB=d
18     ) else (
19         echo Error: third argument ^(%3^) should specify build mode,
20         echo one of: Debug or Release
21         exit /B
22     )
23 )
24 )
25
26 rem Workaround for problems of building by VS2010 in 64 bit mode
27 if /I "%VCVER%" == "vc10" (
28         if  "%ARCH%" == "64" (
29                 echo Attention: The error can occured during the compilation in Visual Studio 2010, 
30                 echo            64 bit mode with embedding manifests ^(TRACKER : error TRK0002: Failed to execute command:^).
31                 echo            It's an error of Visual Studio 2010 which will be corrected in future versions of Visual Studio. 
32                 echo            More details can be found here: 
33                 echo            https://connect.microsoft.com/VisualStudio/feedback/details/505682/x64-c-c-projects-cannot-compile
34         )
35 )
36
37 SET OS_TYPE=win%ARCH%
38
39 IF NOT DEFINED CASROOT GOTO ERR_CASROOT
40
41 IF NOT DEFINED OS_TYPE GOTO ERR_OSTYPE
42
43 IF NOT EXIST "%CASROOT%\%OS_TYPE%\%VCVER%\bin\TKernel.dll" GOTO ERR_CASCADE
44
45 IF not "%CASDEB%" EQU "" (
46 SET CASLIBS=%CASROOT%\%OS_TYPE%\%VCVER%\bind
47 SET BIN_DIR=%OS_TYPE%\%VCVER%\bind
48 SET LIB_DIR=%OS_TYPE%\%VCVER%\libd
49 SET CSF_GraphicShr=%CASROOT%\%OS_TYPE%\%VCVER%\bind\TKOpenGl.dll
50 ) ELSE (
51 SET CASLIBS=%CASROOT%\%OS_TYPE%\%VCVER%\bin
52 SET BIN_DIR=%OS_TYPE%\%VCVER%\bin
53 SET LIB_DIR=%OS_TYPE%\%VCVER%\lib
54 SET CSF_GraphicShr=%CASROOT%\%OS_TYPE%\%VCVER%\bin\TKOpenGl.dll
55 )
56
57 SET PATH=%~dp0%LIB_DIR%;%~dp0%BIN_DIR%;%CASLIBS%;%PATH%
58
59 SET RES_DIR=.\res
60
61 set CSF_ResourcesDefaults=%CASROOT%\..\samples\mfc\06_Ocaf\res
62 set CSF_PluginDefaults=%CASROOT%\..\samples\mfc\06_Ocaf\res
63
64 GOTO END
65
66 :ERR_CASROOT
67 ECHO Environment variable "CASROOT" has not been defined. Abort.
68 EXIT /B
69
70 :ERR_CASCADE
71 ECHO Environment variable "CASROOT" defined incorrectly. Abort.
72 EXIT /B
73
74 :ERR_OSTYPE
75 ECHO Environment variable "OS_TYPE" has not been defined. Abort.
76 EXIT /B
77
78 :END
79