Skip to content
Permalink
Browse files
add internal spatialite support
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@10473 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Apr 5, 2009
1 parent 95e3a73 commit 92266b9274abae3d29d584056dea861e3d769196
Showing with 144,535 additions and 14 deletions.
  1. +14 −6 CMakeLists.txt
  2. +7 −4 src/app/CMakeLists.txt
  3. +57 −0 src/core/CMakeLists.txt
  4. +2,663 −0 src/core/spatialite/gaiaexif/gaia_exif.c
  5. +446 −0 src/core/spatialite/gaiageo/gg_advanced.c
  6. +396 −0 src/core/spatialite/gaiageo/gg_endian.c
  7. +1,643 −0 src/core/spatialite/gaiageo/gg_geometries.c
  8. +918 −0 src/core/spatialite/gaiageo/gg_relations.c
  9. +1,823 −0 src/core/spatialite/gaiageo/gg_shape.c
  10. +730 −0 src/core/spatialite/gaiageo/gg_transform.c
  11. +1,613 −0 src/core/spatialite/gaiageo/gg_wkb.c
  12. +2,029 −0 src/core/spatialite/gaiageo/gg_wkt.c
  13. +77 −0 src/core/spatialite/headers/spatialite.h
  14. +79 −0 src/core/spatialite/headers/spatialite/gaiaaux.h
  15. +210 −0 src/core/spatialite/headers/spatialite/gaiaexif.h
  16. +622 −0 src/core/spatialite/headers/spatialite/gaiageo.h
  17. +54 −0 src/core/spatialite/headers/spatialite/spatialite.h
  18. +6,742 −0 src/core/spatialite/headers/spatialite/sqlite3.h
  19. +381 −0 src/core/spatialite/headers/spatialite/sqlite3ext.h
  20. +1,440 −0 src/core/spatialite/spatialite/mbrcache.c
  21. +8,012 −0 src/core/spatialite/spatialite/spatialite.c
  22. +1,267 −0 src/core/spatialite/spatialite/virtualfdo.c
  23. +1,666 −0 src/core/spatialite/spatialite/virtualnetwork.c
  24. +521 −0 src/core/spatialite/spatialite/virtualshape.c
  25. +80 −0 src/core/spatialite/spatialite_c99/spatialite_c99.c
  26. +54 −0 src/core/spatialite/versioninfo/version.c
  27. +557 −0 src/core/spatialite/virtualtext/gaiaaux/gg_sqlaux.c
  28. +176 −0 src/core/spatialite/virtualtext/gaiaaux/gg_utf8.c
  29. +109,174 −0 src/core/spatialite/virtualtext/sqlite3/sqlite3.c
  30. +63 −0 src/core/spatialite/virtualtext/versiontext/version.c
  31. +1,015 −0 src/core/spatialite/virtualtext/virtualtext/virtualtext.c
  32. +2 −2 src/providers/CMakeLists.txt
  33. +4 −2 src/providers/spatialite/CMakeLists.txt
@@ -50,10 +50,17 @@ IF (WITH_POSTGRESQL)
SET (POSTGRESQL_PREFIX "" CACHE PATH "Path to POSTGRESQL base directory")
ENDIF (WITH_POSTGRESQL)

# try to configure and build SPATIALITE support
SET (WITH_SPATIALITE TRUE CACHE BOOL "Determines whether SPATIALITE support should be built")

IF (WITH_SPATIALITE)
SET (SPATIALITE_PREFIX "" CACHE PATH "Path to SPATIALITE base directory")
SET (WITH_INTERNAL_SPATIALITE TRUE CACHE BOOL "Determines whether SPATIALITE support should be built internally")
IF(WITH_INTERNAL_SPATIALITE)
SET(SPATIALITE_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/src/core/spatialite/headers)
SET(HAVE_SPATIALITE TRUE)
IF(WIN32)
FIND_PACKAGE(Iconv REQUIRED)
ENDIF(WIN32)
ENDIF (WITH_INTERNAL_SPATIALITE)
ENDIF (WITH_SPATIALITE)

# try to configure and build python bindings by default
@@ -112,6 +119,7 @@ IF (NOT WITH_INTERNAL_SQLITE3)
MESSAGE (SEND_ERROR "sqlite3 dependency was not found (try compiling with sqlite3 internal)!")
ENDIF (NOT SQLITE3_FOUND)
ENDIF (NOT WITH_INTERNAL_SQLITE3)

FIND_PACKAGE(GEOS)
FIND_PACKAGE(GDAL)

@@ -124,9 +132,9 @@ FIND_PACKAGE(GSL) # Georeferencer
IF (WITH_GRASS)
FIND_PACKAGE(GRASS) # GRASS plugin
ENDIF (WITH_GRASS)
IF (WITH_SPATIALITE)
FIND_PACKAGE(SPATIALITE) # SPATIALITE provider
ENDIF (WITH_SPATIALITE)
IF (WITH_SPATIALITE AND NOT WITH_INTERNAL_SPATIALITE)
FIND_PACKAGE(SPATIALITE)
ENDIF (WITH_SPATIALITE AND NOT WITH_INTERNAL_SPATIALITE)

IF (WITH_BINDINGS)
# python support:
@@ -180,7 +188,7 @@ FIND_PROGRAM(QT_LRELEASE_EXECUTABLE
# enable warnings

IF (PEDANTIC)
MESSAGE ("Pedantic compiler settings enabled")
MESSAGE ("-- Pedantic compiler settings enabled")
IF(MSVC)
ADD_DEFINITIONS( /W4 )

@@ -178,14 +178,14 @@ IF (POSTGRES_FOUND)
)
ENDIF (POSTGRES_FOUND)

IF (SPATIALITE_FOUND)
IF (HAVE_SPATIALITE)
SET (QGIS_APP_SRCS ${QGIS_APP_SRCS}
qgsspatialitesourceselect.cpp
)
SET (QGIS_APP_MOC_HDRS ${QGIS_APP_MOC_HDRS}
qgsspatialitesourceselect.h
)
ENDIF (SPATIALITE_FOUND)
ENDIF (HAVE_SPATIALITE)


QT4_WRAP_CPP(QGIS_APP_MOC_SRCS ${QGIS_APP_MOC_HDRS})
@@ -239,9 +239,9 @@ IF (POSTGRES_FOUND)
INCLUDE_DIRECTORIES(${POSTGRES_INCLUDE_DIR})
ENDIF (POSTGRES_FOUND)

IF (SPATIALITE_FOUND)
IF (HAVE_SPATIALITE)
INCLUDE_DIRECTORIES(${SPATIALITE_INCLUDE_DIR})
ENDIF (SPATIALITE_FOUND)
ENDIF (HAVE_SPATIALITE)

#############

@@ -268,6 +268,9 @@ TARGET_LINK_LIBRARIES(qgis
qgis_core
qgis_gui
)
IF(NOT WITH_INTERNAL_SQLITE AND NOT WITH_INTERNAL_SPATIALITE)
TARGET_LINK_LIBRARIES(qgis ${SQLITE_LIBRARY})
ENDIF(NOT WITH_INTERNAL_SQLITE AND NOT WITH_INTERNAL_SPATIALITE)
IF (${QTVERSION} STRLESS "4.3.0")
TARGET_LINK_LIBRARIES(qgis ${QT_QT3SUPPORT_LIBRARY} )
ENDIF (${QTVERSION} STRLESS "4.3.0")
@@ -95,6 +95,57 @@ IF (WITH_INTERNAL_SQLITE3)
)
ENDIF (WITH_INTERNAL_SQLITE3)

IF (WITH_INTERNAL_SPATIALITE)
IF (WIN32)
ADD_DEFINITIONS(-DDLL_EXPORT)
IF (MSVC)
ADD_DEFINITIONS("-DSQLITE_API=__declspec(dllexport)")
ELSE (MSVC)
ADD_DEFINITIONS("\"-DSQLITE_API=__declspec(dllexport)\"")
ENDIF (MSVC)
ENDIF (WIN32)

SET(QGIS_CORE_SRCS
${QGIS_CORE_SRCS}
spatialite/spatialite/mbrcache.c
spatialite/spatialite/spatialite.c
spatialite/spatialite/virtualfdo.c
spatialite/spatialite/virtualnetwork.c
spatialite/spatialite/virtualshape.c

spatialite/spatialite_c99/spatialite_c99.c

spatialite/gaiageo/gg_endian.c
spatialite/gaiageo/gg_geometries.c
spatialite/gaiageo/gg_advanced.c
spatialite/gaiageo/gg_wkb.c
spatialite/gaiageo/gg_wkt.c
spatialite/gaiageo/gg_transform.c
spatialite/gaiageo/gg_shape.c
spatialite/gaiageo/gg_relations.c

spatialite/virtualtext/gaiaaux/gg_sqlaux.c
spatialite/virtualtext/gaiaaux/gg_utf8.c

spatialite/virtualtext/sqlite3/sqlite3.c

spatialite/gaiaexif/gaia_exif.c

spatialite/virtualtext/virtualtext/virtualtext.c

spatialite/versioninfo/version.c

)

IF (NOT MSVC)
SET_SOURCE_FILES_PROPERTIES(
spatialite/spatialite_c99/spatialite_c99.c
PROPERTIES COMPILE_FLAGS -std=c99)
ENDIF (NOT MSVC)

INCLUDE_DIRECTORIES(spatialite/headers)
ENDIF (WITH_INTERNAL_SPATIALITE)

ADD_FLEX_FILES(QGIS_CORE_SRCS qgssearchstringlexer.ll)

ADD_BISON_FILES(QGIS_CORE_SRCS qgssearchstringparser.yy)
@@ -220,6 +271,12 @@ TARGET_LINK_LIBRARIES(qgis_core
${PLATFORM_LIBRARIES}
)

IF (WITH_INTERNAL_SPATIALITE)
IF (WIN32)
TARGET_LINK_LIBRARIES(qgis_core ${ICONV_LIBRARY})
ENDIF (WIN32)
ENDIF (WITH_INTERNAL_SPATIALITE)

IF (NOT WITH_INTERNAL_SQLITE3)
TARGET_LINK_LIBRARIES(qgis_core ${SQLITE3_LIBRARY})
ENDIF (NOT WITH_INTERNAL_SQLITE3)

0 comments on commit 92266b9

Please sign in to comment.