katie/cmake/modules/FindZSTD.cmake
Ivailo Monev 79143d37cf lookup the full library paths from modules
now the BSD workaround is needed only for CMake to not fail to find
packages from the modules it provides, not for the modules Katie
provides

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
2020-12-01 17:45:03 +00:00

31 lines
791 B
CMake

# - Try to find ZSTD
# Once done this will define
#
# ZSTD_FOUND - system has ZSTD
# ZSTD_INCLUDES - the ZSTD include directory
# ZSTD_LIBRARIES - the libraries needed to use ZSTD
#
# Copyright (c) 2015-2020, Ivailo Monev, <xakepa10@gmail.com>
#
# Redistribution and use is allowed according to the terms of the BSD license.
include(FindPkgConfig)
pkg_check_modules(PC_ZSTD QUIET libzstd)
find_path(ZSTD_INCLUDES
NAMES zstd.h
HINTS $ENV{ZSTDDIR}/include ${PC_ZSTD_INCLUDEDIR}
)
find_library(ZSTD_LIBRARIES
NAMES zstd
HINTS $ENV{ZSTDDIR}/lib ${PC_ZSTD_LIBDIR}
)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(ZSTD
VERSION_VAR PC_ZSTD_VERSION
REQUIRED_VARS ZSTD_LIBRARIES ZSTD_INCLUDES
)
mark_as_advanced(ZSTD_INCLUDES ZSTD_LIBRARIES)