summaryrefslogtreecommitdiff
path: root/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
parente441cba86f9aa50c9e785d9aa45ae0a43ac5c123 (diff)
parent7cf73b7a1e4f127098cae5b8593cd1d0c675e4a4 (diff)
Merge branch 'pu/zstd' into 'master'
pu/zstd See merge request apt-team/apt!8
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