Skip to content
Permalink
Browse files

Apply partial patch from #4111 to allow using separate spatialindex l…

…ib from source tree if desired.
  • Loading branch information
timlinux committed Oct 7, 2011
1 parent f39a19c commit 356c87ba9abe12ece5ee0d6ad6bf5dcd7d4e9bbb
Showing with 42 additions and 23 deletions.
  1. +8 −1 CMakeLists.txt
  2. +2 −2 COPYING
  3. +32 −20 src/core/CMakeLists.txt
@@ -51,7 +51,9 @@ IF (WITH_POSTGRESQL)
SET (POSTGRESQL_PREFIX "" CACHE PATH "Path to POSTGRESQL base directory")
ENDIF (WITH_POSTGRESQL)

SET (WITH_INTERNAL_QWTPOLAR TRUE CACHE BOOL "Use internal built of QwtPolar")
SET (WITH_INTERNAL_QWTPOLAR TRUE CACHE BOOL "Use internal build of QwtPolar")

SET (WITH_INTERNAL_SPATIALINDEX TRUE CACHE BOOL "Use internal build of Spatialindex")

SET (WITH_SPATIALITE TRUE CACHE BOOL "Determines whether SPATIALITE support should be built")

@@ -136,6 +138,11 @@ FIND_PACKAGE(Expat) # GPS importer plugin
FIND_PACKAGE(GSL) # Georeferencer
FIND_PACKAGE(GEOS)
FIND_PACKAGE(GDAL)

IF (NOT WITH_INTERNAL_SPATIALINDEX)
FIND_PACKAGE(Spatialindex REQUIRED)
ENDIF(NOT WITH_INTERNAL_SPATIALINDEX)

FIND_PACKAGE(Qwt REQUIRED)
IF (NOT WITH_INTERNAL_QWTPOLAR)
FIND_PACKAGE(QwtPolar REQUIRED)
@@ -2,7 +2,7 @@
Version 2, June 1991

Copyright (C) 1989, 1991 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.

@@ -318,7 +318,7 @@ the "copyright" line and a pointer to where the full notice is found.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA


Also add information on how to contact you by electronic and paper mail.
@@ -396,14 +396,19 @@ INCLUDE_DIRECTORIES(
raster
renderer
symbology
spatialindex/include
symbology-ng
gps/qextserialport
${PROJ_INCLUDE_DIR}
${GEOS_INCLUDE_DIR}
${GDAL_INCLUDE_DIR}
)

IF (NOT WITH_INTERNAL_SPATIALINDEX)
INCLUDE_DIRECTORIES(${SPATIALINDEX_INCLUDE_DIR})
ELSE (NOT WITH_INTERNAL_SPATIALINDEX)
INCLUDE_DIRECTORIES(spatialindex/include)
ENDIF (NOT WITH_INTERNAL_SPATIALINDEX)

IF (NOT WITH_INTERNAL_SPATIALITE)
INCLUDE_DIRECTORIES(${SQLITE3_INCLUDE_DIR})
ENDIF (NOT WITH_INTERNAL_SPATIALITE)
@@ -426,25 +431,27 @@ ENDIF (WIN32)
#############################################################
# spatial indexing library

# add path prefix to every specified file
MACRO(PATH_PREFIX OUTPUT PREFIX)
FOREACH(F ${ARGN})
SET(${OUTPUT} ${${OUTPUT}} ${PREFIX}/${F})
ENDFOREACH(F)
ENDMACRO(PATH_PREFIX)

# tools library
PATH_PREFIX(TOOLS_SRC tools ExternalSort.cc ExternalSort.h TemporaryFile.cc Tools.cc)
PATH_PREFIX(GEOM_SRC geometry LineSegment.cc Point.cc Region.cc)

# spatial index library
PATH_PREFIX(SPINDEX_SRC spatialindex SpatialIndexImpl.cc)
PATH_PREFIX(STMAN_SRC storagemanager Buffer.cc DiskStorageManager.cc MemoryStorageManager.cc RandomEvictionsBuffer.cc)
PATH_PREFIX(RTREE_SRC rtree BulkLoader.cc Index.cc Leaf.cc Node.cc RTree.cc Statistics.cc)

SET(SPINDEX_SRC ${TOOLS_SRC} ${GEOM_SRC} ${SPINDEX_SRC} ${STMAN_SRC} ${RTREE_SRC})

PATH_PREFIX(INDEX_SRC spatialindex ${SPINDEX_SRC})
IF (WITH_INTERNAL_SPATIALINDEX)
# add path prefix to every specified file
MACRO(PATH_PREFIX OUTPUT PREFIX)
FOREACH(F ${ARGN})
SET(${OUTPUT} ${${OUTPUT}} ${PREFIX}/${F})
ENDFOREACH(F)
ENDMACRO(PATH_PREFIX)

# tools library
PATH_PREFIX(TOOLS_SRC tools ExternalSort.cc ExternalSort.h TemporaryFile.cc Tools.cc)
PATH_PREFIX(GEOM_SRC geometry LineSegment.cc Point.cc Region.cc)

# spatial index library
PATH_PREFIX(SPINDEX_SRC spatialindex SpatialIndexImpl.cc)
PATH_PREFIX(STMAN_SRC storagemanager Buffer.cc DiskStorageManager.cc MemoryStorageManager.cc RandomEvictionsBuffer.cc)
PATH_PREFIX(RTREE_SRC rtree BulkLoader.cc Index.cc Leaf.cc Node.cc RTree.cc Statistics.cc)

SET(SPINDEX_SRC ${TOOLS_SRC} ${GEOM_SRC} ${SPINDEX_SRC} ${STMAN_SRC} ${RTREE_SRC})

PATH_PREFIX(INDEX_SRC spatialindex ${SPINDEX_SRC})
ENDIF (WITH_INTERNAL_SPATIALINDEX)

#############################################################
# qgis_core library
@@ -499,6 +506,11 @@ ELSE (WITH_INTERNAL_SPATIALITE)
TARGET_LINK_LIBRARIES(qgis_core ${SQLITE3_LIBRARY})
ENDIF (WITH_INTERNAL_SPATIALITE)

IF (NOT WITH_INTERNAL_SPATIALINDEX)
TARGET_LINK_LIBRARIES(qgis_core ${SPATIALINDEX_LIBRARY})
ENDIF (NOT WITH_INTERNAL_SPATIALINDEX)


IF (APPLE)
SET_TARGET_PROPERTIES(qgis_core PROPERTIES BUILD_WITH_INSTALL_RPATH TRUE )
ENDIF (APPLE)

0 comments on commit 356c87b

Please sign in to comment.
You can’t perform that action at this time.