forked from tumi8/vermont
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFindRedis.cmake
42 lines (37 loc) · 1.3 KB
/
FindRedis.cmake
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# - Find Redis client db (hiredis from https://github.com/antirez/hiredis)
# Find the hiredis includes and client library
# This module defines
# HIREDIS_INCLUDE_DIR, where to find hiredis/hiredis.h
# HIREDIS_LIBRARIES, the libraries needed to use redis.
# HIREDIS_FOUND, If false, do not try to use redis.
#
# Copyright (c) 2012, Lothar Braun, <[email protected]>
#
# Add the redis include paths here
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}")
INCLUDE_DIRECTORIES(${HIREDIS_INCLUDE_DIR})
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)