Skip to content

Commit

Permalink
[FEATURE] add qspatialite sql driver plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed Feb 17, 2013
1 parent 4aaed2a commit 5542504
Show file tree
Hide file tree
Showing 11 changed files with 1,105 additions and 1 deletion.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ SET (WITH_SPATIALITE TRUE CACHE BOOL "Determines whether SPATIALITE support shou
IF (WITH_SPATIALITE)
SET (WITH_INTERNAL_SPATIALITE FALSE CACHE BOOL "Determines whether SPATIALITE support should be built internally")
SET (WITH_PYSPATIALITE FALSE CACHE BOOL "Determines whether PYSPATIALITE should be built")
SET (WITH_QSPATIALITE TRUE CACHE BOOL "Determines whether QSPATIALITE sql driver should be built")
IF(WITH_INTERNAL_SPATIALITE)
SET(SPATIALITE_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/src/core/spatialite/headers)
SET(HAVE_SPATIALITE TRUE)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ usr/share/qgis/resources/qgis.db
usr/share/qgis/resources/srs.db
usr/share/qgis/resources/symbology-ng-style.db
usr/share/qgis/resources/cpt-city-qgis-min/*
usr/lib/{DEB_BUILD_GNU_TYPE}/qt4/plugins/sqldrivers/libqsqlspatialite.so
1 change: 1 addition & 0 deletions ms-windows/osgeo4w/package-nightly.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ tar -C %OSGEO4W_ROOT% -cjf %PACKAGENAME%-%VERSION%-%PACKAGE%.tar.bz2 ^
bin/%PACKAGENAME%.bat.tmpl ^
bin/%PACKAGENAME%-browser.bat.tmpl ^
apps/qt4/plugins/sqldrivers/qsqlocispatial.dll ^
apps/qt4/plugins/sqldrivers/qsqlspatialite.dll ^
etc/postinstall/%PACKAGENAME%.bat ^
etc/preremove/%PACKAGENAME%.bat ^
>>%LOG% 2>&1
Expand Down
1 change: 1 addition & 0 deletions ms-windows/osgeo4w/package.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,7 @@ tar -C %OSGEO4W_ROOT% -cjf %PACKAGENAME%-%VERSION%-%PACKAGE%.tar.bz2 ^
"apps/%PACKAGENAME%/plugins/zonalstatisticsplugin.dll" ^
"apps/%PACKAGENAME%/plugins/heatmapplugin.dll" ^
"apps/%PACKAGENAME%/qgis_help.exe" ^
"apps/qt4/plugins/sqldrivers/qsqlspatialite.dll" ^
"apps/%PACKAGENAME%/python/" ^
"apps/%PACKAGENAME%/resources/context_help/" ^
"apps/%PACKAGENAME%/resources/function_help/" ^
Expand Down
5 changes: 4 additions & 1 deletion src/providers/spatialite/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@

########################################################
# Files

IF(WITH_QSPATIALITE)
SUBDIRS(qspatialite)
ENDIF(WITH_QSPATIALITE)

SET(SPATIALITE_SRCS
qgsspatialiteprovider.cpp
qgsspatialitedataitems.cpp
Expand Down
31 changes: 31 additions & 0 deletions src/providers/spatialite/qspatialite/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${QGIS_OUTPUT_DIRECTORY}/${QGIS_PLUGIN_SUBDIR}/sqldrivers)
SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${QGIS_OUTPUT_DIRECTORY}/${QGIS_PLUGIN_SUBDIR}/sqldrivers)

ADD_DEFINITIONS(${QT_DEFINITIONS})
ADD_DEFINITIONS(-DQT_PLUGIN)
ADD_DEFINITIONS(-DQT_NO_DEBUG)
ADD_DEFINITIONS(-DQT_SHARED)

IF (NOT WITH_INTERNAL_SPATIALITE)
INCLUDE_DIRECTORIES(${SQLITE3_INCLUDE_DIR})
ENDIF (NOT WITH_INTERNAL_SPATIALITE)

SET(QSQLSPATIALITE_SRC qsql_spatialite.cpp smain.cpp)
QT4_WRAP_CPP(QSQLSPATIALITE_SRC qsql_spatialite.h)

ADD_LIBRARY(qsqlspatialite SHARED ${QSQLSPATIALITE_SRC})
TARGET_LINK_LIBRARIES(qsqlspatialite
${QT_QTCORE_LIBRARY}
${QT_QTSQL_LIBRARY}
)

IF (WITH_INTERNAL_SPATIALITE)
TARGET_LINK_LIBRARIES(qsqlspatialite qgis_core)
ELSE (WITH_INTERNAL_SPATIALITE)
TARGET_LINK_LIBRARIES(qsqlspatialite ${SQLITE3_LIBRARY} ${SPATIALITE_LIBRARY})
ENDIF (WITH_INTERNAL_SPATIALITE)

INSTALL(TARGETS qsqlspatialite
RUNTIME DESTINATION ${QT_PLUGINS_DIR}/sqldrivers
LIBRARY DESTINATION ${QT_PLUGINS_DIR}/sqldrivers
)
7 changes: 7 additions & 0 deletions src/providers/spatialite/qspatialite/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
QSPATIALITE driver derived from QSQLITE driver.

No actual changes except linking to spatialite and a call to
spatialite_init(0).

See the Qt SQL documentation for more information on compiling Qt SQL
driver plugins (sql-driver.html).
Loading

0 comments on commit 5542504

Please sign in to comment.