Skip to content
Permalink
Browse files
[FEATURE] add qspatialite sql driver plugin
  • Loading branch information
jef-n committed Feb 17, 2013
1 parent 4aaed2a commit 554250473c2172bf63093e1ba30ed0c510d92659
@@ -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)
@@ -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
@@ -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
@@ -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/" ^
@@ -1,7 +1,10 @@

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

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

SET(SPATIALITE_SRCS
qgsspatialiteprovider.cpp
qgsspatialitedataitems.cpp
@@ -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
)
@@ -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.