katie/cmake/modules/FindZSTD.cmake
Ivailo Monev e9cbcbb50c remove <MODULE>_FIND_QUIETLY overrides from CMake modules
since find_package_handle_standard_args() is used and no status messages
are printed by the modules there is no reason to set <MODULE>_FIND_QUIETLY
variable (which should be prefixed with the actual module name, not upper
case)
2020-02-19 20:57:22 +00:00

38 lines
958 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.
if(NOT WIN32)
include(FindPkgConfig)
pkg_check_modules(PC_ZSTD QUIET libzstd)
set(ZSTD_INCLUDES ${PC_ZSTD_INCLUDE_DIRS})
set(ZSTD_LIBRARIES ${PC_ZSTD_LIBRARIES})
endif()
if(NOT ZSTD_INCLUDES OR NOT ZSTD_LIBRARIES)
find_path(ZSTD_INCLUDES
NAMES zstd.h
HINTS $ENV{ZSTDDIR}/include
)
find_library(ZSTD_LIBRARIES
NAMES zstd
HINTS $ENV{ZSTDDIR}/lib
)
endif()
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)