Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ option(WITH_SQLITE "Use sqlite as a cache/dimension backend" ON)
option(WITH_POSTGRESQL "Use PostgreSQL as a dimension backend" OFF)
option(WITH_BERKELEY_DB "Use Berkeley DB as a cache backend" OFF)
option(WITH_MEMCACHE "Use memcache as a cache backend (requires recent apr-util)" OFF)
option(WITH_REDIS "Use redis as a cache backend (requires hiredis library)" OFF)
option(WITH_TIFF "Use TIFFs as a cache backend" OFF)
option(WITH_TIFF_WRITE_SUPPORT "Enable (experimental) support for writable TIFF cache backends" OFF)
option(WITH_GEOTIFF "Allow GeoTIFF metadata creation for TIFF cache backends" OFF)
Expand Down Expand Up @@ -155,6 +156,17 @@ if(WITH_MEMCACHE)

endif(WITH_MEMCACHE)

if(WITH_REDIS)
find_package(Redis)
if(HIREDIS_FOUND)
include_directories(${HIREDIS_INCLUDE_DIR})
target_link_libraries(mapcache ${HIREDIS_LIBRARIES})
set (USE_REDIS 1)
else(HIREDIS_FOUND)
report_optional_not_found(Redis)
endif(HIREDIS_FOUND)
endif(WITH_REDIS)

if(WITH_PIXMAN)
find_package(Pixman)
if(PIXMAN_FOUND)
Expand Down Expand Up @@ -321,6 +333,7 @@ status_optional_component("SQLITE" "${USE_SQLITE}" "${SQLITE_LIBRARY}")
status_optional_component("POSTGRESQL" "${USE_POSTGRESQL}" "${PostgreSQL_LIBRARY}")
status_optional_component("Berkeley DB" "${USE_BDB}" "${BERKELEYDB_LIBRARY}")
status_optional_component("Memcache" "${USE_MEMCACHE}" "${APU_LIBRARY}")
status_optional_component("Redis" "${USE_REDIS}" "${HIREDIS_LIBRARIES} ${HIREDIS_INCLUDE_DIR}")
status_optional_component("TIFF" "${USE_TIFF}" "${TIFF_LIBRARY}")
status_optional_component("GeoTIFF" "${USE_GEOTIFF}" "${GEOTIFF_LIBRARY}")
status_optional_component("Experimental TIFF write support" "${USE_TIFF_WRITE}" "${TIFF_LIBRARY}")
Expand Down
29 changes: 29 additions & 0 deletions cmake/FindRedis.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
IF (HIREDIS_INCLUDE_DIR AND HIREDIS_LIBRARIES)
SET (HIREDIS_FOUND TRUE)
ELSE(HIREDIS_INCLUDE_DIR AND HIREDIS_LIBRARIES)
FIND_PATH(HIREDIS_INCLUDE_DIR hiredis/hiredis.h
/usr/include/
/usr/include/hiredis
/usr/local/include/
/usr/local/include/hiredis
/opt/local/include/
/opt/local/include/hiredis
)

FIND_LIBRARY(HIREDIS_LIBRARIES NAMES hiredis libhiredis
PATHS
/usr/lib
/usr/local/lib
/opt/local/lib
)

IF(HIREDIS_INCLUDE_DIR AND HIREDIS_LIBRARIES)
SET(HIREDIS_FOUND TRUE)
MESSAGE(STATUS "Found hiredis: ${HIREDIS_INCLUDE_DIR}, ${HIREDIS_LIBRARIES}")
ELSE(HIREDIS_INCLUDE_DIR AND HIREDIS_LIBRARIES)
SET(HIREDIS_FOUND FALSE)
MESSAGE(STATUS "hiredis client library not found.")
ENDIF(HIREDIS_INCLUDE_DIR AND HIREDIS_LIBRARIES)

MARK_AS_ADVANCED(HIREDIS_INCLUDE_DIR HIREDIS_LIBRARIES)
ENDIF(HIREDIS_INCLUDE_DIR AND HIREDIS_LIBRARIES)
1 change: 1 addition & 0 deletions include/mapcache-config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#cmakedefine USE_POSTGRESQL 1
#cmakedefine USE_BDB 1
#cmakedefine USE_MEMCACHE 1
#cmakedefine USE_REDIS 1
#cmakedefine USE_TIFF 1
#cmakedefine USE_TIFF_WRITE 1
#cmakedefine USE_GEOTIFF 1
Expand Down
7 changes: 7 additions & 0 deletions include/mapcache.h
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,8 @@ typedef enum {
,MAPCACHE_CACHE_COMPOSITE
,MAPCACHE_CACHE_COUCHBASE
,MAPCACHE_CACHE_RIAK
,MAPCACHE_CACHE_REDIS

} mapcache_cache_type;

/** \interface mapcache_cache
Expand Down Expand Up @@ -408,6 +410,11 @@ mapcache_cache* mapcache_cache_tc_create(mapcache_context *ctx);
*/
mapcache_cache* mapcache_cache_riak_create(mapcache_context *ctx);

/**
* \memberof mapcache_cache_redis
*/
mapcache_cache* mapcache_cache_redis_create(mapcache_context* ctx);

/** @} */


Expand Down
Loading