Updating submodules
[hiphop-php.git] / CMake / FindSnappy.cmake
blobef7541beb17f0e25a23a810321d4be15ce8c218a
1 # - Find Snappy
2 # This module defines
3 # SNAPPY_INCLUDE_DIR, where to find Snappy headers
4 # SNAPPY_LIBS, Snappy libraries
5 # SNAPPY_FOUND, If false, do not try to use Snappy
7 find_path(SNAPPY_INCLUDE_DIR snappy.h PATHS
8   /usr/local/include
9   /opt/local/include
12 #find_library can't seem to find a 64-bit binary if the 32-bit isn't there
13 set(SNAPPY_LIB_NAMES libsnappy snappy)
14 set(SNAPPY_LIB_PATHS /usr/local/lib /opt/local/lib /usr/lib64)
15 find_library(SNAPPY_LIB NAMES ${SNAPPY_LIB_NAMES} PATHS ${SNAPPY_LIB_PATHS})
17 if (SNAPPY_LIB AND SNAPPY_INCLUDE_DIR)
18   set(SNAPPY_FOUND TRUE)
19   set(SNAPPY_LIBS ${SNAPPY_LIB})
20 else ()
21   set(SNAPPY_FOUND FALSE)
22 endif ()
24 if (SNAPPY_FOUND)
25   if (NOT SNAPPY_FIND_QUIETLY)
26     message(STATUS "Found Snappy: ${SNAPPY_LIBS}")
27   endif ()
28 else ()
29   if (SNAPPY_FIND_REQUIRED)
30     message(FATAL_ERROR "Could NOT find the Snappy library.")
31   endif ()
32   message(STATUS "Snappy NOT found.")
33 endif ()
35 mark_as_advanced(
36   SNAPPY_LIB
37   SNAPPY_INCLUDE_DIR