summaryrefslogtreecommitdiffstats
path: root/windows/install_hlcexamples.BAT
diff options
context:
space:
mode:
authorScott Wegner <swegner@hdfgroup.org>2008-02-19 15:25:23 (GMT)
committerScott Wegner <swegner@hdfgroup.org>2008-02-19 15:25:23 (GMT)
commit17551385395c062ed26e2a6d008d3e61132c584d (patch)
tree8e177a6348592489e8003f8964ef441cd9a33d1a /windows/install_hlcexamples.BAT
parentff9a968785e6684e53172c2fcad0cb5a9d2e2ab0 (diff)
downloadhdf5-17551385395c062ed26e2a6d008d3e61132c584d.zip
hdf5-17551385395c062ed26e2a6d008d3e61132c584d.tar.gz
hdf5-17551385395c062ed26e2a6d008d3e61132c584d.tar.bz2
[svn-r14608] Purpose: Add missing Windows HL C examples
Description: The Windows suite of examples for HL C was a very small subset of the examples that exist for other platforms. Now we have all of the HL C examples-- integrated into the VS projects files, and batch test scripts. Tested: VS2005 on WinXP VNET on WinXP
Diffstat (limited to 'windows/install_hlcexamples.BAT')
-rwxr-xr-xwindows/install_hlcexamples.BAT81
1 files changed, 70 insertions, 11 deletions
diff --git a/windows/install_hlcexamples.BAT b/windows/install_hlcexamples.BAT
index 58a4503..7644ed0 100755
--- a/windows/install_hlcexamples.BAT
+++ b/windows/install_hlcexamples.BAT
@@ -19,18 +19,77 @@ rem Written by : Fang GUO
rem Created on : 07/25/2005
rem Last Modified: 2/18/2008
-pushd hl\examples
+setlocal enabledelayedexpansion
+pushd %~dp0
-mkdir HLCexamplesRELEASE
-mkdir HLCexamplesRELEASEDLL
-mkdir HLCexamplesDEBUG
-mkdir HLCexamplesDEBUGDLL
+set exdir=hl\examples
+set nerrors=0
+goto main
-for %%i in (ex_image1 ex_lite1 ex_table01 ex_ds1 ptExampleFL) do (
- copy %%i\debug\%%i.exe HLCexamplesDEBUG\
- copy %%i\release\%%i.exe HLCexamplesRELEASE\
- copy %%idll\debug\%%idll.exe HLCexamplesDEBUGDLL\
- copy %%idll\release\%%idll.exe HLCexamplesRELEASEDLL\
-)
+rem Simply create the needed directories
+:makedirs
+ mkdir %exdir%\HLCexamplesRELEASE
+ mkdir %exdir%\HLCexamplesRELEASEDLL
+ mkdir %exdir%\HLCexamplesDEBUG
+ mkdir %exdir%\HLCexamplesDEBUGDLL
+ exit /b
+rem This function actally copies the file over, first making sure it exists. If not, we increment nerrors
+rem and print an error message
+rem Expected parameters:
+rem %1 - name of file to copy
+rem %2 - destination to copy to
+:safe_copy
+
+ if exist %exdir%\%1 (
+ copy /y %exdir%\%1 %exdir%\%2 > nul
+ ) else (
+ echo.Warning: Cannot find example file: %exdir%\%1
+ set /a nerrors=%nerrors%+1
+ )
+
+ exit /b %nerrors%
+
+
+:main
+ if not exist %exdir% (
+ echo.Error: Examples directory doesn't exist: %CD%\%exdir%
+ set /a nerrors=!nerrors!+1
+ goto :end
+ )
+
+ call :makedirs
+
+ rem copy the files
+ for %%a in (DEBUG RELEASE) do (
+ for %%b in (DLL static) do (
+ set ver=%%b
+ set ver=!ver:static=!
+
+ call :safe_copy ex_ds1!ver!\%%a\ex_ds1!ver!.exe HLCexamples%%a!ver!
+
+ for /l %%c in (1,1,2) do (
+ call :safe_copy ex_image%%c!ver!\%%a\ex_image%%c!ver!.exe HLCexamples%%a!ver!
+ )
+
+ for /l %%c in (1,1,3) do (
+ call :safe_copy ex_lite%%c!ver!\%%a\ex_lite%%c!ver!.exe HLCexamples%%a!ver!
+ )
+
+ for /l %%c in (1,1,9) do (
+ call :safe_copy ex_table0%%c!ver!\%%a\ex_table0%%c!ver!.exe HLCexamples%%a!ver!
+ )
+
+ for /l %%c in (10,1,12) do (
+ call :safe_copy ex_table%%c!ver!\%%a\ex_table%%c!ver!.exe HLCexamples%%a!ver!
+ )
+
+ for %%c in (FL VL) do (
+ call :safe_copy ptExample%%c!ver!\%%a\ptExample%%c!ver!.exe HLCexamples%%a!ver!
+ )
+ )
+ )
+
+:end
popd
+endlocal & exit /b %nerrors% \ No newline at end of file