2017-08-14 06:29:53 +02:00
|
|
|
# - Find zstd
|
|
|
|
# Find the zstd compression library and includes
|
|
|
|
#
|
2019-08-06 04:47:33 +02:00
|
|
|
# zstd_INCLUDE_DIRS - where to find zstd.h, etc.
|
|
|
|
# zstd_LIBRARIES - List of libraries when using zstd.
|
|
|
|
# zstd_FOUND - True if zstd found.
|
2017-08-14 06:29:53 +02:00
|
|
|
|
2019-08-06 04:47:33 +02:00
|
|
|
find_path(zstd_INCLUDE_DIRS
|
2017-08-14 06:29:53 +02:00
|
|
|
NAMES zstd.h
|
2019-08-06 04:47:33 +02:00
|
|
|
HINTS ${zstd_ROOT_DIR}/include)
|
2017-08-14 06:29:53 +02:00
|
|
|
|
2019-08-06 04:47:33 +02:00
|
|
|
find_library(zstd_LIBRARIES
|
2017-08-14 06:29:53 +02:00
|
|
|
NAMES zstd
|
2019-08-06 04:47:33 +02:00
|
|
|
HINTS ${zstd_ROOT_DIR}/lib)
|
2017-08-14 06:29:53 +02:00
|
|
|
|
|
|
|
include(FindPackageHandleStandardArgs)
|
2019-08-06 04:47:33 +02:00
|
|
|
find_package_handle_standard_args(zstd DEFAULT_MSG zstd_LIBRARIES zstd_INCLUDE_DIRS)
|
2017-08-14 06:29:53 +02:00
|
|
|
|
|
|
|
mark_as_advanced(
|
2019-08-06 04:47:33 +02:00
|
|
|
zstd_LIBRARIES
|
|
|
|
zstd_INCLUDE_DIRS)
|
|
|
|
|
|
|
|
if(zstd_FOUND AND NOT (TARGET zstd::zstd))
|
|
|
|
add_library (zstd::zstd UNKNOWN IMPORTED)
|
|
|
|
set_target_properties(zstd::zstd
|
|
|
|
PROPERTIES
|
|
|
|
IMPORTED_LOCATION ${zstd_LIBRARIES}
|
|
|
|
INTERFACE_INCLUDE_DIRECTORIES ${zstd_INCLUDE_DIRS})
|
|
|
|
endif()
|