Skip to content

Commit

Permalink
add internal spatialite support
Browse files Browse the repository at this point in the history
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 92266b9
Show file tree
Hide file tree
Showing 33 changed files with 144,535 additions and 14 deletions.
20 changes: 14 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)

Expand All @@ -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:
Expand Down Expand Up @@ -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 )

Expand Down
11 changes: 7 additions & 4 deletions src/app/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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})
Expand Down Expand Up @@ -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)

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

Expand All @@ -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")
Expand Down
57 changes: 57 additions & 0 deletions src/core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 92266b9

Please sign in to comment.