0016472: Improve environment scripts for samples
authorski <ski@opencascade.com>
Tue, 27 Oct 2015 09:51:21 +0000 (12:51 +0300)
committerbugmaster <bugmaster@opencascade.com>
Thu, 17 Dec 2015 14:38:42 +0000 (17:38 +0300)
Output directory for binaries of CSharp samples was corrected.
Common run.bat was created for CSharp samples.
Behaviour of run.bat file from mfc samples was extended.

Recovered separate run_*.bat files for each sample in CSharp sample.

15 files changed:
samples/CSharp/OCCTProxy/OCCTProxy.vcproj
samples/CSharp/OCCTProxy/OCCTProxy.vcxproj
samples/CSharp/OCCTProxy_D3D/OCCTProxy_D3D.vcproj
samples/CSharp/OCCTProxy_D3D/OCCTProxy_D3D.vcxproj
samples/CSharp/WPF_D3D/IE_WPF_D3D.csproj
samples/CSharp/WPF_WinForms/IE_WPF_WinForms.csproj
samples/CSharp/WinForms/IE_WinForms.csproj
samples/CSharp/env.bat [new file with mode: 0644]
samples/CSharp/run.bat [new file with mode: 0644]
samples/CSharp/run_winforms.bat
samples/CSharp/run_wpf.bat
samples/CSharp/run_wpf_D3D.bat
samples/mfc/standard/run.bat
samples/qt/IESample/genproj.bat
samples/qt/Tutorial/genproj.bat

index f7ff0be..2f74a96 100644 (file)
@@ -21,7 +21,7 @@
        <Configurations>
                <Configuration
                        Name="Debug|Win32"
-                       OutputDirectory="..\win32\bind"
+                       OutputDirectory="..\win32\$(VCVER)\bind"
                        IntermediateDirectory="obj\$(PlatformName)\$(ConfigurationName)"
                        ConfigurationType="2"
                        InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
                </Configuration>
                <Configuration
                        Name="Debug|x64"
-                       OutputDirectory="..\win64\bind"
+                       OutputDirectory="..\win64\$(VCVER)\bind"
                        IntermediateDirectory="obj\$(PlatformName)\$(ConfigurationName)"
                        ConfigurationType="2"
                        InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
                </Configuration>
                <Configuration
                        Name="Release|Win32"
-                       OutputDirectory="..\win32\bin"
+                       OutputDirectory="..\win32\$(VCVER)\bin"
                        IntermediateDirectory="obj\$(PlatformName)\$(ConfigurationName)"
                        ConfigurationType="2"
                        InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
                </Configuration>
                <Configuration
                        Name="Release|x64"
-                       OutputDirectory="..\win64\bin"
+                       OutputDirectory="..\win64\$(VCVER)\bin"
                        IntermediateDirectory="obj\$(PlatformName)\$(ConfigurationName)"
                        ConfigurationType="2"
                        InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
index 6ccb3ad..57b6002 100644 (file)
   <PropertyGroup Label="UserMacros" />
   <PropertyGroup>
     <_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\win32\bind\</OutDir>
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\win32\$(VCVER)\bind\</OutDir>
     <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">obj\$(Platform)\$(Configuration)\</IntDir>
     <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">..\win64\bind\</OutDir>
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">..\win64\$(VCVER)\bind\</OutDir>
     <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">obj\$(Platform)\$(Configuration)\</IntDir>
     <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\win32\bin\</OutDir>
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\win32\$(VCVER)\bin\</OutDir>
     <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">obj\$(Platform)\$(Configuration)\</IntDir>
     <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">..\win64\bin\</OutDir>
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">..\win64\$(VCVER)\bin\</OutDir>
     <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">obj\$(Platform)\$(Configuration)\</IntDir>
     <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
   </PropertyGroup>
index 9c11a90..02d9783 100644 (file)
@@ -21,7 +21,7 @@
        <Configurations>
                <Configuration
                        Name="Debug|Win32"
-                       OutputDirectory="..\win32\bind"
+                       OutputDirectory="..\win32\$(VCVER)\bind"
                        IntermediateDirectory="obj\$(PlatformName)\$(ConfigurationName)"
                        ConfigurationType="2"
                        InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
                </Configuration>
                <Configuration
                        Name="Debug|x64"
-                       OutputDirectory="..\win64\bind"
+                       OutputDirectory="..\win64\$(VCVER)\bind"
                        IntermediateDirectory="obj\$(PlatformName)\$(ConfigurationName)"
                        ConfigurationType="2"
                        InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
                </Configuration>
                <Configuration
                        Name="Release|Win32"
-                       OutputDirectory="..\win32\bin"
+                       OutputDirectory="..\win32\$(VCVER)\bin"
                        IntermediateDirectory="obj\$(PlatformName)\$(ConfigurationName)"
                        ConfigurationType="2"
                        InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
                </Configuration>
                <Configuration
                        Name="Release|x64"
-                       OutputDirectory="..\win64\bin"
+                       OutputDirectory="..\win64\$(VCVER)\bin"
                        IntermediateDirectory="obj\$(PlatformName)\$(ConfigurationName)"
                        ConfigurationType="2"
                        InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
index 48c3c48..364f7f9 100644 (file)
   <PropertyGroup Label="UserMacros" />
   <PropertyGroup>
     <_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\win32\bind\</OutDir>
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\win32\$(VCVER)\bind\</OutDir>
     <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">obj\$(Platform)\$(Configuration)\</IntDir>
     <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</LinkIncremental>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">..\win64\bind\</OutDir>
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">..\win64\$(VCVER)\bind\</OutDir>
     <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">obj\$(Platform)\$(Configuration)\</IntDir>
     <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</LinkIncremental>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\win32\bin\</OutDir>
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\win32\$(VCVER)\bin\</OutDir>
     <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">obj\$(Platform)\$(Configuration)\</IntDir>
     <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">..\win64\bin\</OutDir>
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">..\win64\$(VCVER)\bin\</OutDir>
     <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">obj\$(Platform)\$(Configuration)\</IntDir>
     <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
   </PropertyGroup>
index d080875..91cc326 100644 (file)
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
     <DebugSymbols>true</DebugSymbols>
-    <OutputPath>..\win32\bind\</OutputPath>
+    <OutputPath>..\win32\$(VCVER)\bind\</OutputPath>
     <DefineConstants>DEBUG;TRACE</DefineConstants>
     <DebugType>full</DebugType>
     <PlatformTarget>x86</PlatformTarget>
     <ErrorReport>prompt</ErrorReport>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
-    <OutputPath>..\win32\bin\</OutputPath>
+    <OutputPath>..\win32\$(VCVER)\bin\</OutputPath>
     <DefineConstants>TRACE</DefineConstants>
     <Optimize>true</Optimize>
     <DebugType>pdbonly</DebugType>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' ">
     <DebugSymbols>true</DebugSymbols>
-    <OutputPath>..\win64\bind\</OutputPath>
+    <OutputPath>..\win64\$(VCVER)\bind\</OutputPath>
     <DefineConstants>DEBUG;TRACE</DefineConstants>
     <DebugType>full</DebugType>
     <PlatformTarget>x64</PlatformTarget>
     <ErrorReport>prompt</ErrorReport>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' ">
-    <OutputPath>..\win64\bin\</OutputPath>
+    <OutputPath>..\win64\$(VCVER)\bin\</OutputPath>
     <DefineConstants>TRACE</DefineConstants>
     <Optimize>true</Optimize>
     <DebugType>pdbonly</DebugType>
index 3a71baa..4996b07 100644 (file)
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
     <DebugSymbols>true</DebugSymbols>
-    <OutputPath>..\win32\bind\</OutputPath>
+    <OutputPath>..\win32\$(VCVER)\bind\</OutputPath>
     <DefineConstants>DEBUG;TRACE</DefineConstants>
     <DebugType>full</DebugType>
     <PlatformTarget>x86</PlatformTarget>
     <ErrorReport>prompt</ErrorReport>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
-    <OutputPath>..\win32\bin\</OutputPath>
+    <OutputPath>..\win32\$(VCVER)\bin\</OutputPath>
     <DefineConstants>TRACE</DefineConstants>
     <Optimize>true</Optimize>
     <DebugType>pdbonly</DebugType>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' ">
     <DebugSymbols>true</DebugSymbols>
-    <OutputPath>..\win64\bind\</OutputPath>
+    <OutputPath>..\win64\$(VCVER)\bind\</OutputPath>
     <DefineConstants>DEBUG;TRACE</DefineConstants>
     <DebugType>full</DebugType>
     <PlatformTarget>x64</PlatformTarget>
     <ErrorReport>prompt</ErrorReport>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' ">
-    <OutputPath>..\win64\bin\</OutputPath>
+    <OutputPath>..\win64\$(VCVER)\bin\</OutputPath>
     <DefineConstants>TRACE</DefineConstants>
     <Optimize>true</Optimize>
     <DebugType>pdbonly</DebugType>
index 41a68fa..54b7b2a 100644 (file)
@@ -95,7 +95,7 @@
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
     <DebugSymbols>true</DebugSymbols>
-    <OutputPath>..\win32\bind\</OutputPath>
+    <OutputPath>..\win32\$(VCVER)\bind\</OutputPath>
     <DefineConstants>DEBUG;TRACE</DefineConstants>
     <BaseAddress>285212672</BaseAddress>
     <DebugType>full</DebugType>
     <GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
-    <OutputPath>..\win32\bin\</OutputPath>
+    <OutputPath>..\win32\$(VCVER)\bin\</OutputPath>
     <DefineConstants>TRACE</DefineConstants>
     <BaseAddress>285212672</BaseAddress>
     <Optimize>true</Optimize>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' ">
     <DebugSymbols>true</DebugSymbols>
-    <OutputPath>..\win64\bind\</OutputPath>
+    <OutputPath>..\win64\$(VCVER)\bind\</OutputPath>
     <DefineConstants>DEBUG;TRACE</DefineConstants>
     <BaseAddress>285212672</BaseAddress>
     <FileAlignment>4096</FileAlignment>
     <ErrorReport>prompt</ErrorReport>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' ">
-    <OutputPath>..\win64\bin\</OutputPath>
+    <OutputPath>..\win64\$(VCVER)\bin\</OutputPath>
     <DefineConstants>TRACE</DefineConstants>
     <BaseAddress>285212672</BaseAddress>
     <Optimize>true</Optimize>
diff --git a/samples/CSharp/env.bat b/samples/CSharp/env.bat
new file mode 100644 (file)
index 0000000..dafb10b
--- /dev/null
@@ -0,0 +1,11 @@
+call "%~dp0..\..\env.bat" %1 %2 %3
+
+set "BIN_DIR=win%ARCH%\%VCVER%\bind"
+set "LIB_DIR=win%ARCH%\%VCVER%\libd"
+
+if ["%CASDEB%"] == [""] (
+  set "BIN_DIR=win%ARCH%\%VCVER%\bin"
+  set "LIB_DIR=win%ARCH%\%VCVER%\lib"
+)
+
+set "PATH=%~dp0%LIB_DIR%;%~dp0%BIN_DIR%;%PATH%"
\ No newline at end of file
diff --git a/samples/CSharp/run.bat b/samples/CSharp/run.bat
new file mode 100644 (file)
index 0000000..1643fd6
--- /dev/null
@@ -0,0 +1,38 @@
+@echo off
+
+if "%1" == "-h" (
+  goto err_bat
+)
+
+if not ["%4"] == [""] (
+  set "SampleName=%4"
+  call "%~dp0env.bat" %1 %2 %3
+) else if not ["%1"] == [""] (
+  set "SampleName=%1"
+  call "%~dp0env.bat"
+) else (
+  goto err_bat
+)
+
+if not exist "%~dp0%BIN_DIR%\IE_%SampleName%.exe" goto err_exe
+
+"%~dp0%BIN_DIR%\IE_%SampleName%.exe"
+
+goto eof
+
+:err_bat
+echo Possible names of samples: WinForms, WPF_D3D, WPF_WinForms
+echo Launch selected sample as follows:
+echo   %~n0.bat [^vc8^|^vc9^|^vc10^|^vc11^|vc12] [^win32^|^win64^] [^Release^|^Debug^] [^SampleName^]
+echo or
+echo   %~n0.bat [^SampleName^]
+echo Run %~n0.bat -h to get this help
+exit /B
+
+:err_exe
+echo Executable %~dp0%BIN_DIR%\IE_%SampleName%.exe not found.
+echo Check that OCCT and sample are built with the selected configuration:
+echo compiler=%VCVER% platform=win%ARCH% %3
+exit /B
+
+:eof
index 1c93f65..9ea3092 100644 (file)
@@ -1,27 +1,3 @@
 @echo off
 
-if "%1" == "-h" (
-  echo Launch WinForms sample as follows: 
-  echo %~n0 ^[vc9^] ^[win32^|win64^] ^[Debug^|Release^]
-  echo By default configuration set in ..\..\custom.bat is used
-  echo Run %~n0 -h to get this help
-  exit /B
-)
-
-call "%~dp0..\..\env.bat" %1 %2 %3
-
-set "EXEC=%~dp0\win%ARCH%\bin%CASDEB%\IE_WinForms.exe"
-
-if not exist "%EXEC%" goto err_exe
-
-"%EXEC%"
-
-goto eof
-
-:err_exe
-echo Executable %EXEC% not found.
-echo Check that OCCT and sample are built with the selected configuration:
-echo compiler=%VCVER% platform=win%ARCH% %3
-exit /B
-
-:eof
\ No newline at end of file
+call "%~dp0run.bat" WinForms
index 07ddc2a..7a09f13 100644 (file)
@@ -1,27 +1,3 @@
 @echo off
 
-if "%1" == "-h" (
-  echo Launch WPF sample as follows: 
-  echo %~n0 ^[vc9^] ^[win32^|win64^] ^[Debug^|Release^]
-  echo By default configuration set in ..\..\custom.bat is used
-  echo Run %~n0 -h to get this help
-  exit /B
-)
-
-call "%~dp0..\..\env.bat" %1 %2 %3
-
-set "EXEC=%~dp0\win%ARCH%\bin%CASDEB%\IE_WPF_WinForms.exe"
-
-if not exist "%EXEC%" goto err_exe
-
-"%EXEC%"
-
-goto eof
-
-:err_exe
-echo Executable %EXEC% not found.
-echo Check that OCCT and sample are built with the selected configuration:
-echo compiler=%VCVER% platform=win%ARCH% %3
-exit /B
-
-:eof
\ No newline at end of file
+call "%~dp0run.bat" WPF_WinForms
index 37c8904..9a4d882 100644 (file)
@@ -1,27 +1,3 @@
 @echo off
 
-if "%1" == "-h" (
-  echo Launch WPF sample as follows: 
-  echo %~n0 ^[vc9^] ^[win32^|win64^] ^[Debug^|Release^]
-  echo By default configuration set in ..\..\custom.bat is used
-  echo Run %~n0 -h to get this help
-  exit /B
-)
-
-call "%~dp0..\..\env.bat" %1 %2 %3
-
-set "EXEC=%~dp0\win%ARCH%\bin%CASDEB%\IE_WPF_D3D.exe"
-
-if not exist "%EXEC%" goto err_exe
-
-"%EXEC%"
-
-goto eof
-
-:err_exe
-echo Executable %EXEC% not found.
-echo Check that OCCT and sample are built with the selected configuration:
-echo compiler=%VCVER% platform=win%ARCH% %3
-exit /B
-
-:eof
\ No newline at end of file
+call "%~dp0run.bat" WPF_D3D
index c2a62b4..a2feea1 100644 (file)
@@ -1,22 +1,35 @@
 @echo off
 
-if ["%4"] == [""] (
-  echo Launch selected sample as follows: 
-  echo Run.bat [^vc8^|^vc9^|^vc10^|^vc11^|vc12] [^win32^|^win64^] [^Release^|^Debug^] [^SampleName^]
-  echo Use option -d to run Debug mode
-  exit /B
+if "%1" == "-h" (
+  goto err_bat
 )
 
-call "%~dp0env.bat" %1 %2 %3
+if not ["%4"] == [""] (
+  set "SampleName=%4"
+  call "%~dp0env.bat" %1 %2 %3
+) else if not ["%1"] == [""] (
+  set "SampleName=%1"
+  call "%~dp0env.bat"
+) else (
+  goto err_bat
+)
 
-if not exist "%~dp0%BIN_DIR%\%4.exe" goto err_exe
+if not exist "%~dp0%BIN_DIR%\%SampleName%.exe" goto err_exe
 
-"%~dp0%BIN_DIR%\%4.exe"
+"%~dp0%BIN_DIR%\%SampleName%.exe"
 
 goto eof
 
+:err_bat
+echo Launch selected sample as follows:
+echo   %~n0.bat [^vc8^|^vc9^|^vc10^|^vc11^|vc12] [^win32^|^win64^] [^Release^|^Debug^] [^SampleName^]
+echo or
+echo   %~n0.bat [^SampleName^]
+echo Run %~n0.bat -h to get this help
+exit /B
+
 :err_exe
-echo Executable %~dp0%BIN_DIR%\%4.exe not found.
+echo Executable %~dp0%BIN_DIR%\%SampleName%.exe not found.
 echo Probably you didn't compile the application.
 exit /B
 
index b65650f..b3bf9b3 100644 (file)
@@ -10,27 +10,27 @@ call "%~dp0env.bat" %1 %2 %3
 
 set EXT=vcproj
 
-if not "%1" == "" (
-    if /I "%1" == "vc8" (
+if not "%VCVER%" == "" (
+    if /I "%VCVER%" == "vc8" (
         set VCVER=vc8
         set "VCVARS=%VS80COMNTOOLS%..\..\VC\vcvarsall.bat"
-    ) else if /I "%1" == "vc9" (
+    ) else if /I "%VCVER%" == "vc9" (
         set VCVER=vc9
         set "VCVARS=%VS90COMNTOOLS%..\..\VC\vcvarsall.bat"
-    ) else if /I "%1" == "vc10" (
+    ) else if /I "%VCVER%" == "vc10" (
         set VCVER=vc10
         set EXT=vcxproj
         set "VCVARS=%VS100COMNTOOLS%..\..\VC\vcvarsall.bat"
-    ) else if /I "%1" == "vc11" (
+    ) else if /I "%VCVER%" == "vc11" (
         set VCVER=vc11
         set EXT=vcxproj
         set "VCVARS=%VS110COMNTOOLS%..\..\VC\vcvarsall.bat"
-    ) else if /I "%1" == "vc12" (
+    ) else if /I "%VCVER%" == "vc12" (
         set VCVER=vc12
         set EXT=vcxproj
         set "VCVARS=%VS120COMNTOOLS%..\..\VC\vcvarsall.bat"
     ) else (
-        echo Error: first argument ^(%1^) should specify supported version of Visual C++,
+        echo Error: first argument ^(%VCVER%^) should specify supported version of Visual C++,
         echo one of: vc8 ^(VS 2005 SP1^), vc9 ^(VS 2008 SP1^), vc10 ^(VS 2010^) or vc11 ^(VS 2012^)
         exit
     )
index 2cac919..eb1903d 100644 (file)
@@ -10,27 +10,27 @@ call "%~dp0env.bat" %1 %2 %3
 
 set EXT=vcproj
 
-if not "%1" == "" (
-    if /I "%1" == "vc8" (
+if not "%VCVER%" == "" (
+    if /I "%VCVER%" == "vc8" (
         set VCVER=vc8
         set "VCVARS=%VS80COMNTOOLS%..\..\VC\vcvarsall.bat"
-    ) else if /I "%1" == "vc9" (
+    ) else if /I "%VCVER%" == "vc9" (
         set VCVER=vc9
         set "VCVARS=%VS90COMNTOOLS%..\..\VC\vcvarsall.bat"
-    ) else if /I "%1" == "vc10" (
+    ) else if /I "%VCVER%" == "vc10" (
         set VCVER=vc10
         set EXT=vcxproj
         set "VCVARS=%VS100COMNTOOLS%..\..\VC\vcvarsall.bat"
-    ) else if /I "%1" == "vc11" (
+    ) else if /I "%VCVER%" == "vc11" (
         set VCVER=vc11
         set EXT=vcxproj
         set "VCVARS=%VS110COMNTOOLS%..\..\VC\vcvarsall.bat"
-    ) else if /I "%1" == "vc12" (
+    ) else if /I "%VCVER%" == "vc12" (
         set VCVER=vc12
         set EXT=vcxproj
         set "VCVARS=%VS120COMNTOOLS%..\..\VC\vcvarsall.bat"
     ) else (
-        echo Error: first argument ^(%1^) should specify supported version of Visual C++,
+        echo Error: first argument ^(%VCVER%^) should specify supported version of Visual C++,
         echo one of: vc8 ^(VS 2005 SP1^), vc9 ^(VS 2008 SP1^), vc10 ^(VS 2010^) or vc11 ^(VS 2012^)
         exit
     )