Skip to content

Commit caaa68b

Browse files
committed
osgeo4w: also provider wrapper for browser (followup 801184a)
1 parent 0d1ab70 commit caaa68b

File tree

10 files changed

+51
-17
lines changed

10 files changed

+51
-17
lines changed

ms-windows/osgeo4w/package-nightly.cmd

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,8 @@ copy qgis.vars %OSGEO4W_ROOT%\bin\%PACKAGENAME%-bin.vars
298298
if errorlevel 1 (echo copy of desktop executable vars failed & goto error)
299299
move %PKGDIR%\bin\qbrowser.exe %OSGEO4W_ROOT%\bin\%PACKAGENAME%-browser-bin.exe
300300
if errorlevel 1 (echo move of browser executable failed & goto error)
301+
copy qgis.vars %OSGEO4W_ROOT%\bin\%PACKAGENAME%-browser-bin.vars
302+
if errorlevel 1 (echo copy of browser executable vars failed & goto error)
301303

302304
if not exist %PKGDIR%\qtplugins\sqldrivers mkdir %PKGDIR%\qtplugins\sqldrivers
303305
move %OSGEO4W_ROOT%\apps\qt5\plugins\sqldrivers\qsqlocispatial.dll %PKGDIR%\qtplugins\sqldrivers

ms-windows/osgeo4w/package.cmd

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -360,6 +360,8 @@ copy qgis.vars %OSGEO4W_ROOT%\bin\%PACKAGENAME%-bin.vars
360360
if errorlevel 1 (echo copy of desktop executable vars failed & goto error)
361361
move %PKGDIR%\bin\qbrowser.exe %OSGEO4W_ROOT%\bin\%PACKAGENAME%-browser-bin.exe
362362
if errorlevel 1 (echo move of browser executable failed & goto error)
363+
copy qgis.vars %OSGEO4W_ROOT%\bin\%PACKAGENAME%-browser-bin.vars
364+
if errorlevel 1 (echo copy of browser executable vars failed & goto error)
363365

364366
if not exist %PKGDIR%\qtplugins\sqldrivers mkdir %PKGDIR%\qtplugins\sqldrivers
365367
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
383385
--exclude "apps/%PACKAGENAME%/python/qgis/_server.lib" ^
384386
--exclude "apps/%PACKAGENAME%/python/qgis/server" ^
385387
"bin/%PACKAGENAME%-browser-bin.exe" ^
388+
"bin/%PACKAGENAME%-browser-bin.vars" ^
386389
"bin/%PACKAGENAME%-bin.exe" ^
390+
"bin/%PACKAGENAME%-bin.vars" ^
387391
"bin/python-%PACKAGENAME%.bat.tmpl" ^
388392
"apps/%PACKAGENAME%/bin/qgis_app.dll" ^
393+
"apps/%PACKAGENAME%/bin/qgis_browser.dll" ^
389394
"apps/%PACKAGENAME%/bin/qgis.reg.tmpl" ^
390395
"apps/%PACKAGENAME%/i18n/" ^
391396
"apps/%PACKAGENAME%/icons/" ^

ms-windows/osgeo4w/postinstall-desktop.bat

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,16 @@ for %%i in ("%OSGEO4W_ROOT%") do set O4W_ROOT=%%~fsi
88
if "%OSGEO4W_DESKTOP%"=="" set OSGEO4W_DESKTOP=~$folder.common_desktop$
99

1010
"%OSGEO4W_ROOT%\bin\@package@.bat" --exit
11+
"%OSGEO4W_ROOT%\bin\@package@-browser.bat" --exit
1112

1213
if not %OSGEO4W_MENU_LINKS%==0 mkdir "%OSGEO4W_STARTMENU%"
1314
if not %OSGEO4W_DESKTOP_LINKS%==0 mkdir "%OSGEO4W_DESKTOP%"
1415

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

18-
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"
19-
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"
19+
if not %OSGEO4W_MENU_LINKS%==0 nircmd shortcut "%O4W_ROOT%\bin\@package@-browser-bin.exe" "%OSGEO4W_STARTMENU%" "QGIS Browser @version@"
20+
if not %OSGEO4W_DESKTOP_LINKS%==0 nircmd shortcut "%O4W_ROOT%\bin\@package@-browser-bin.exe" "%OSGEO4W_DESKTOP%" "QGIS Browser @version@"
2021

2122
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"
2223
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"

ms-windows/osgeo4w/postinstall-dev.bat

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,21 @@ if not %OSGEO4W_MENU_LINKS%==0 mkdir "%OSGEO4W_STARTMENU%"
77
if not %OSGEO4W_DESKTOP_LINKS%==0 mkdir "%OSGEO4W_DESKTOP%"
88

99
for %%g in (@grassversions@) do (
10-
textreplace -std -t bin\@package@-g%%g.bat
11-
12-
REM copy executable so we have one (now small) executable for each environment
13-
REM and call it to produce .env from .vars
1410
copy "%OSGEO4W_ROOT%\bin\@package@-bin.exe" "%OSGEO4W_ROOT%\bin\@package@-bin-g%%g.exe"
1511
copy "%OSGEO4W_ROOT%\bin\@package@-bin.vars" "%OSGEO4W_ROOT%\bin\@package@-bin-g%%g.vars"
12+
textreplace -std -t bin\@package@-g%%g.bat
1613
"%OSGEO4W_ROOT%\bin\@package@-g%%g.bat" --exit
1714

1815
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)"
1916
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)"
2017

18+
copy "%OSGEO4W_ROOT%\bin\@package@-browser-bin.exe" "%OSGEO4W_ROOT%\bin\@package@-browser-bin-g%%g.exe"
19+
copy "%OSGEO4W_ROOT%\bin\@package@-bin.vars" "%OSGEO4W_ROOT%\bin\@package@-browser-bin-g%%g.vars"
2120
textreplace -std -t bin\@package@-browser-g%%g.bat
22-
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"
23-
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"
21+
"%OSGEO4W_ROOT%\bin\@package@-browser-g%%g.bat" --exit
22+
23+
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)"
24+
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)"
2425
)
2526

2627
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"

ms-windows/osgeo4w/preremove-desktop.bat

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ del "%OSGEO4W_ROOT%\bin\@package@.bat"
1010
del "%OSGEO4W_ROOT%\bin\@package@-bin.vars"
1111
del "%OSGEO4W_ROOT%\bin\@package@-bin.env"
1212
del "%OSGEO4W_ROOT%\bin\@package@-browser.bat"
13+
del "%OSGEO4W_ROOT%\bin\@package@-browser-bin.vars"
14+
del "%OSGEO4W_ROOT%\bin\@package@-browser-bin.env"
1315
del "%OSGEO4W_ROOT%\bin\@package@-designer.bat"
1416
del "%OSGEO4W_ROOT%\apps\@package@\python\qgis\qgisconfig.py"
1517
del "%OSGEO4W_ROOT%\apps\@package@\bin\qgis.reg"

ms-windows/osgeo4w/preremove-dev.bat

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ for %%g in (@grassversions@) do (
88
del "%OSGEO4W_ROOT%\bin\@package@-bin-g%%g.env"
99
del "%OSGEO4W_ROOT%\bin\@package@-bin-g%%g.vars"
1010
del "%OSGEO4W_ROOT%\bin\@package@-browser-g%%g.bat"
11+
del "%OSGEO4W_ROOT%\bin\@package@-browser-bin-g%%g.exe"
12+
del "%OSGEO4W_ROOT%\bin\@package@-browser-bin-g%%g.env"
13+
del "%OSGEO4W_ROOT%\bin\@package@-browser-bin-g%%g.vars"
1114
)
1215

1316
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).
1619
rmdir "%OSGEO4W_DESKTOP%"
1720

1821
del "%OSGEO4W_ROOT%\bin\@package@-bin.env"
22+
del "%OSGEO4W_ROOT%\bin\@package@-browser-bin.env"
1923
del "%OSGEO4W_ROOT%\bin\@package@-designer.bat"
2024
del "%OSGEO4W_ROOT%\bin\python-@package@.bat"
2125
del "%OSGEO4W_ROOT%\apps\@package@\python\qgis\qgisconfig.py"

src/app/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -481,6 +481,7 @@ IF (WIN32)
481481

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

485486
IF (MSVC)
486487
SET (QGIS_APPMAIN_SRCS ${QGIS_APPMAIN_SRCS} ${CMAKE_CURRENT_SOURCE_DIR}/qgis_win32.rc)

src/app/mainwin.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,10 @@ int CALLBACK WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdL
104104
}
105105
}
106106

107-
HINSTANCE hGetProcIDDLL = LoadLibrary( "qgis_app.dll" );
107+
HINSTANCE hGetProcIDDLL = LoadLibrary( MAINWIN_DLL );
108108
if ( !hGetProcIDDLL )
109109
{
110-
std::cerr << "Could not load the qgis_app.dll" << std::endl;
110+
std::cerr << "Could not load the " MAINWIN_DLL << std::endl;
111111
return EXIT_FAILURE;
112112
}
113113

src/browser/CMakeLists.txt

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,15 @@ QT5_WRAP_CPP (BROWSER_MOC_SRCS ${BROWSER_MOC_HDRS})
5252
QT5_ADD_RESOURCES(IMAGE_RCC_SRCS ${IMAGE_RCCS})
5353
#QT5_ADD_RESOURCES(BROWSER_RCC_SRCS ${BROWSER_RCCS})
5454

55-
ADD_EXECUTABLE (qbrowser MACOSX_BUNDLE WIN32 ${BROWSER_SRCS} ${BROWSER_MOC_SRCS} ${BROWSER_UIS_H} ${IMAGE_RCC_SRCS})
55+
IF(WIN32)
56+
SET(BROWSER_TARGET qgis_browser)
57+
ADD_LIBRARY(${BROWSER_TARGET} SHARED ${BROWSER_SRCS} ${BROWSER_MOC_SRCS} ${BROWSER_UIS_H} ${IMAGE_RCC_SRCS})
58+
ADD_EXECUTABLE(qbrowser WIN32 ../app/mainwin.cpp)
59+
SET_SOURCE_FILES_PROPERTIES(../app/mainwin.cpp PROPERTIES COMPILE_FLAGS -DMAINWIN_DLL=\\\"qgis_browser.dll\\\")
60+
ELSE(WIN32)
61+
SET(BROWSER_TARGET qbrowser)
62+
ADD_EXECUTABLE (qbrowser MACOSX_BUNDLE ${BROWSER_SRCS} ${BROWSER_MOC_SRCS} ${BROWSER_UIS_H} ${IMAGE_RCC_SRCS})
63+
ENDIF(WIN32)
5664

5765
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}
5866
${CMAKE_CURRENT_SOURCE_DIR}/../core
@@ -74,7 +82,7 @@ INCLUDE_DIRECTORIES(SYSTEM
7482
${SQLITE3_INCLUDE_DIR}
7583
)
7684

77-
TARGET_LINK_LIBRARIES(qbrowser
85+
TARGET_LINK_LIBRARIES(${BROWSER_TARGET}
7886
qgis_core
7987
qgis_gui
8088
${QT_QTCORE_LIBRARY}
@@ -87,22 +95,29 @@ TARGET_LINK_LIBRARIES(qbrowser
8795
)
8896

8997
IF(APPLE)
90-
SET_TARGET_PROPERTIES(qbrowser PROPERTIES
98+
SET_TARGET_PROPERTIES(${BROWSER_TARGET} PROPERTIES
9199
INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}/${QGIS_LIB_DIR}
92100
INSTALL_RPATH_USE_LINK_PATH true
93101
MACOSX_BUNDLE_INFO_PLIST "${CMAKE_SOURCE_DIR}/mac/browser.info.plist.in"
94102
OUTPUT_NAME "QGIS Browser"
95103
)
96104
ENDIF(APPLE)
97105

98-
IF(MSVC)
99-
INSTALL(FILES browser.ico DESTINATION ${CMAKE_INSTALL_PREFIX}/icons)
100-
ENDIF(MSVC)
106+
IF(WIN32)
107+
IF(MSVC)
108+
INSTALL(FILES browser.ico DESTINATION ${CMAKE_INSTALL_PREFIX}/icons)
109+
ENDIF(MSVC)
110+
111+
INSTALL (TARGETS qbrowser
112+
BUNDLE DESTINATION ${QGIS_BIN_DIR}
113+
RUNTIME DESTINATION ${QGIS_BIN_DIR}
114+
)
115+
ENDIF(WIN32)
101116

102117
########################################################
103118
# Install
104119

105-
INSTALL (TARGETS qbrowser
120+
INSTALL (TARGETS ${BROWSER_TARGET}
106121
BUNDLE DESTINATION ${QGIS_BIN_DIR}
107122
RUNTIME DESTINATION ${QGIS_BIN_DIR}
108123
)

src/browser/main.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@
3131

3232
#include "qgseditorwidgetregistry.h"
3333

34+
#ifdef Q_OS_WIN
35+
__declspec( dllexport )
36+
#endif
3437
int main( int argc, char ** argv )
3538
{
3639
QSettings settings;

0 commit comments

Comments
 (0)