forked from facebookincubator/velox
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathFindSnappy.cmake
More file actions
39 lines (31 loc) · 1.33 KB
/
FindSnappy.cmake
File metadata and controls
39 lines (31 loc) · 1.33 KB
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
# Copyright (c) Facebook, Inc. and its affiliates.
# - Try to find snappy
# Once done, this will define
#
# SNAPPY_FOUND - system has Glog
# SNAPPY_INCLUDE_DIRS - deprecated
# SNAPPY_LIBRARIES - deprecated
# Snappy::snappy will be defined based on CMAKE_FIND_LIBRARY_SUFFIXES priority
include(FindPackageHandleStandardArgs)
include(SelectLibraryConfigurations)
find_library(SNAPPY_LIBRARY_RELEASE snappy PATHS $SNAPPY_LIBRARYDIR})
find_library(SNAPPY_LIBRARY_DEBUG snappyd PATHS ${SNAPPY_LIBRARYDIR})
find_path(SNAPPY_INCLUDE_DIR snappy.h PATHS ${SNAPPY_INCLUDEDIR})
select_library_configurations(SNAPPY)
find_package_handle_standard_args(Snappy DEFAULT_MSG SNAPPY_LIBRARY
SNAPPY_INCLUDE_DIR)
mark_as_advanced(SNAPPY_LIBRARY SNAPPY_INCLUDE_DIR)
get_filename_component(libsnappy_ext ${SNAPPY_LIBRARY} EXT)
if(libsnappy_ext STREQUAL ".a")
set(libsnappy_type STATIC)
else()
set(libsnappy_type SHARED)
endif()
if(NOT TARGET Snappy::snappy)
add_library(Snappy::snappy ${libsnappy_type} IMPORTED)
set_target_properties(Snappy::snappy PROPERTIES INTERFACE_INCLUDE_DIRECTORIES
"${SNAPPY_INCLUDE_DIR}")
set_target_properties(
Snappy::snappy PROPERTIES IMPORTED_LINK_INTERFACE_LANGUAGES "C"
IMPORTED_LOCATION "${SNAPPY_LIBRARIES}")
endif()