File tree Expand file tree Collapse file tree 7 files changed +373
-0
lines changed
Expand file tree Collapse file tree 7 files changed +373
-0
lines changed Original file line number Diff line number Diff line change @@ -89,6 +89,7 @@ option(WITH_SQLITE "Use sqlite as a cache/dimension backend" ON)
8989option (WITH_POSTGRESQL "Use PostgreSQL as a dimension backend" OFF )
9090option (WITH_BERKELEY_DB "Use Berkeley DB as a cache backend" OFF )
9191option (WITH_MEMCACHE "Use memcache as a cache backend (requires recent apr-util)" OFF )
92+ option (WITH_REDIS "Use redis as a cache backend (requires hiredis library)" OFF )
9293option (WITH_TIFF "Use TIFFs as a cache backend" OFF )
9394option (WITH_TIFF_WRITE_SUPPORT "Enable (experimental) support for writable TIFF cache backends" OFF )
9495option (WITH_GEOTIFF "Allow GeoTIFF metadata creation for TIFF cache backends" OFF )
@@ -155,6 +156,17 @@ if(WITH_MEMCACHE)
155156
156157endif (WITH_MEMCACHE)
157158
159+ if (WITH_REDIS)
160+ find_package (Redis)
161+ if (HIREDIS_FOUND)
162+ include_directories (${HIREDIS_INCLUDE_DIR} )
163+ target_link_libraries (mapcache ${HIREDIS_LIBRARIES} )
164+ set (USE_REDIS 1)
165+ else (HIREDIS_FOUND)
166+ report_optional_not_found(Redis)
167+ endif (HIREDIS_FOUND)
168+ endif (WITH_REDIS)
169+
158170if (WITH_PIXMAN)
159171 find_package (Pixman)
160172 if (PIXMAN_FOUND)
@@ -321,6 +333,7 @@ status_optional_component("SQLITE" "${USE_SQLITE}" "${SQLITE_LIBRARY}")
321333status_optional_component("POSTGRESQL" "${USE_POSTGRESQL} " "${PostgreSQL_LIBRARY} " )
322334status_optional_component("Berkeley DB" "${USE_BDB} " "${BERKELEYDB_LIBRARY} " )
323335status_optional_component("Memcache" "${USE_MEMCACHE} " "${APU_LIBRARY} " )
336+ status_optional_component("Redis" "${USE_REDIS} " "${HIREDIS_LIBRARIES} ${HIREDIS_INCLUDE_DIR} " )
324337status_optional_component("TIFF" "${USE_TIFF} " "${TIFF_LIBRARY} " )
325338status_optional_component("GeoTIFF" "${USE_GEOTIFF} " "${GEOTIFF_LIBRARY} " )
326339status_optional_component("Experimental TIFF write support" "${USE_TIFF_WRITE} " "${TIFF_LIBRARY} " )
Original file line number Diff line number Diff line change 1+ IF (HIREDIS_INCLUDE_DIR AND HIREDIS_LIBRARIES)
2+ SET (HIREDIS_FOUND TRUE )
3+ ELSE (HIREDIS_INCLUDE_DIR AND HIREDIS_LIBRARIES)
4+ FIND_PATH (HIREDIS_INCLUDE_DIR hiredis/hiredis.h
5+ /usr/include /
6+ /usr/include /hiredis
7+ /usr/local/include /
8+ /usr/local/include /hiredis
9+ /opt/local/include /
10+ /opt/local/include /hiredis
11+ )
12+
13+ FIND_LIBRARY (HIREDIS_LIBRARIES NAMES hiredis libhiredis
14+ PATHS
15+ /usr/lib
16+ /usr/local/lib
17+ /opt/local/lib
18+ )
19+
20+ IF (HIREDIS_INCLUDE_DIR AND HIREDIS_LIBRARIES)
21+ SET (HIREDIS_FOUND TRUE )
22+ MESSAGE (STATUS "Found hiredis: ${HIREDIS_INCLUDE_DIR} , ${HIREDIS_LIBRARIES} " )
23+ ELSE (HIREDIS_INCLUDE_DIR AND HIREDIS_LIBRARIES)
24+ SET (HIREDIS_FOUND FALSE )
25+ MESSAGE (STATUS "hiredis client library not found." )
26+ ENDIF (HIREDIS_INCLUDE_DIR AND HIREDIS_LIBRARIES)
27+
28+ MARK_AS_ADVANCED (HIREDIS_INCLUDE_DIR HIREDIS_LIBRARIES)
29+ ENDIF (HIREDIS_INCLUDE_DIR AND HIREDIS_LIBRARIES)
Original file line number Diff line number Diff line change 77#cmakedefine USE_POSTGRESQL 1
88#cmakedefine USE_BDB 1
99#cmakedefine USE_MEMCACHE 1
10+ #cmakedefine USE_REDIS 1
1011#cmakedefine USE_TIFF 1
1112#cmakedefine USE_TIFF_WRITE 1
1213#cmakedefine USE_GEOTIFF 1
Original file line number Diff line number Diff line change @@ -327,6 +327,8 @@ typedef enum {
327327 ,MAPCACHE_CACHE_COMPOSITE
328328 ,MAPCACHE_CACHE_COUCHBASE
329329 ,MAPCACHE_CACHE_RIAK
330+ ,MAPCACHE_CACHE_REDIS
331+
330332} mapcache_cache_type ;
331333
332334/** \interface mapcache_cache
@@ -408,6 +410,11 @@ mapcache_cache* mapcache_cache_tc_create(mapcache_context *ctx);
408410 */
409411mapcache_cache * mapcache_cache_riak_create (mapcache_context * ctx );
410412
413+ /**
414+ * \memberof mapcache_cache_redis
415+ */
416+ mapcache_cache * mapcache_cache_redis_create (mapcache_context * ctx );
417+
411418/** @} */
412419
413420
You can’t perform that action at this time.
0 commit comments