Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 43 lines (33 sloc) 1.529 kb
e4f9ac3 Scott MacVicar Add memcache library finding code, work towards the new extension
scottmac authored
1 #
2 # $Id$
3 #
4 # - Find libmemcached
5 # Find libmemcached
6 #
e3778d0 Scott MacVicar Clean up CMake code, fixed a few bugs in libmemcached detection.
scottmac authored
7 # LIBMEMCACHED_INCLUDE_DIR - where to find libmemcached/memcached.h, etc.
8 # LIBMEMCACHED_LIBRARY - List of libraries when using libmemcached.
9 # LIBMEMCACHED_FOUND - True if libmemcached found.
e4f9ac3 Scott MacVicar Add memcache library finding code, work towards the new extension
scottmac authored
10
11
e3778d0 Scott MacVicar Clean up CMake code, fixed a few bugs in libmemcached detection.
scottmac authored
12 IF (LIBMEMCACHED_INCLUDE_DIR)
e4f9ac3 Scott MacVicar Add memcache library finding code, work towards the new extension
scottmac authored
13 # Already in cache, be silent
14 SET(LIBMEMCACHED_FIND_QUIETLY TRUE)
15 ENDIF ()
16
17 FIND_PATH(LIBMEMCACHED_INCLUDE_DIR libmemcached/memcached.h)
18
19 FIND_LIBRARY(LIBMEMCACHED_LIBRARY memcached)
20
650183e Scott MacVicar Make the libmemcached version detection better, make errors fatal so the...
scottmac authored
21 # handle the QUIETLY and REQUIRED arguments and set Libmemcached_FOUND to TRUE if
e4f9ac3 Scott MacVicar Add memcache library finding code, work towards the new extension
scottmac authored
22 # all listed variables are TRUE
23 INCLUDE(FindPackageHandleStandardArgs)
e3778d0 Scott MacVicar Clean up CMake code, fixed a few bugs in libmemcached detection.
scottmac authored
24 FIND_PACKAGE_HANDLE_STANDARD_ARGS(LIBMEMCACHED DEFAULT_MSG LIBMEMCACHED_LIBRARY LIBMEMCACHED_INCLUDE_DIR)
e4f9ac3 Scott MacVicar Add memcache library finding code, work towards the new extension
scottmac authored
25
650183e Scott MacVicar Make the libmemcached version detection better, make errors fatal so the...
scottmac authored
26 SET(LIBMEMCACHED_VERSION 0)
27
28 IF(LIBMEMCACHED_FOUND)
29 if (EXISTS "${LIBMEMCACHED_INCLUDE_DIR}/libmemcached/configure.h")
33d6f97 Sara Golemon Fix detection of libmemcached >= 1.0 on certain distros
sgolemon authored
30 FILE(READ "${LIBMEMCACHED_INCLUDE_DIR}/libmemcached/configure.h" _MEMCACHE_VERSION_CONTENTS)
31 endif()
32 if (EXISTS "${LIBMEMCACHED_INCLUDE_DIR}/libmemcached-1.0/configure.h")
33 FILE(READ "${LIBMEMCACHED_INCLUDE_DIR}/libmemcached-1.0/configure.h" _MEMCACHE_VERSION_CONTENTS)
34 endif()
35 if (_MEMCACHE_VERSION_CONTENTS)
36 STRING(REGEX REPLACE ".*#define LIBMEMCACHED_VERSION_STRING \"([0-9.]+)\".*" "\\1" LIBMEMCACHED_VERSION "${_MEMCACHE_VERSION_CONTENTS}")
650183e Scott MacVicar Make the libmemcached version detection better, make errors fatal so the...
scottmac authored
37 endif()
38 ENDIF()
39
e3778d0 Scott MacVicar Clean up CMake code, fixed a few bugs in libmemcached detection.
scottmac authored
40 SET(LIBMEMCACHED_VERSION ${LIBMEMCACHED_VERSION} CACHE STRING "Version number of libmemcached")
e4f9ac3 Scott MacVicar Add memcache library finding code, work towards the new extension
scottmac authored
41
e3778d0 Scott MacVicar Clean up CMake code, fixed a few bugs in libmemcached detection.
scottmac authored
42 MARK_AS_ADVANCED(LIBMEMCACHED_LIBRARY LIBMEMCACHED_INCLUDE_DIR LIBMEMCACHED_VERSION)
Something went wrong with that request. Please try again.