1@rem **************************************************************
2@rem * This batch file create binary packages for plplot (windows)
3@rem *
4@rem * Before you run this file modify the configuration part
5@rem *
6@rem * It is assumed, that before running this batch file, that
7@rem * you have already passed the cmake configuration step,
8@rem * and have run "make" and "make install" or equivalent
9@rem * Usage: make_win_package VISUALC: VisualC, release build
10@rem *        make_win_package VISUALC DEBUG : VisualC, debug build
11@rem *        make_win_package MINGW : MinGW, release build
12@rem *        make_win_package MINGW DEBUG : MinGW, debug build
13@rem **************************************************************
14
15@rem **************************************************************
16@rem * Configuration
17@rem **************************************************************
18
19setlocal
20if "%1"=="MINGW" (
21  set MINGW=1
22  shift /1
23)
24if "%1"=="VISUALC" (
25  set MINGW=0
26  shift /1
27)
28if "%1"=="DEBUG" (
29  set DEBUG=d
30)
31
32set VERSION=5.7.2
33
34if "%MINGW%"=="1" (
35  @rem *** MINGW SETTINGS ***
36  @rem * INSTALLDIR is the absolute path to the installed plplot directory (make install)
37  set INSTALLDIR=Z:\DevZone\PLDev\plplot\buildmingw\local
38
39  @rem * GDDLLDIR is the absolute path to bgd.dll
40  set GDDLLDIR=Z:\DevZone\MinGW\3p_plplot\lib
41
42  @rem * HPDFDLLDIR is the absolute path to libhpdf.dll
43  set HPDFDLLDIR=Z:\DevZone\MinGW\3p_plplot\lib
44
45  @rem * WXDLLDIR is the absolute path to wxwidgets dlls
46  set WXDLLDIR=%WXWIN%\lib\gcc_dll
47
48  @rem * Name of the package
49  set PACKAGE_NAME=plplot-%VERSION%-mingw-binary
50) else (
51  @rem *** VISUALC SETTINGS ***
52  @rem * INSTALLDIR is the absolute path to the installed plplot directory (make install)
53  set INSTALLDIR=Z:\DevZone\PLDev\plplot\buildnmake\local
54
55  @rem * GDDLLDIR is the absolute path to bgd.dll
56  set GDDLLDIR=Z:\DevZone\VisualC\3p_plplot\lib
57
58  @rem * HPDFDLLDIR is the absolute path to libhpdf.dll
59  set HPDFDLLDIR=Z:\DevZone\VisualC\3p_plplot\lib
60
61  @rem * WXDLLDIR is the absolute path to wxwidgets dlls
62  set WXDLLDIR=%WXWIN%\lib\vc_dll
63
64  @rem * Name of the package
65  set PACKAGE_NAME=plplot-%VERSION%-visualc-binary
66)
67
68@rem **************************************************************
69@rem * Create Zip package
70@rem * You need the zip tool for this step (gnuwin32.sf.net)
71@rem **************************************************************
72
73echo Creating package %PACKAGE_NAME%.zip
74
75@rem * delete package if it already exists
76if exist %PACKAGE_NAME%.zip (del %PACKAGE_NAME%.zip)
77
78@rem * cd into the install directory
79pushd %INSTALLDIR%
80
81@rem * copy 3rd party dlls if they exist
82if exist %GDDLLDIR%\bgd.dll (copy %GDDLLDIR%\bgd.dll bin)
83if exist %HPDFDLLDIR%\libhpdf.dll (copy %HPDFDLLDIR%\libhpdf.dll bin)
84if %MINGW%==1 (
85  if exist %WXDLLDIR%\wxbase26%DEBUG%_gcc_custom.dll (copy %WXDLLDIR%\wxbase26%DEBUG%_gcc_custom.dll bin)
86  if exist %WXDLLDIR%\wxmsw26%DEBUG%_core_gcc_custom.dll (copy %WXDLLDIR%\wxmsw26%DEBUG%_core_gcc_custom.dll bin)
87) else (
88  if exist %WXDLLDIR%\wxbase26u%DEBUG%_vc_custom.dll (copy %WXDLLDIR%\wxbase26u%DEBUG%_vc_custom.dll bin)
89  if exist %WXDLLDIR%\wxmsw26u%DEBUG%_core_vc_custom.dll (copy %WXDLLDIR%\wxmsw26u%DEBUG%_core_vc_custom.dll bin)
90)
91@rem strip debug information from libraries
92if NOT "%DEBUG%"=="d" ( if %MINGW%==1 (strip bin\*.dll) )
93
94@rem * create base package
95zip -r9 %PACKAGE_NAME%.zip *.*
96
97@rem * get back to old directory
98popd
99
100@rem * move package into current folder
101if exist %INSTALLDIR%\%PACKAGE_NAME%.zip (move %INSTALLDIR%\%PACKAGE_NAME%.zip %PACKAGE_NAME%.zip)
102
103goto end
104
105:error
106echo There was an error!
107goto :eof
108
109:end
110echo.
111echo The package %PACKAGE_NAME%.zip was created!
112echo.
113dir %PACKAGE_NAME%.zip
114
115