Skip to content
Permalink
Browse files

forward port osgeo4w stuff from 1.7

  • Loading branch information
jef-n committed Jun 16, 2012
1 parent 577f12d commit c64bb9dabf28a45b9c8c3a820557c46dadbb3a4d
@@ -0,0 +1,8 @@
@echo off

SET OSGEO4W_ROOT=@osgeo4w@
call "%OSGEO4W_ROOT%"\bin\o4w_env.bat
call "%OSGEO4W_ROOT%"\apps\grass\grass-@grassversion@\etc\env.bat
@echo off
path %PATH%;%OSGEO4W_ROOT%\apps\@package@\bin;%OSGEO4W_ROOT%\apps\grass\grass-@grassversion@\lib
start "Quantum GIS Browser" /B "%OSGEO4W_ROOT%"\apps\@package@\bin\qbrowser.exe %*
@@ -0,0 +1,14 @@
LoadModule fcgid_module modules/mod_fcgid.so

DefaultInitEnv PATH "@osgeo4w@\bin;@osgeo4w@\apps\@package@\bin;@osgeo4w@\apps\grass\grass-@grassversion@\bin;@osgeo4w@\apps\grass\grass-@grassversion@\lib;@windir@\system32;@windir@;@windir@\System32\Wbem"
DefaultInitEnv QGIS_PREFIX_PATH "@osgeo4w@\apps\@package@"
DefaultInitEnv TEMP "@temp@"

Alias /@package@/ @osgeo4w@/apps/@package@/bin/

<Directory "@osgeo4w@/apps/@package@/bin/">
SetHandler fcgid-script
Options ExecCGI
Order allow,deny
Allow from all
</Directory>
@@ -111,8 +111,6 @@ cmake -G "Visual Studio 9 2008" ^
-D QT_PNG_LIBRARY=%O4W_ROOT%/lib/libpng13.lib ^
-D QWT_INCLUDE_DIR=%O4W_ROOT%/include/qwt ^
-D QWT_LIBRARY=%O4W_ROOT%/lib/qwt5.lib ^
-D ZLIB_INCLUDE_DIR=%O4W_ROOT%/include ^
-D ZLIB_LIBRARY=%O4W_ROOT%/lib/zlib.lib ^
-D CMAKE_INSTALL_PREFIX=%O4W_ROOT%/apps/%PACKAGENAME% ^
-D CMAKE_CXX_FLAGS_RELWITHDEBINFO="/MD /ZI /Od /D NDEBUG" ^
-D FCGI_INCLUDE_DIR=%O4W_ROOT%/include ^
@@ -46,6 +46,8 @@ set SRCDIR=%CD%
if "%BUILDDIR:~1,1%"==":" %BUILDDIR:~0,2%
cd %BUILDDIR%

if exist repackage goto package

if not exist build.log goto build

REM
@@ -92,9 +94,9 @@ cmake -G "Visual Studio 9 2008" ^
-D WITH_GLOBE=TRUE ^
-D CMAKE_BUILD_TYPE=%BUILDCONF% ^
-D CMAKE_CONFIGURATION_TYPES=%BUILDCONF% ^
-D GEOS_LIBRARY=%OSGEO4W_ROOT%/lib/geos_c_i.lib ^
-D SQLITE3_LIBRARY=%OSGEO4W_ROOT%/lib/sqlite3_i.lib ^
-D SPATIALITE_LIBRARY=%OSGEO4W_ROOT%/lib/spatialite_i.lib ^
-D GEOS_LIBRARY=%O4W_ROOT%/lib/geos_c_i.lib ^
-D SQLITE3_LIBRARY=%O4W_ROOT%/lib/sqlite3_i.lib ^
-D SPATIALITE_LIBRARY=%O4W_ROOT%/lib/spatialite_i.lib ^
-D PYTHON_EXECUTABLE=%O4W_ROOT%/bin/python.exe ^
-D PYTHON_INCLUDE_PATH=%O4W_ROOT%/apps/Python27/include ^
-D PYTHON_LIBRARY=%O4W_ROOT%/apps/Python27/libs/python27.lib ^
@@ -107,8 +109,6 @@ cmake -G "Visual Studio 9 2008" ^
-D QT_PNG_LIBRARY=%O4W_ROOT%/lib/libpng13.lib ^
-D QWT_INCLUDE_DIR=%O4W_ROOT%/include/qwt ^
-D QWT_LIBRARY=%O4W_ROOT%/lib/qwt5.lib ^
-D ZLIB_INCLUDE_DIR=%O4W_ROOT%/include ^
-D ZLIB_LIBRARY=%O4W_ROOT%/lib/zlib.lib ^
-D CMAKE_INSTALL_PREFIX=%O4W_ROOT%/apps/%PACKAGENAME% ^
-D CMAKE_CXX_FLAGS_RELWITHDEBINFO="/MD /ZI /Od /D NDEBUG" ^
-D FCGI_INCLUDE_DIR=%O4W_ROOT%/include ^
@@ -124,58 +124,129 @@ if not errorlevel 1 goto error

echo ZERO_CHECK: %DATE% %TIME%>>%LOG% 2>&1
%DEVENV% qgis%VERSION%.sln /Project ZERO_CHECK /Build %BUILDCONF% /Out %LOG%>>%LOG% 2>&1
if errorlevel 1 goto error
if errorlevel 1 goto error

echo ALL_BUILD: %DATE% %TIME%>>%LOG% 2>&1
%DEVENV% qgis%VERSION%.sln /Project ALL_BUILD /Build %BUILDCONF% /Out %LOG%>>%LOG% 2>&1
if errorlevel 1 goto error
if errorlevel 1 goto error

echo INSTALL: %DATE% %TIME%>>%LOG% 2>&1
%DEVENV% qgis%VERSION%.sln /Project INSTALL /Build %BUILDCONF% /Out %LOG%>>%LOG% 2>&1
if errorlevel 1 goto error

:package
echo PACKAGE: %DATE% %TIME%>>%LOG% 2>&1

cd ..
sed -e 's/@package@/%PACKAGENAME%/g' -e 's/@version@/%VERSION%/g' -e 's/@grassversion@/%GRASS_VERSION%/g' postinstall.bat >%OSGEO4W_ROOT%\etc\postinstall\%PACKAGENAME%.bat
sed -e 's/@package@/%PACKAGENAME%/g' -e 's/@version@/%VERSION%/g' -e 's/@grassversion@/%GRASS_VERSION%/g' preremove.bat >%OSGEO4W_ROOT%\etc\preremove\%PACKAGENAME%.bat
sed -e 's/@package@/%PACKAGENAME%/g' -e 's/@version@/%VERSION%/g' -e 's/@grassversion@/%GRASS_VERSION%/g' postinstall-common.bat >%OSGEO4W_ROOT%\etc\postinstall\\%PACKAGENAME%-common.bat

sed -e 's/@package@/%PACKAGENAME%/g' -e 's/@version@/%VERSION%/g' -e 's/@grassversion@/%GRASS_VERSION%/g' postinstall-desktop.bat >%OSGEO4W_ROOT%\etc\postinstall\%PACKAGENAME%.bat
sed -e 's/@package@/%PACKAGENAME%/g' -e 's/@version@/%VERSION%/g' -e 's/@grassversion@/%GRASS_VERSION%/g' preremove-desktop.bat >%OSGEO4W_ROOT%\etc\preremove\%PACKAGENAME%.bat
sed -e 's/@package@/%PACKAGENAME%/g' -e 's/@version@/%VERSION%/g' -e 's/@grassversion@/%GRASS_VERSION%/g' qgis.bat.tmpl >%OSGEO4W_ROOT%\bin\%PACKAGENAME%.bat.tmpl
sed -e 's/@package@/%PACKAGENAME%/g' -e 's/@version@/%VERSION%/g' -e 's/@grassversion@/%GRASS_VERSION%/g' browser.bat.tmpl >%OSGEO4W_ROOT%\bin\%PACKAGENAME%-browser.bat.tmpl
sed -e 's/@package@/%PACKAGENAME%/g' -e 's/@version@/%VERSION%/g' -e 's/@grassversion@/%GRASS_VERSION%/g' qgis.reg.tmpl >%OSGEO4W_ROOT%\apps\%PACKAGENAME%\bin\qgis.reg.tmpl

sed -e 's/@package@/%PACKAGENAME%/g' -e 's/@version@/%VERSION%/g' -e 's/@grassversion@/%GRASS_VERSION%/g' postinstall-server.bat >%OSGEO4W_ROOT%\etc\postinstall\%PACKAGENAME%-server.bat
sed -e 's/@package@/%PACKAGENAME%/g' -e 's/@version@/%VERSION%/g' -e 's/@grassversion@/%GRASS_VERSION%/g' preremove-server.bat >%OSGEO4W_ROOT%\etc\preremove\%PACKAGENAME%-server.bat
sed -e 's/@package@/%PACKAGENAME%/g' -e 's/@version@/%VERSION%/g' -e 's/@grassversion@/%GRASS_VERSION%/g' httpd.conf.tmpl >%OSGEO4W_ROOT%\httpd.d\httpd_%PACKAGENAME%.conf.tmpl

REM sed -e 's/%OSGEO4W_ROOT:\=\\\\\\\\%/@osgeo4w@/' %OSGEO4W_ROOT%\apps\%PACKAGENAME%\python\qgis\qgisconfig.py >%OSGEO4W_ROOT%\apps\%PACKAGENAME%\python\qgis\qgisconfig.py.tmpl
REM if errorlevel 1 goto error

REM del %OSGEO4W_ROOT%\apps\%PACKAGENAME%\python\qgis\qgisconfig.py

touch exclude

tar -C %OSGEO4W_ROOT% -cjf %PACKAGENAME%-common-%VERSION%-%PACKAGE%.tar.bz2 ^
--exclude-from exclude ^
--exclude "*.pyc" ^
"apps/%PACKAGENAME%/bin/Microsoft.VC90.CRT.manifest" ^
"apps/%PACKAGENAME%/bin/msvcm90.dll" ^
"apps/%PACKAGENAME%/bin/msvcp90.dll" ^
"apps/%PACKAGENAME%/bin/msvcr90.dll" ^
"apps/%PACKAGENAME%/bin/qgispython.dll" ^
"apps/%PACKAGENAME%/bin/qgis_analysis.dll" ^
"apps/%PACKAGENAME%/bin/qgis_networkanalysis.dll" ^
"apps/%PACKAGENAME%/bin/qgis_core.dll" ^
"apps/%PACKAGENAME%/bin/qgis_gui.dll" ^
"apps/%PACKAGENAME%/doc/" ^
"apps/%PACKAGENAME%/plugins/delimitedtextprovider.dll" ^
"apps/%PACKAGENAME%/plugins/diagramoverlay.dll" ^
"apps/%PACKAGENAME%/plugins/gdalprovider.dll" ^
"apps/%PACKAGENAME%/plugins/gpxprovider.dll" ^
"apps/%PACKAGENAME%/plugins/memoryprovider.dll" ^
"apps/%PACKAGENAME%/plugins/ogrprovider.dll" ^
"apps/%PACKAGENAME%/plugins/osmprovider.dll" ^
"apps/%PACKAGENAME%/plugins/postgresprovider.dll" ^
"apps/%PACKAGENAME%/plugins/spatialiteprovider.dll" ^
"apps/%PACKAGENAME%/plugins/sqlanywhereprovider.dll" ^
"apps/%PACKAGENAME%/plugins/qgissqlanyconnection.dll" ^
"apps/%PACKAGENAME%/plugins/wfsprovider.dll" ^
"apps/%PACKAGENAME%/plugins/wmsprovider.dll" ^
"apps/%PACKAGENAME%/plugins/mssqlprovider.dll" ^
"apps/%PACKAGENAME%/resources/qgis.db" ^
"apps/%PACKAGENAME%/resources/spatialite.db" ^
"apps/%PACKAGENAME%/resources/srs.db" ^
"apps/%PACKAGENAME%/resources/symbology-ng-style.xml" ^
"apps/%PACKAGENAME%/svg/" ^
"apps/%PACKAGENAME%/crssync.exe" ^
"etc/postinstall/%PACKAGENAME%-common.bat" ^
>>%LOG% 2>&1
if errorlevel 1 goto error

tar -C %OSGEO4W_ROOT% -cjf %PACKAGENAME%-server-%VERSION%-%PACKAGE%.tar.bz2 ^
--exclude-from exclude ^
--exclude "*.pyc" ^
"apps/%PACKAGENAME%/bin/qgis_mapserv.fcgi.exe" ^
"apps/%PACKAGENAME%/bin/admin.sld" ^
"apps/%PACKAGENAME%/bin/wms_metadata.xml" ^
"httpd.d/httpd_%PACKAGENAME%.conf.tmpl" ^
"etc/postinstall/%PACKAGENAME%-server.bat" ^
"etc/preremove/%PACKAGENAME%-server.bat" ^
>>%LOG% 2>&1
if errorlevel 1 goto error

tar -C %OSGEO4W_ROOT% -cjf %PACKAGENAME%-%VERSION%-%PACKAGE%.tar.bz2 ^
--exclude-from exclude ^
--exclude "*.pyc" ^
--exclude "apps/%PACKAGENAME%/themes/classic/grass" ^
--exclude "apps/%PACKAGENAME%/themes/default/grass" ^
--exclude "apps/%PACKAGENAME%/themes/gis/grass" ^
--exclude "apps/%PACKAGENAME%/grass" ^
--exclude "apps/%PACKAGENAME%/bin/qgisgrass.dll" ^
--exclude "apps/%PACKAGENAME%/plugins/grassrasterprovider.dll" ^
--exclude "apps/%PACKAGENAME%/plugins/grassplugin.dll" ^
--exclude "apps/%PACKAGENAME%/plugins/grassprovider.dll" ^
--exclude "apps/%PACKAGENAME%/plugins/globeplugin.dll" ^
apps/%PACKAGENAME% ^
bin/%PACKAGENAME%.bat.tmpl ^
bin/%PACKAGENAME%-browser.bat.tmpl ^
etc/postinstall/%PACKAGENAME%.bat ^
etc/preremove/%PACKAGENAME%.bat ^
"apps/%PACKAGENAME%/bin/qbrowser.exe" ^
"apps/%PACKAGENAME%/bin/qgis.exe" ^
"apps/%PACKAGENAME%/bin/qgis.reg.tmpl" ^
"apps/%PACKAGENAME%/i18n/" ^
"apps/%PACKAGENAME%/icons/" ^
"apps/%PACKAGENAME%/images/" ^
"apps/%PACKAGENAME%/plugins/coordinatecaptureplugin.dll" ^
"apps/%PACKAGENAME%/plugins/delimitedtextplugin.dll" ^
"apps/%PACKAGENAME%/plugins/dxf2shpconverterplugin.dll" ^
"apps/%PACKAGENAME%/plugins/evis.dll" ^
"apps/%PACKAGENAME%/plugins/georefplugin.dll" ^
"apps/%PACKAGENAME%/plugins/gpsimporterplugin.dll" ^
"apps/%PACKAGENAME%/plugins/interpolationplugin.dll" ^
"apps/%PACKAGENAME%/plugins/offlineeditingplugin.dll" ^
"apps/%PACKAGENAME%/plugins/oracleplugin.dll" ^
"apps/%PACKAGENAME%/plugins/rasterterrainplugin.dll" ^
"apps/%PACKAGENAME%/plugins/roadgraphplugin.dll" ^
"apps/%PACKAGENAME%/plugins/spatialqueryplugin.dll" ^
"apps/%PACKAGENAME%/plugins/spitplugin.dll" ^
"apps/%PACKAGENAME%/plugins/sqlanywhereplugin.dll" ^
"apps/%PACKAGENAME%/plugins/zonalstatisticsplugin.dll" ^
"apps/%PACKAGENAME%/plugins/heatmapplugin.dll" ^
"apps/%PACKAGENAME%/qgis_help.exe" ^
"apps/%PACKAGENAME%/python/" ^
"apps/%PACKAGENAME%/resources/context_help/" ^
"apps/%PACKAGENAME%/resources/function_help/" ^
"apps/%PACKAGENAME%/resources/customization.xml" ^
"apps/%PACKAGENAME%/resources/qgis_help.db" ^
"bin/%PACKAGENAME%.bat.tmpl" ^
"bin/%PACKAGENAME%-browser.bat.tmpl" ^
"etc/postinstall/%PACKAGENAME%.bat" ^
"etc/preremove/%PACKAGENAME%.bat" ^
>>%LOG% 2>&1
if errorlevel 1 goto error

tar -C %OSGEO4W_ROOT% -cjf %PACKAGENAME%-grass-plugin-%VERSION%-%PACKAGE%.tar.bz2 ^
--exclude-from exclude ^
--exclude "*.pyc" ^
"apps/%PACKAGENAME%/themes/classic/grass" ^
"apps/%PACKAGENAME%/themes/default/grass" ^
"apps/%PACKAGENAME%/themes/gis/grass" ^
"apps/%PACKAGENAME%/grass" ^
"apps/%PACKAGENAME%/bin/qgisgrass.dll" ^
"apps/%PACKAGENAME%/plugins/grassrasterprovider.dll" ^
@@ -185,18 +256,33 @@ tar -C %OSGEO4W_ROOT% -cjf %PACKAGENAME%-grass-plugin-%VERSION%-%PACKAGE%.tar.bz
if errorlevel 1 goto error

tar -C %OSGEO4W_ROOT% -cjf %PACKAGENAME%-globe-plugin-%VERSION%-%PACKAGE%.tar.bz2 ^
--exclude-from exclude ^
--exclude "*.pyc" ^
"apps/%PACKAGENAME%/globe" ^
"apps/%PACKAGENAME%/plugins/globeplugin.dll" ^
>>%LOG% 2>&1
if errorlevel 1 goto error

tar -C %OSGEO4W_ROOT% -cjf %PACKAGENAME%-devel-%VERSION%-%PACKAGE%.tar.bz2 ^
--exclude-from exclude ^
--exclude "*.pyc" ^
"apps/%PACKAGENAME%/FindQGIS.cmake" ^
"apps/%PACKAGENAME%/include/" ^
"apps/%PACKAGENAME%/lib/" ^
>>%LOG% 2>&1
if errorlevel 1 goto error

goto end

:error
echo BUILD ERROR %ERRORLEVEL%: %DATE% %TIME%
echo BUILD ERROR %ERRORLEVEL%: %DATE% %TIME%>>%LOG% 2>&1
if exist %PACKAGENAME%-common-%VERSION%-%PACKAGE%.tar.bz2 del %PACKAGENAME%-common-%VERSION%-%PACKAGE%.tar.bz2
if exist %PACKAGENAME%-%VERSION%-%PACKAGE%.tar.bz2 del %PACKAGENAME%-%VERSION%-%PACKAGE%.tar.bz2
if exist %PACKAGENAME%-server-%VERSION%-%PACKAGE%.tar.bz2 del %PACKAGENAME%-server-%VERSION%-%PACKAGE%.tar.bz2
if exist %PACKAGENAME%-devel-%VERSION%-%PACKAGE%.tar.bz2 del %PACKAGENAME%-devel-%VERSION%-%PACKAGE%.tar.bz2
if exist %PACKAGENAME%-grass-plugin-%VERSION%-%PACKAGE%.tar.bz2 del %PACKAGENAME%-grass-plugin-%VERSION%-%PACKAGE%.tar.bz2
if exist %PACKAGENAME%-globe-plugin-%VERSION%-%PACKAGE%.tar.bz2 del %PACKAGENAME%-globe-plugin-%VERSION%-%PACKAGE%.tar.bz2

:end
echo FINISHED: %DATE% %TIME% >>%LOG% 2>&1
@@ -0,0 +1,4 @@
call "%OSGEO4W_ROOT%"\bin\o4w_env.bat
path %PATH%;%OSGEO4W_ROOT%\apps\@package@\bin
set QGIS_PREFIX_PATH=%OSGEO4W_ROOT%\apps\@package@
%OSGEO4W_ROOT%\apps\@package@\crssync
@@ -0,0 +1,13 @@
textreplace -std -t bin\@package@.bat
textreplace -std -t bin\@package@-browser.bat

mkdir "%OSGEO4W_STARTMENU%"
xxmklink "%OSGEO4W_STARTMENU%\Quantum GIS Desktop (@version@).lnk" "%OSGEO4W_ROOT%\bin\@package@.bat" " " \ "Quantum GIS - Desktop GIS (@version@)" 1 "%OSGEO4W_ROOT%\apps\@package@\icons\QGIS.ico"
xxmklink "%ALLUSERSPROFILE%\Desktop\Quantum GIS Desktop (@version@).lnk" "%OSGEO4W_ROOT%\bin\@package@.bat" " " \ "Quantum GIS - Desktop GIS (@version@)" 1 "%OSGEO4W_ROOT%\apps\@package@\icons\QGIS.ico"
xxmklink "%OSGEO4W_STARTMENU%\Quantum GIS Browser (@version@).lnk" "%OSGEO4W_ROOT%\bin\@package@-browser.bat" " " \ "Quantum GIS - Desktop GIS (@version@)" 1 "%OSGEO4W_ROOT%\apps\@package@\icons\QGIS.ico"
xxmklink "%ALLUSERSPROFILE%\Desktop\Quantum GIS Browser (@version@).lnk" "%OSGEO4W_ROOT%\bin\@package@-browser.bat" " " \ "Quantum GIS - Desktop GIS (@version@)" 1 "%OSGEO4W_ROOT%\apps\@package@\icons\QGIS.ico"

set O4W_ROOT=%OSGEO4W_ROOT%
set OSGEO4W_ROOT=%OSGEO4W_ROOT:\=\\%
textreplace -std -t "%O4W_ROOT%\apps\@package@\bin\qgis.reg"
"%WINDIR%\regedit" /s "%O4W_ROOT%\apps\@package@\bin\qgis.reg"
@@ -0,0 +1,5 @@
textreplace -std ^
-map @windir@ "%WINDIR%" ^
-map @temp@ "%TEMP%" ^
-t httpd.d\httpd_@package@.conf
del httpd.d\httpd_@package@.conf.tmpl

This file was deleted.

File renamed without changes.
@@ -0,0 +1 @@
del "%OSGEO4W_ROOT%"\httpd.d\httpd_@package@.conf
@@ -12,7 +12,17 @@ TARGET_LINK_LIBRARIES(crssync
${GDAL_LIBRARY}
)

ADD_CUSTOM_TARGET(synccrsdb COMMAND crssync)
IF(MSVC)
ADD_CUSTOM_TARGET(synccrsdb
COMMAND ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE}/crssync.exe
DEPENDS crssync
)
ELSE(MSVC)
ADD_CUSTOM_TARGET(synccrsdb
COMMAND ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/crssync
DEPENDS crssync
)
ENDIF(MSVC)

INSTALL(CODE "MESSAGE(\"Installing crssync ...\")")
INSTALL(TARGETS crssync RUNTIME DESTINATION ${QGIS_LIBEXEC_DIR})
@@ -41,7 +41,10 @@ int main( int argc, char ** argv )
QgsApplication a( argc, argv, false );

if ( !QgsApplication::isRunningFromBuildDir() )
a.setPrefixPath( CMAKE_INSTALL_PREFIX, true );
{
char *prefixPath = getenv( "QGIS_PREFIX_PATH" );
a.setPrefixPath( prefixPath ? prefixPath : CMAKE_INSTALL_PREFIX, true );
}

std::cout << "Synchronizing CRS database with PROJ definitions." << std::endl;

0 comments on commit c64bb9d

Please sign in to comment.
You can’t perform that action at this time.