1@echo off 2 3set type=%1 4set mode=%2 5set msvc=%3 6set libname=%4 7 8rem ************************************************************************ 9rem * check script arguments 10 11if "%type%"=="dll" goto argonegiven 12if "%type%"=="lib" goto argonegiven 13goto argproblem 14:argonegiven 15 16if "%mode%"=="release" goto argtwogiven 17if "%mode%"=="debug" goto argtwogiven 18goto argproblem 19:argtwogiven 20 21if "%msvc%"=="msvc6" goto argthreegiven 22if "%msvc%"=="msvc7" goto argthreegiven 23if "%msvc%"=="msvc8" goto argthreegiven 24if "%msvc%"=="msvc9" goto argthreegiven 25if "%msvc%"=="msvc10" goto argthreegiven 26goto argproblem 27:argthreegiven 28 29if "%libname%"=="coin2" goto argfourgiven 30if "%libname%"=="coin3" goto argfourgiven 31if "%libname%"=="coin4" goto argfourgiven 32if "%libname%"=="simage1" goto argfourgiven 33if "%libname%"=="smallchange1" goto argfourgiven 34if "%libname%"=="simvoleon1" goto argfourgiven 35if "%libname%"=="simvoleon2" goto argfourgiven 36if "%libname%"=="nutsnbolts0" goto argfourgiven 37if "%libname%"=="soqt1" goto argfourgiven 38if "%libname%"=="sowin1" goto argfourgiven 39rem goto argproblem 40:argfourgiven 41 42goto argtestdone 43 44:argproblem 45echo Error with script arguments "%1" "%2" "%3" "%4". 46echo Usage: 47echo install-sdk.bat {dll,lib} {release,debug} {msvc6,msvc7,msvc8,msvc9} libname 48exit 49 50:argtestdone 51 52rem ************************************************************************ 53rem * check environment variables 54 55if not "%COINDIR%"=="" goto coindirset 56echo The COINDIR environment variable must be set to point to a directory 57echo to be able to perform the installation procedure. 58exit 59 60:coindirset 61if exist %COINDIR%\*.* goto coindirexists 62echo The COINDIR environment variable must point to an existing directory 63echo to be able to perform the installation procedure. 64exit 65 66:coindirexists 67 68rem ********************************************************************** 69rem * Check that build has been performed... 70 71if "%1"=="dll" goto checkdll 72goto checklib 73 74:checkdll 75 76if "%2"=="debug" goto checkdlldebug 77goto checkdllrelease 78 79:checkdlldebug 80if exist %libname%d.dll goto checkdone 81goto checkfailed 82 83:checkdllrelease 84if exist %libname%.dll goto checkdone 85goto checkfailed 86 87:checklib 88 89if "%2"=="debug" goto checklibdebug 90goto checklibrelease 91 92:checklibdebug 93if exist %libname%sd.lib goto checkdone 94goto checkfailed 95 96:checklibrelease 97if exist %libname%s.lib goto checkdone 98goto checkfailed 99 100:checkfailed 101echo ERROR: You do not seem to have compiled the %2-version of %libname% yet. 102exit 103 104:checkdone 105 106rem ********************************************************************** 107 108echo Installing to %COINDIR% 109 110rem ********************************************************************** 111rem * Create all the directories 112 113if exist ..\misc\create-directories.bat goto createdirsexists 114goto donecreatedirs 115:createdirsexists 116echo Creating necessary directories... 117call ..\misc\create-directories.bat 118:donecreatedirs 119 120rem ********************************************************************** 121rem * Copy files 122 123if exist ..\misc\install-headers.bat goto installheadersexists 124goto doneinstallheaders 125:installheadersexists 126echo Installing header files... 127call ..\misc\install-headers.bat %msvc% 128:doneinstallheaders 129 130if exist ..\misc\install-data.bat goto installdataexists 131goto doneinstalldata 132:installdataexists 133echo Installing data files... 134call ..\misc\install-data.bat %msvc% 135:doneinstalldata 136 137rem ********************************************************************** 138 139echo Installing binaries... 140 141if "%1"=="dll" goto installdll 142goto installlib 143 144:installdll 145 146if "%2"=="debug" goto installdlldebug 147goto installdllrelease 148 149:installdlldebug 150xcopy %libname%d.dll %COINDIR%\bin\ /R /Y 151xcopy Debug\%libname%d.pdb %COINDIR%\bin\ /R /Y 152xcopy Debug\%libname%d.lib %COINDIR%\lib\ /R /Y 153goto binariesdone 154 155:installdllrelease 156xcopy %libname%.dll %COINDIR%\bin\ /R /Y 157xcopy Release\%libname%.lib %COINDIR%\lib\ /R /Y 158goto binariesdone 159 160:installlib 161 162if "%2"=="debug" goto installlibdebug 163goto installlibrelease 164 165:installlibdebug 166xcopy %libname%sd.lib %COINDIR%\lib\ /R /Y 167goto binariesdone 168 169:installlibrelease 170xcopy %libname%s.lib %COINDIR%\lib\ /R /Y 171goto binariesdone 172 173:binariesdone 174