1# - Find Snappy
2# Find the snappy compression library and includes
3#
4# snappy_INCLUDE_DIRS - where to find snappy.h, etc.
5# snappy_LIBRARIES - List of libraries when using snappy.
6# snappy_FOUND - True if snappy found.
7
8find_path(snappy_INCLUDE_DIRS
9  NAMES snappy.h
10  HINTS ${snappy_ROOT_DIR}/include)
11
12find_library(snappy_LIBRARIES
13  NAMES snappy
14  HINTS ${snappy_ROOT_DIR}/lib)
15
16include(FindPackageHandleStandardArgs)
17find_package_handle_standard_args(snappy DEFAULT_MSG snappy_LIBRARIES snappy_INCLUDE_DIRS)
18
19mark_as_advanced(
20  snappy_LIBRARIES
21  snappy_INCLUDE_DIRS)
22
23if(snappy_FOUND AND NOT (TARGET snappy::snappy))
24  add_library (snappy::snappy UNKNOWN IMPORTED)
25  set_target_properties(snappy::snappy
26    PROPERTIES
27      IMPORTED_LOCATION ${snappy_LIBRARIES}
28      INTERFACE_INCLUDE_DIRECTORIES ${snappy_INCLUDE_DIRS})
29endif()
30