1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-02 17:46:22 +03:00

0016472: Improve environment scripts for samples

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.
This commit is contained in:
ski 2015-10-27 12:51:21 +03:00 committed by bugmaster
parent 9d99d3c16d
commit f4264b5adb
15 changed files with 116 additions and 126 deletions

View 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"
@ -101,7 +101,7 @@
</Configuration>
<Configuration
Name="Debug|x64"
OutputDirectory="..\win64\bind"
OutputDirectory="..\win64\$(VCVER)\bind"
IntermediateDirectory="obj\$(PlatformName)\$(ConfigurationName)"
ConfigurationType="2"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
@ -182,7 +182,7 @@
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="..\win32\bin"
OutputDirectory="..\win32\$(VCVER)\bin"
IntermediateDirectory="obj\$(PlatformName)\$(ConfigurationName)"
ConfigurationType="2"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
@ -259,7 +259,7 @@
</Configuration>
<Configuration
Name="Release|x64"
OutputDirectory="..\win64\bin"
OutputDirectory="..\win64\$(VCVER)\bin"
IntermediateDirectory="obj\$(PlatformName)\$(ConfigurationName)"
ConfigurationType="2"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"

View File

@ -66,16 +66,16 @@
<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>

View 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"
@ -102,7 +102,7 @@
</Configuration>
<Configuration
Name="Debug|x64"
OutputDirectory="..\win64\bind"
OutputDirectory="..\win64\$(VCVER)\bind"
IntermediateDirectory="obj\$(PlatformName)\$(ConfigurationName)"
ConfigurationType="2"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
@ -184,7 +184,7 @@
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="..\win32\bin"
OutputDirectory="..\win32\$(VCVER)\bin"
IntermediateDirectory="obj\$(PlatformName)\$(ConfigurationName)"
ConfigurationType="2"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
@ -261,7 +261,7 @@
</Configuration>
<Configuration
Name="Release|x64"
OutputDirectory="..\win64\bin"
OutputDirectory="..\win64\$(VCVER)\bin"
IntermediateDirectory="obj\$(PlatformName)\$(ConfigurationName)"
ConfigurationType="2"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"

View File

@ -67,16 +67,16 @@
<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>

View File

@ -55,14 +55,14 @@
</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>
@ -71,14 +71,14 @@
</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>

View File

@ -55,14 +55,14 @@
</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>
@ -71,14 +71,14 @@
</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>

View 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>
@ -104,7 +104,7 @@
<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>
@ -116,7 +116,7 @@
</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>
@ -125,7 +125,7 @@
<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>

11
samples/CSharp/env.bat Normal file
View File

@ -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%"

38
samples/CSharp/run.bat Normal file
View File

@ -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

View 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
call "%~dp0run.bat" WinForms

View 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
call "%~dp0run.bat" WPF_WinForms

View 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
call "%~dp0run.bat" WPF_D3D

View 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

View 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
)

View 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
)