|
| 1 | +@echo off |
| 2 | +set GRASS_VERSION=6.4.0svn |
| 3 | + |
| 4 | +path %SYSTEMROOT%\system32;%SYSTEMROOT%;%SYSTEMROOT%\System32\Wbem;%PROGRAMFILES%\CMake 2.6\bin |
| 5 | +set PYTHONPATH= |
| 6 | + |
| 7 | +set VS90COMNTOOLS=%PROGRAMFILES%\Microsoft Visual Studio 9.0\Common7\Tools\ |
| 8 | +call "%PROGRAMFILES%\Microsoft Visual Studio 9.0\VC\vcvarsall.bat" x86 |
| 9 | + |
| 10 | +set OSGEO4W_ROOT=%PROGRAMFILES%\OSGeo4W |
| 11 | +call "%OSGEO4W_ROOT%\bin\o4w_env.bat" |
| 12 | + |
| 13 | +set LIB_DIR=%OSGEO4W_ROOT% |
| 14 | + |
| 15 | +set FLEX=%PROGRAMFILES%\GnuWin32\bin\flex.exe |
| 16 | +set BISON=%PROGRAMFILES%\GnuWin32\bin\bison.exe |
| 17 | + |
| 18 | +set VERSION=%1 |
| 19 | +set PACKAGE=%2 |
| 20 | + |
| 21 | +PROMPT qgis%VERSION%$g |
| 22 | + |
| 23 | +set BUILDCONF=RelWithDebInfo |
| 24 | +REM set BUILDCONF=Release |
| 25 | + |
| 26 | +if not exist build mkdir build |
| 27 | +if not exist build goto error |
| 28 | + |
| 29 | +if not exist build.log goto build |
| 30 | + |
| 31 | +REM |
| 32 | +REM try renaming the logfile to see if it's locked |
| 33 | +REM |
| 34 | + |
| 35 | +if exist build.tmp del build.tmp |
| 36 | +if exist build.tmp goto error |
| 37 | + |
| 38 | +ren build.log build.tmp |
| 39 | +if exist build.log goto locked |
| 40 | +if not exist build.tmp goto locked |
| 41 | + |
| 42 | +ren build.tmp build.log |
| 43 | +if exist build.tmp goto locked |
| 44 | +if not exist build.log goto locked |
| 45 | + |
| 46 | +goto build |
| 47 | + |
| 48 | +:locked |
| 49 | +echo Logfile locked |
| 50 | +if exist build.tmp del build.tmp |
| 51 | +goto error |
| 52 | + |
| 53 | +:build |
| 54 | +set LOG=%CD%\build.log |
| 55 | + |
| 56 | +cd build |
| 57 | + |
| 58 | +echo Logging to %LOG% |
| 59 | +echo BEGIN: %DATE% %TIME%>>%LOG% 2>&1 |
| 60 | +if errorlevel 1 goto error |
| 61 | + |
| 62 | +set >buildenv.log |
| 63 | + |
| 64 | +if exist CMakeCache.txt goto skipcmake |
| 65 | + |
| 66 | +echo CMAKE: %DATE% %TIME%>>%LOG% 2>&1 |
| 67 | +if errorlevel 1 goto error |
| 68 | + |
| 69 | +cmake -G "Visual Studio 9 2008" ^ |
| 70 | + -D PEDANTIC=TRUE ^ |
| 71 | + -D WITH_SPATIALITE=TRUE ^ |
| 72 | + -D WITH_INTERNAL_SPATIALITE=TRUE ^ |
| 73 | + -D CMAKE_CONFIGURATION_TYPE=%BUILDCONF% ^ |
| 74 | + -D CMAKE_BUILDCONFIGURATION_TYPES=%BUILDCONF% ^ |
| 75 | + -D FLEX_EXECUTABLE=%FLEX% ^ |
| 76 | + -D BISON_EXECUTABLE=%BISON% ^ |
| 77 | + -D GDAL_INCLUDE_DIR=%OSGEO4W_ROOT%\apps\gdal-16\include -D GDAL_LIBRARY=%OSGEO4W_ROOT%\apps\gdal-16\lib\gdal_i.lib ^ |
| 78 | + -D PYTHON_EXECUTABLE=%OSGEO4W_ROOT%\bin\python.exe ^ |
| 79 | + -D PYTHON_INCLUDE_DIR=%OSGEO4W_ROOT%\apps\Python25\include -D PYTHON_LIBRARY=%OSGEO4W_ROOT%\apps\Python25\libs\python25.lib ^ |
| 80 | + -D SIP_BINARY_PATH=%OSGEO4W_ROOT%\apps\Python25\sip.exe ^ |
| 81 | + -D GRASS_PREFIX=%OSGEO4W_ROOT%\apps\grass\grass-%GRASS_VERSION% ^ |
| 82 | + -D QT_BINARY_DIR=%OSGEO4W_ROOT%\bin -D QT_LIBRARY_DIR=%OSGEO4W_ROOT%\lib ^ |
| 83 | + -D QT_HEADERS_DIR=%OSGEO4W_ROOT%\include\qt4 ^ |
| 84 | + -D QT_ZLIB_LIBRARY=%OSGEO4W_ROOT%\lib\zlib.lib ^ |
| 85 | + -D QT_PNG_LIBRARY=%OSGEO4W_ROOT%\lib\libpng13.lib ^ |
| 86 | + -D CMAKE_INSTALL_PREFIX=%OSGEO4W_ROOT%\apps\qgis-dev ^ |
| 87 | + ../../..>>%LOG% 2>&1 |
| 88 | +if errorlevel 1 goto error |
| 89 | + |
| 90 | +:skipcmake |
| 91 | + |
| 92 | +echo ZERO_CHECK: %DATE% %TIME%>>%LOG% 2>&1 |
| 93 | +devenv qgis%VERSION%.sln /Project ZERO_CHECK /Build %BUILDCONF%>>%LOG% 2>&1 |
| 94 | +if errorlevel 1 goto error |
| 95 | + |
| 96 | +echo ALL_BUILD: %DATE% %TIME%>>%LOG% 2>&1 |
| 97 | +devenv qgis%VERSION%.sln /Project ALL_BUILD /Build %BUILDCONF%>>%LOG% 2>&1 |
| 98 | +if errorlevel 1 goto error |
| 99 | + |
| 100 | +echo INSTALL: %DATE% %TIME%>>%LOG% 2>&1 |
| 101 | +devenv qgis%VERSION%.sln /Project INSTALL /Build %BUILDCONF%>>%LOG% 2>&1 |
| 102 | +if errorlevel 1 goto error |
| 103 | + |
| 104 | +echo PACKAGE: %DATE% %TIME%>>%LOG% 2>&1 |
| 105 | + |
| 106 | +cd .. |
| 107 | +copy postinstall.bat %OSGEO4W_ROOT%\etc\postinstall\qgis-dev.bat |
| 108 | +copy preremove.bat %OSGEO4W_ROOT%\etc\preremove\qgis-dev.bat |
| 109 | +copy qgis-dev.bat.tmpl %OSGEO4W_ROOT%\bin\qgis-dev.bat.tmpl |
| 110 | + |
| 111 | +tar -C %OSGEO4W_ROOT% -cjf qgis-dev-%VERSION%-%PACKAGE%.tar.bz2 ^ |
| 112 | + --exclude "apps/qgis-dev/plugins/EDBSQuery.dll" ^ |
| 113 | + apps/qgis-dev ^ |
| 114 | + bin/qgis-dev.bat.tmpl ^ |
| 115 | + etc/postinstall/qgis-dev.bat ^ |
| 116 | + etc/preremove/qgis-dev.bat>>%LOG% 2>&1 |
| 117 | +if errorlevel 1 goto error |
| 118 | + |
| 119 | +goto end |
| 120 | + |
| 121 | +:error |
| 122 | +echo BUILD ERROR %ERRORLEVEL%: %DATE% %TIME% |
| 123 | +echo BUILD ERROR %ERRORLEVEL%: %DATE% %TIME%>>%LOG% 2>&1 |
| 124 | +if exist qgis-dev-%VERSION%-%PACKAGE%.tar.bz2 del qgis-dev-%VERSION%-%PACKAGE%.tar.bz2 |
| 125 | + |
| 126 | +:end |
| 127 | +echo FINISHED: %DATE% %TIME% >>%LOG% 2>&1 |
0 commit comments