summaryrefslogtreecommitdiff
path: root/CMake/FindZstd.cmake
diff options
context:
space:
mode:
authorJulian Andres Klode <jak@debian.org>2018-04-15 18:57:53 +0000
committerJulian Andres Klode <jak@debian.org>2018-04-15 18:57:53 +0000
commit1cbb4c95f3fdd0872a7f1cb0f970f50a68c13959 (patch)
treea4d862020a09309efa6801d791216649368bd263 /CMake/FindZstd.cmake
parente441cba86f9aa50c9e785d9aa45ae0a43ac5c123 (diff)
parent7cf73b7a1e4f127098cae5b8593cd1d0c675e4a4 (diff)
Merge branch 'pu/zstd' into 'master'
pu/zstd See merge request apt-team/apt!8
Diffstat (limited to 'CMake/FindZstd.cmake')
-rw-r--r--CMake/FindZstd.cmake25
1 files changed, 25 insertions, 0 deletions
diff --git a/CMake/FindZstd.cmake b/CMake/FindZstd.cmake
new file mode 100644
index 000000000..68118049b
--- /dev/null
+++ b/CMake/FindZstd.cmake
@@ -0,0 +1,25 @@
+# - Try to find ZSTD
+# Once done, this will define
+#
+# ZSTD_FOUND - system has ZSTD
+# ZSTD_INCLUDE_DIRS - the ZSTD include directories
+# ZSTD_LIBRARIES - the ZSTD library
+find_package(PkgConfig)
+
+pkg_check_modules(ZSTD_PKGCONF libzstd)
+
+find_path(ZSTD_INCLUDE_DIRS
+ NAMES zstd.h
+ PATHS ${ZSTD_PKGCONF_INCLUDE_DIRS}
+)
+
+
+find_library(ZSTD_LIBRARIES
+ NAMES zstd
+ PATHS ${ZSTD_PKGCONF_LIBRARY_DIRS}
+)
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(ZSTD DEFAULT_MSG ZSTD_INCLUDE_DIRS ZSTD_LIBRARIES)
+
+mark_as_advanced(ZSTD_INCLUDE_DIRS ZSTD_LIBRARIES)