2 # Find the snappy compression library and includes
4 # SNAPPY_INCLUDE_DIR - where to find snappy.h, etc.
5 # SNAPPY_LIBRARIES - List of libraries when using snappy.
6 # SNAPPY_FOUND - True if snappy found.
8 find_package(PkgConfig QUIET REQUIRED)
9 pkg_search_module(PC_snappy
12 find_path(SNAPPY_INCLUDE_DIR
15 ${PC_snappy_INCLUDE_DIRS}
16 ${SNAPPY_ROOT_DIR}/include)
18 find_library(SNAPPY_LIBRARIES
21 ${PC_snappy_LIBRARY_DIRS}
22 ${SNAPPY_ROOT_DIR}/lib)
24 include(FindPackageHandleStandardArgs)
25 find_package_handle_standard_args(snappy
26 DEFAULT_MSG SNAPPY_LIBRARIES SNAPPY_INCLUDE_DIR)
32 if(snappy_FOUND AND NOT (TARGET snappy::snappy))
33 add_library(snappy::snappy UNKNOWN IMPORTED)
34 set_target_properties(snappy::snappy PROPERTIES
35 INTERFACE_INCLUDE_DIRECTORIES "${SNAPPY_INCLUDE_DIR}"
36 IMPORTED_LINK_INTERFACE_LANGUAGES "CXX"
37 IMPORTED_LOCATION "${SNAPPY_LIBRARIES}")