Skip to content
Permalink
Browse files

GRASS 6/7 build fixes:

* fix build on windows
* fix grass build on precise (using cmake <2.8.8, ie. without INCLUDE_DIRECTORIES target property)
* support desktop & browser shortcut for GRASS 6/7 in OSGeo4W nightly build
  • Loading branch information
jef-n committed Apr 10, 2015
1 parent 5aaa125 commit 721933628b5221fe2f28b0a66a5b83257e1ba205
@@ -51,6 +51,7 @@ CMAKE_OPTS := \
-DWITH_QSPATIALITE=TRUE \
-DWITH_SERVER=TRUE \
-DWITH_SERVER_PLUGINS=TRUE \
-DWITH_GRASS7=FALSE \
-DSERVER_SKIP_ECW=TRUE \
-DQGIS_CGIBIN_SUBDIR=/usr/lib/cgi-bin \
-DWITH_APIDOC=TRUE \
@@ -1,6 +1,6 @@
@echo off
call "%~dp0\o4w_env.bat"
path %OSGEO4W_ROOT%\apps\@package@\bin;%OSGEO4W_ROOT%\apps\grass\grass-@grassversion@\lib;%PATH%
path %OSGEO4W_ROOT%\apps\@package@\bin;%PATH%
set QGIS_PREFIX_PATH=%OSGEO4W_ROOT:\=/%/apps/@package@
set QT_PLUGIN_PATH=%OSGEO4W_ROOT%\apps\@package@\qtplugins;%OSGEO4W_ROOT%\apps\qt4\plugins
start "Qt Designer with QGIS custom widgets" /B "%OSGEO4W_ROOT%"\bin\designer.exe %*
@@ -49,7 +49,7 @@ if "%ARCH%"=="x86" goto devenv_x86
goto devenv_x86_64

:devenv_x86
set GRASS_VERSION=6.4.4
set GRASS_VERSIONS=6.4.4 7.0.0
call "%PF86%\Microsoft Visual Studio 10.0\VC\vcvarsall.bat" x86
if exist "c:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.Cmd" call "c:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.Cmd" /x86 /Release
path %path%;%PF86%\Microsoft Visual Studio 10.0\VC\bin
@@ -59,12 +59,16 @@ set CMAKE_OPT=^
-D BUILDNAME="OSGeo4W-Nightly-VC10-32" ^
-D SIP_BINARY_PATH=%O4W_ROOT%/apps/Python27/sip.exe ^
-D QWT_LIBRARY=%O4W_ROOT%/lib/qwt.lib ^
-D WITH_GRASS6=TRUE ^
-D WITH_GRASS7=TRUE ^
-D GRASS_PREFIX=%O4W_ROOT%/apps/grass/grass-6.4.4 ^
-D GRASS_PREFIX7=%O4W_ROOT%/apps/grass/grass-7.0.0 ^
-D CMAKE_CXX_FLAGS_RELWITHDEBINFO="/MD /ZI /MP /Od /D NDEBUG /D QGISDEBUG" ^
-D CMAKE_PDB_OUTPUT_DIRECTORY_RELWITHDEBINFO=%BUILDDIR%\apps\%PACKAGENAME%\pdb
goto devenv

:devenv_x86_64
set GRASS_VERSION=6.4.3
set GRASS_VERSIONS=6.4.3
call "%PF86%\Microsoft Visual Studio 10.0\VC\vcvarsall.bat" amd64
if exist "c:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.Cmd" call "c:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.Cmd" /x64 /Release
path %path%;%PF86%\Microsoft Visual Studio 10.0\VC\bin
@@ -77,6 +81,9 @@ set CMAKE_OPT=^
-G "Visual Studio 10 Win64" ^
-D BUILDNAME="OSGeo4W-Nightly-VC10-64" ^
-D SPATIALINDEX_LIBRARY=%O4W_ROOT%/lib/spatialindex-64.lib ^
-D WITH_GRASS6=TRUE ^
-D WITH_GRASS7=FALSE ^
-D GRASS_PREFIX=%O4W_ROOT%/apps/grass/grass-6.4.3 ^
-D SIP_BINARY_PATH=%O4W_ROOT%/bin/sip.exe ^
-D QWT_LIBRARY=%O4W_ROOT%/lib/qwt5.lib ^
-D CMAKE_CXX_FLAGS_RELWITHDEBINFO="/MD /Zi /MP /Od /D NDEBUG /D QGISDEBUG" ^
@@ -98,6 +105,8 @@ set SRCDIR=%CD%
if "%BUILDDIR:~1,1%"==":" %BUILDDIR:~0,2%
cd %BUILDDIR%

set PKGDIR=%OSGEO4W_ROOT%\apps\%PACKAGENAME%

if exist repackage goto package

if not exist build.log goto build
@@ -138,7 +147,6 @@ if errorlevel 1 goto error

set LIB=%LIB%;%OSGEO4W_ROOT%\lib
set INCLUDE=%INCLUDE%;%OSGEO4W_ROOT%\include
set GRASS_PREFIX=%O4W_ROOT%/apps/grass/grass-%GRASS_VERSION%

cmake %CMAKE_OPT% ^
-D SITE="qgis.org" ^
@@ -150,7 +158,6 @@ cmake %CMAKE_OPT% ^
-D WITH_GLOBE=TRUE ^
-D WITH_TOUCH=TRUE ^
-D WITH_ORACLE=TRUE ^
-D WITH_GRASS=TRUE ^
-D WITH_CUSTOM_WIDGETS=TRUE ^
-D CMAKE_BUILD_TYPE=%BUILDCONF% ^
-D CMAKE_CONFIGURATION_TYPES=%BUILDCONF% ^
@@ -194,8 +201,6 @@ if not exist ..\skiptests (
if errorlevel 1 echo TESTS WERE NOT SUCCESSFUL.
)

set PKGDIR=%OSGEO4W_ROOT%\apps\%PACKAGENAME%

if exist %PKGDIR% (
echo REMOVE: %DATE% %TIME%
rmdir /s /q %PKGDIR%
@@ -209,19 +214,25 @@ if errorlevel 1 (echo INSTALL failed & goto error)
echo PACKAGE: %DATE% %TIME%

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

sed -e 's/@package@/%PACKAGENAME%/g' -e 's/@version@/%VERSION%/g' -e 's/@grassversions@/%GRASS_VERSIONS%/g' postinstall-dev.bat >%OSGEO4W_ROOT%\etc\postinstall\%PACKAGENAME%.bat
if errorlevel 1 (echo creation of desktop postinstall failed & goto error)
sed -e 's/@package@/%PACKAGENAME%/g' -e 's/@version@/%VERSION%/g' -e 's/@grassversion@/%GRASS_VERSION%/g' preremove-dev.bat >%OSGEO4W_ROOT%\etc\preremove\%PACKAGENAME%.bat
sed -e 's/@package@/%PACKAGENAME%/g' -e 's/@version@/%VERSION%/g' -e 's/@grassversions@/%GRASS_VERSIONS%/g' preremove-dev.bat >%OSGEO4W_ROOT%\etc\preremove\%PACKAGENAME%.bat
if errorlevel 1 (echo creation of desktop preremove failed & goto error)
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
if errorlevel 1 (echo creation of desktop template failed & goto error)
sed -e 's/@package@/%PACKAGENAME%/g' -e 's/@version@/%VERSION%/g' -e 's/@grassversion@/%GRASS_VERSION%/g' designer-qgis.bat.tmpl >%OSGEO4W_ROOT%\bin\designer-%PACKAGENAME%.bat.tmpl

sed -e 's/@package@/%PACKAGENAME%/g' -e 's/@version@/%VERSION%/g' designer-qgis.bat.tmpl >%OSGEO4W_ROOT%\bin\designer-%PACKAGENAME%.bat.tmpl
if errorlevel 1 (echo creation of designer template failed & goto error)
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
if errorlevel 1 (echo creation of browser template & goto error)
sed -e 's/@package@/%PACKAGENAME%/g' -e 's/@version@/%VERSION%/g' -e 's/@grassversion@/%GRASS_VERSION%/g' qgis.reg.tmpl >%PKGDIR%\bin\qgis.reg.tmpl
sed -e 's/@package@/%PACKAGENAME%/g' -e 's/@version@/%VERSION%/g' qgis.reg.tmpl >%PKGDIR%\bin\qgis.reg.tmpl
if errorlevel 1 (echo creation of registry template & goto error)

for %%g IN (%GRASS_VERSIONS%) do (
sed -e 's/@package@/%PACKAGENAME%/g' -e 's/@version@/%VERSION%/g' -e 's/@grassversion@/%%g/g' qgis.bat.tmpl >%OSGEO4W_ROOT%\bin\%PACKAGENAME%-g%%g.bat.tmpl
if errorlevel 1 (echo creation of desktop template failed & goto error)
sed -e 's/@package@/%PACKAGENAME%/g' -e 's/@version@/%VERSION%/g' -e 's/@grassversion@/%%g/g' browser.bat.tmpl >%OSGEO4W_ROOT%\bin\%PACKAGENAME%-browser-g%%g.bat.tmpl
if errorlevel 1 (echo creation of browser template & goto error)
)


REM sed -e 's/%OSGEO4W_ROOT:\=\\\\\\\\%/@osgeo4w@/' %PKGDIR%\python\qgis\qgisconfig.py >%PKGDIR%\python\qgis\qgisconfig.py.tmpl
REM if errorlevel 1 (echo creation of qgisconfig.py.tmpl failed & goto error)

@@ -1,14 +1,18 @@
textreplace -std -t bin\@package@.bat
textreplace -std -t bin\@package@-browser.bat
textreplace -std -t bin\designer-@package@.bat

if not %OSGEO4W_MENU_LINKS%==0 mkdir "%OSGEO4W_STARTMENU%"
if not %OSGEO4W_MENU_LINKS%==0 nircmd shortcut "%OSGEO4W_ROOT%\bin\nircmd.exe" "%OSGEO4W_STARTMENU%" "QGIS Desktop @version@ (Nightly)" "exec hide """%OSGEO4W_ROOT%\bin\@package@.bat"" "%OSGEO4W_ROOT%\apps\@package@\icons\QGIS.ico"
if not %OSGEO4W_MENU_LINKS%==0 nircmd shortcut "%OSGEO4W_ROOT%\bin\nircmd.exe" "%OSGEO4W_STARTMENU%" "QGIS Browser @version@ (Nightly)" "exec hide """%OSGEO4W_ROOT%\bin\@package@-browser.bat"" "%OSGEO4W_ROOT%\apps\@package@\icons\QGIS.ico"
if not %OSGEO4W_MENU_LINKS%==0 nircmd shortcut "%OSGEO4W_ROOT%\bin\nircmd.exe" "%OSGEO4W_STARTMENU%" "Qt Designer with QGIS @version@ custom widgets (Nightly)" "exec hide """%OSGEO4W_ROOT%\bin\designer-@package@.bat"" "%OSGEO4W_ROOT%\apps\@package@\icons\QGIS.ico"
for %%g in (@grassversions@) do (
textreplace -std -t bin\@package@-g%%g.bat
textreplace -std -t bin\@package@-browser-g%%g.bat

if not %OSGEO4W_MENU_LINKS%==0 mkdir "%OSGEO4W_STARTMENU%"
if not %OSGEO4W_MENU_LINKS%==0 nircmd shortcut "%OSGEO4W_ROOT%\bin\nircmd.exe" "%OSGEO4W_STARTMENU%" "QGIS Desktop @version@ with GRASS %%g (Nightly)" "exec hide """%OSGEO4W_ROOT%\bin\@package@-g%%g.bat"" "%OSGEO4W_ROOT%\apps\@package@\icons\QGIS.ico"
if not %OSGEO4W_MENU_LINKS%==0 nircmd shortcut "%OSGEO4W_ROOT%\bin\nircmd.exe" "%OSGEO4W_STARTMENU%" "QGIS Browser @version@ with GRASS %%g (Nightly)" "exec hide """%OSGEO4W_ROOT%\bin\@package@-browser-g%%g.bat"" "%OSGEO4W_ROOT%\apps\@package@\icons\QGIS.ico"

if not %OSGEO4W_DESKTOP_LINKS%==0 nircmd shortcut "%OSGEO4W_ROOT%\bin\nircmd.exe" "~$folder.desktop$" "QGIS Desktop @version@ (Nightly)" "exec hide """%OSGEO4W_ROOT%\bin\@package@.bat"" "%OSGEO4W_ROOT%\apps\@package@\icons\QGIS.ico"
if not %OSGEO4W_DESKTOP_LINKS%==0 nircmd shortcut "%OSGEO4W_ROOT%\bin\nircmd.exe" "~$folder.desktop$" "QGIS Browser @version@ (Nightly)" "exec hide """%OSGEO4W_ROOT%\bin\@package@-browser.bat"" "%OSGEO4W_ROOT%\apps\@package@\icons\QGIS.ico"
if not %OSGEO4W_DESKTOP_LINKS%==0 nircmd shortcut "%OSGEO4W_ROOT%\bin\nircmd.exe" "~$folder.desktop$" "QGIS Desktop @version@ with GRASS %%g (Nightly)" "exec hide """%OSGEO4W_ROOT%\bin\@package@-g%%g.bat"" "%OSGEO4W_ROOT%\apps\@package@\icons\QGIS.ico"
if not %OSGEO4W_DESKTOP_LINKS%==0 nircmd shortcut "%OSGEO4W_ROOT%\bin\nircmd.exe" "~$folder.desktop$" "QGIS Browser @version@ with GRASS %%g (Nightly)" "exec hide """%OSGEO4W_ROOT%\bin\@package@-browser-g%%g.bat"" "%OSGEO4W_ROOT%\apps\@package@\icons\QGIS.ico"
)

if not %OSGEO4W_MENU_LINKS%==0 nircmd shortcut "%OSGEO4W_ROOT%\bin\nircmd.exe" "%OSGEO4W_STARTMENU%" "Qt Designer with QGIS @version@ custom widgets (Nightly)" "exec hide """%OSGEO4W_ROOT%\bin\designer-@package@.bat"" "%OSGEO4W_ROOT%\apps\@package@\icons\QGIS.ico"
if not %OSGEO4W_DESKTOP_LINKS%==0 nircmd shortcut "%OSGEO4W_ROOT%\bin\nircmd.exe" "~$folder.desktop$" "Qt Designer with QGIS @version@ custom widgets (Nightly)" "exec hide """%OSGEO4W_ROOT%\bin\designer-@package@.bat"" "%OSGEO4W_ROOT%\apps\@package@\icons\QGIS.ico"

set O4W_ROOT=%OSGEO4W_ROOT%
@@ -1,11 +1,15 @@
del "%OSGEO4W_STARTMENU%\QGIS Desktop @version@ (Nightly).lnk"
del "%OSGEO4W_STARTMENU%\QGIS Browser @version@ (Nightly).lnk"
for %%g in (@grassversions@) do (
del "%OSGEO4W_STARTMENU%\QGIS Desktop @version@ with GRASS %%g (Nightly).lnk"
del "%OSGEO4W_STARTMENU%\QGIS Browser @version@ with GRASS %%g (Nightly).lnk"
del "%ALLUSERSPROFILE%\Desktop\QGIS Desktop @version@ with GRASS %%g (Nightly).lnk"
del "%ALLUSERSPROFILE%\Desktop\QGIS Browser @version@ with GRASS %%g (Nightly).lnk"
del "%OSGEO4W_ROOT%"\bin\@package@-g%%g.bat
del "%OSGEO4W_ROOT%"\bin\@package@-browser-g%%g.bat
)

del "%OSGEO4W_STARTMENU%\Qt Designer with QGIS @version@ custom widgets (Nightly).lnk"
del "%ALLUSERSPROFILE%\Desktop\QGIS Desktop @version@ (Nightly).lnk"
del "%ALLUSERSPROFILE%\Desktop\QGIS Browser @version@ (Nightly).lnk"
del "%ALLUSERSPROFILE%\Desktop\Qt Designer with QGIS @version@ custom widgets (Nightly).lnk"
del "%OSGEO4W_ROOT%"\bin\@package@.bat
del "%OSGEO4W_ROOT%"\bin\@package@-browser.bat

del "%OSGEO4W_ROOT%"\bin\designer-@package@.bat
del "%OSGEO4W_ROOT%"\apps\@package@\python\qgis\qgisconfig.py
del "%OSGEO4W_ROOT%"\apps\@package@\bin\qgis.reg
@@ -21,7 +21,7 @@
#include "ui_qgsjoindialogbase.h"

class QgsVectorLayer;
class QgsVectorJoinInfo;
struct QgsVectorJoinInfo;

class APP_EXPORT QgsJoinDialog: public QDialog, private Ui::QgsJoinDialogBase
{
@@ -0,0 +1,2 @@
INCLUDE_DIRECTORIES(${GRASS_INCLUDE_DIR} ${CMAKE_CURRENT_BINARY_DIR})
ADD_GRASSPLUGIN(6)
@@ -0,0 +1,2 @@
INCLUDE_DIRECTORIES(${GRASS_INCLUDE_DIR7} ${CMAKE_CURRENT_BINARY_DIR})
ADD_GRASSPLUGIN(7)

0 comments on commit 7219336

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