Skip to content
Permalink
Browse files

osgeo4w: also provider wrapper for browser (followup 801184a)

  • Loading branch information
jef-n committed Feb 19, 2017
1 parent 0d1ab70 commit caaa68bb2de3153d704f47f8dd9058134c2a1f0f
@@ -298,6 +298,8 @@ copy qgis.vars %OSGEO4W_ROOT%\bin\%PACKAGENAME%-bin.vars
if errorlevel 1 (echo copy of desktop executable vars failed & goto error)
move %PKGDIR%\bin\qbrowser.exe %OSGEO4W_ROOT%\bin\%PACKAGENAME%-browser-bin.exe
if errorlevel 1 (echo move of browser executable failed & goto error)
copy qgis.vars %OSGEO4W_ROOT%\bin\%PACKAGENAME%-browser-bin.vars
if errorlevel 1 (echo copy of browser executable vars failed & goto error)

if not exist %PKGDIR%\qtplugins\sqldrivers mkdir %PKGDIR%\qtplugins\sqldrivers
move %OSGEO4W_ROOT%\apps\qt5\plugins\sqldrivers\qsqlocispatial.dll %PKGDIR%\qtplugins\sqldrivers
@@ -360,6 +360,8 @@ copy qgis.vars %OSGEO4W_ROOT%\bin\%PACKAGENAME%-bin.vars
if errorlevel 1 (echo copy of desktop executable vars failed & goto error)
move %PKGDIR%\bin\qbrowser.exe %OSGEO4W_ROOT%\bin\%PACKAGENAME%-browser-bin.exe
if errorlevel 1 (echo move of browser executable failed & goto error)
copy qgis.vars %OSGEO4W_ROOT%\bin\%PACKAGENAME%-browser-bin.vars
if errorlevel 1 (echo copy of browser executable vars failed & goto error)

if not exist %PKGDIR%\qtplugins\sqldrivers mkdir %PKGDIR%\qtplugins\sqldrivers
move %OSGEO4W_ROOT%\apps\qt5\plugins\sqldrivers\qsqlocispatial.dll %PKGDIR%\qtplugins\sqldrivers
@@ -383,9 +385,12 @@ tar -C %OSGEO4W_ROOT% -cjf %ARCH%/release/qgis/%PACKAGENAME%/%PACKAGENAME%-%VERS
--exclude "apps/%PACKAGENAME%/python/qgis/_server.lib" ^
--exclude "apps/%PACKAGENAME%/python/qgis/server" ^
"bin/%PACKAGENAME%-browser-bin.exe" ^
"bin/%PACKAGENAME%-browser-bin.vars" ^
"bin/%PACKAGENAME%-bin.exe" ^
"bin/%PACKAGENAME%-bin.vars" ^
"bin/python-%PACKAGENAME%.bat.tmpl" ^
"apps/%PACKAGENAME%/bin/qgis_app.dll" ^
"apps/%PACKAGENAME%/bin/qgis_browser.dll" ^
"apps/%PACKAGENAME%/bin/qgis.reg.tmpl" ^
"apps/%PACKAGENAME%/i18n/" ^
"apps/%PACKAGENAME%/icons/" ^
@@ -8,15 +8,16 @@ for %%i in ("%OSGEO4W_ROOT%") do set O4W_ROOT=%%~fsi
if "%OSGEO4W_DESKTOP%"=="" set OSGEO4W_DESKTOP=~$folder.common_desktop$

"%OSGEO4W_ROOT%\bin\@package@.bat" --exit
"%OSGEO4W_ROOT%\bin\@package@-browser.bat" --exit

if not %OSGEO4W_MENU_LINKS%==0 mkdir "%OSGEO4W_STARTMENU%"
if not %OSGEO4W_DESKTOP_LINKS%==0 mkdir "%OSGEO4W_DESKTOP%"

if not %OSGEO4W_MENU_LINKS%==0 nircmd shortcut "%O4W_ROOT%\bin\@package@-bin.exe" "%OSGEO4W_STARTMENU%" "QGIS Desktop @version@"
if not %OSGEO4W_DESKTOP_LINKS%==0 nircmd shortcut "%O4W_ROOT%\bin\package@-bin.exe" "%OSGEO4W_DESKTOP%" "QGIS Desktop @version@"

if not %OSGEO4W_MENU_LINKS%==0 nircmd shortcut "%O4W_ROOT%\bin\nircmd.exe" "%OSGEO4W_STARTMENU%" "QGIS Browser @version@" "exec hide %O4W_ROOT%\bin\@package@-browser.bat" "%O4W_ROOT%\apps\@package@\icons\browser.ico"
if not %OSGEO4W_DESKTOP_LINKS%==0 nircmd shortcut "%O4W_ROOT%\bin\nircmd.exe" "%OSGEO4W_DESKTOP%" "QGIS Browser @version@" "exec hide %O4W_ROOT%\bin\@package@-browser.bat" "%O4W_ROOT%\apps\@package@\icons\browser.ico"
if not %OSGEO4W_MENU_LINKS%==0 nircmd shortcut "%O4W_ROOT%\bin\@package@-browser-bin.exe" "%OSGEO4W_STARTMENU%" "QGIS Browser @version@"
if not %OSGEO4W_DESKTOP_LINKS%==0 nircmd shortcut "%O4W_ROOT%\bin\@package@-browser-bin.exe" "%OSGEO4W_DESKTOP%" "QGIS Browser @version@"

if not %OSGEO4W_MENU_LINKS%==0 nircmd shortcut "%O4W_ROOT%\bin\nircmd.exe" "%OSGEO4W_STARTMENU%" "Qt Designer with QGIS @version@ custom widgets" "exec hide """%OSGEO4W_ROOT%\bin\@package@-designer.bat"" "%O4W_ROOT%\apps\@package@\icons\QGIS.ico"
if not %OSGEO4W_DESKTOP_LINKS%==0 nircmd shortcut "%O4W_ROOT%\bin\nircmd.exe" "%OSGEO4W_DESKTOP%" "Qt Designer with QGIS @version@ custom widgets" "exec hide %O4W_ROOT%\bin\@package@-designer.bat" "%O4W_ROOT%\apps\@package@\icons\QGIS.ico"
@@ -7,20 +7,21 @@ if not %OSGEO4W_MENU_LINKS%==0 mkdir "%OSGEO4W_STARTMENU%"
if not %OSGEO4W_DESKTOP_LINKS%==0 mkdir "%OSGEO4W_DESKTOP%"

for %%g in (@grassversions@) do (
textreplace -std -t bin\@package@-g%%g.bat

REM copy executable so we have one (now small) executable for each environment
REM and call it to produce .env from .vars
copy "%OSGEO4W_ROOT%\bin\@package@-bin.exe" "%OSGEO4W_ROOT%\bin\@package@-bin-g%%g.exe"
copy "%OSGEO4W_ROOT%\bin\@package@-bin.vars" "%OSGEO4W_ROOT%\bin\@package@-bin-g%%g.vars"
textreplace -std -t bin\@package@-g%%g.bat
"%OSGEO4W_ROOT%\bin\@package@-g%%g.bat" --exit

if not %OSGEO4W_MENU_LINKS%==0 nircmd shortcut "%OSGEO4W_ROOT%\bin\@package@-bin-g%%g.exe" "%OSGEO4W_STARTMENU%" "QGIS Desktop @version@ with GRASS %%g (Nightly)"
if not %OSGEO4W_DESKTOP_LINKS%==0 nircmd shortcut "%OSGEO4W_ROOT%\bin\@package@-bin-g%%g.exe" "%OSGEO4W_DESKTOP%" "QGIS Desktop @version@ with GRASS %%g (Nightly)"

copy "%OSGEO4W_ROOT%\bin\@package@-browser-bin.exe" "%OSGEO4W_ROOT%\bin\@package@-browser-bin-g%%g.exe"
copy "%OSGEO4W_ROOT%\bin\@package@-bin.vars" "%OSGEO4W_ROOT%\bin\@package@-browser-bin-g%%g.vars"
textreplace -std -t bin\@package@-browser-g%%g.bat
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\browser.ico"
if not %OSGEO4W_DESKTOP_LINKS%==0 nircmd shortcut "%OSGEO4W_ROOT%\bin\nircmd.exe" "%OSGEO4W_DESKTOP%" "QGIS Browser @version@ with GRASS %%g (Nightly)" "exec hide """%OSGEO4W_ROOT%\bin\@package@-browser-g%%g.bat"" "%OSGEO4W_ROOT%\apps\@package@\icons\browser.ico"
"%OSGEO4W_ROOT%\bin\@package@-browser-g%%g.bat" --exit

if not %OSGEO4W_MENU_LINKS%==0 nircmd shortcut "%OSGEO4W_ROOT%\bin\@package@-browser-bin-g%%g.exe" "%OSGEO4W_STARTMENU%" "QGIS Browser @version@ with GRASS %%g (Nightly)"
if not %OSGEO4W_DESKTOP_LINKS%==0 nircmd shortcut "%OSGEO4W_ROOT%\bin\@package@-browser-bin-g%%g.exe" "%OSGEO4W_DESKTOP%" "QGIS Browser @version@ with GRASS %%g (Nightly)"
)

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\@package@-designer.bat"" "%OSGEO4W_ROOT%\apps\@package@\icons\QGIS.ico"
@@ -10,6 +10,8 @@ del "%OSGEO4W_ROOT%\bin\@package@.bat"
del "%OSGEO4W_ROOT%\bin\@package@-bin.vars"
del "%OSGEO4W_ROOT%\bin\@package@-bin.env"
del "%OSGEO4W_ROOT%\bin\@package@-browser.bat"
del "%OSGEO4W_ROOT%\bin\@package@-browser-bin.vars"
del "%OSGEO4W_ROOT%\bin\@package@-browser-bin.env"
del "%OSGEO4W_ROOT%\bin\@package@-designer.bat"
del "%OSGEO4W_ROOT%\apps\@package@\python\qgis\qgisconfig.py"
del "%OSGEO4W_ROOT%\apps\@package@\bin\qgis.reg"
@@ -8,6 +8,9 @@ for %%g in (@grassversions@) do (
del "%OSGEO4W_ROOT%\bin\@package@-bin-g%%g.env"
del "%OSGEO4W_ROOT%\bin\@package@-bin-g%%g.vars"
del "%OSGEO4W_ROOT%\bin\@package@-browser-g%%g.bat"
del "%OSGEO4W_ROOT%\bin\@package@-browser-bin-g%%g.exe"
del "%OSGEO4W_ROOT%\bin\@package@-browser-bin-g%%g.env"
del "%OSGEO4W_ROOT%\bin\@package@-browser-bin-g%%g.vars"
)

del "%OSGEO4W_STARTMENU%\Qt Designer with QGIS @version@ custom widgets (Nightly).lnk"
@@ -16,6 +19,7 @@ del "%OSGEO4W_DESKTOP%\Qt Designer with QGIS @version@ custom widgets (Nightly).
rmdir "%OSGEO4W_DESKTOP%"

del "%OSGEO4W_ROOT%\bin\@package@-bin.env"
del "%OSGEO4W_ROOT%\bin\@package@-browser-bin.env"
del "%OSGEO4W_ROOT%\bin\@package@-designer.bat"
del "%OSGEO4W_ROOT%\bin\python-@package@.bat"
del "%OSGEO4W_ROOT%\apps\@package@\python\qgis\qgisconfig.py"
@@ -481,6 +481,7 @@ IF (WIN32)

SET (QGIS_APP_SRCS ${QGIS_APP_SRCS} main.cpp ${IMAGE_RCC_SRCS} ${TEST_RCC_SRCS})
SET (QGIS_APPMAIN_SRCS mainwin.cpp)
SET_SOURCE_FILES_PROPERTIES(mainwin.cpp PROPERTIES COMPILE_FLAGS -DMAINWIN_DLL=\\\"qgis_app.dll\\\")

IF (MSVC)
SET (QGIS_APPMAIN_SRCS ${QGIS_APPMAIN_SRCS} ${CMAKE_CURRENT_SOURCE_DIR}/qgis_win32.rc)
@@ -104,10 +104,10 @@ int CALLBACK WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdL
}
}

HINSTANCE hGetProcIDDLL = LoadLibrary( "qgis_app.dll" );
HINSTANCE hGetProcIDDLL = LoadLibrary( MAINWIN_DLL );
if ( !hGetProcIDDLL )
{
std::cerr << "Could not load the qgis_app.dll" << std::endl;
std::cerr << "Could not load the " MAINWIN_DLL << std::endl;
return EXIT_FAILURE;
}

@@ -52,7 +52,15 @@ QT5_WRAP_CPP (BROWSER_MOC_SRCS ${BROWSER_MOC_HDRS})
QT5_ADD_RESOURCES(IMAGE_RCC_SRCS ${IMAGE_RCCS})
#QT5_ADD_RESOURCES(BROWSER_RCC_SRCS ${BROWSER_RCCS})

ADD_EXECUTABLE (qbrowser MACOSX_BUNDLE WIN32 ${BROWSER_SRCS} ${BROWSER_MOC_SRCS} ${BROWSER_UIS_H} ${IMAGE_RCC_SRCS})
IF(WIN32)
SET(BROWSER_TARGET qgis_browser)
ADD_LIBRARY(${BROWSER_TARGET} SHARED ${BROWSER_SRCS} ${BROWSER_MOC_SRCS} ${BROWSER_UIS_H} ${IMAGE_RCC_SRCS})
ADD_EXECUTABLE(qbrowser WIN32 ../app/mainwin.cpp)
SET_SOURCE_FILES_PROPERTIES(../app/mainwin.cpp PROPERTIES COMPILE_FLAGS -DMAINWIN_DLL=\\\"qgis_browser.dll\\\")
ELSE(WIN32)
SET(BROWSER_TARGET qbrowser)
ADD_EXECUTABLE (qbrowser MACOSX_BUNDLE ${BROWSER_SRCS} ${BROWSER_MOC_SRCS} ${BROWSER_UIS_H} ${IMAGE_RCC_SRCS})
ENDIF(WIN32)

INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/../core
@@ -74,7 +82,7 @@ INCLUDE_DIRECTORIES(SYSTEM
${SQLITE3_INCLUDE_DIR}
)

TARGET_LINK_LIBRARIES(qbrowser
TARGET_LINK_LIBRARIES(${BROWSER_TARGET}
qgis_core
qgis_gui
${QT_QTCORE_LIBRARY}
@@ -87,22 +95,29 @@ TARGET_LINK_LIBRARIES(qbrowser
)

IF(APPLE)
SET_TARGET_PROPERTIES(qbrowser PROPERTIES
SET_TARGET_PROPERTIES(${BROWSER_TARGET} PROPERTIES
INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}/${QGIS_LIB_DIR}
INSTALL_RPATH_USE_LINK_PATH true
MACOSX_BUNDLE_INFO_PLIST "${CMAKE_SOURCE_DIR}/mac/browser.info.plist.in"
OUTPUT_NAME "QGIS Browser"
)
ENDIF(APPLE)

IF(MSVC)
INSTALL(FILES browser.ico DESTINATION ${CMAKE_INSTALL_PREFIX}/icons)
ENDIF(MSVC)
IF(WIN32)
IF(MSVC)
INSTALL(FILES browser.ico DESTINATION ${CMAKE_INSTALL_PREFIX}/icons)
ENDIF(MSVC)

INSTALL (TARGETS qbrowser
BUNDLE DESTINATION ${QGIS_BIN_DIR}
RUNTIME DESTINATION ${QGIS_BIN_DIR}
)
ENDIF(WIN32)

########################################################
# Install

INSTALL (TARGETS qbrowser
INSTALL (TARGETS ${BROWSER_TARGET}
BUNDLE DESTINATION ${QGIS_BIN_DIR}
RUNTIME DESTINATION ${QGIS_BIN_DIR}
)
@@ -31,6 +31,9 @@

#include "qgseditorwidgetregistry.h"

#ifdef Q_OS_WIN
__declspec( dllexport )
#endif
int main( int argc, char ** argv )
{
QSettings settings;

0 comments on commit caaa68b

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