summaryrefslogtreecommitdiff
path: root/CMake
diff options
context:
space:
mode:
Diffstat (limited to 'CMake')
-rw-r--r--CMake/FindZstd.cmake25
-rw-r--r--CMake/config.h.in3
2 files changed, 28 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)
diff --git a/CMake/config.h.in b/CMake/config.h.in
index cfaa14ed1..bd0da8649 100644
--- a/CMake/config.h.in
+++ b/CMake/config.h.in
@@ -17,6 +17,9 @@
/* Define if we have the lz4 library for lz4 */
#cmakedefine HAVE_LZ4
+/* Define if we have the zstd library for zst */
+#cmakedefine HAVE_ZSTD
+
/* Define if we have the udev library */
#cmakedefine HAVE_UDEV