summaryrefslogtreecommitdiff
path: root/CMake/FindZstd.cmake
diff options
context:
space:
mode:
authorJulian Andres Klode <julian.klode@canonical.com>2018-03-08 09:33:39 +0100
committerJulian Andres Klode <julian.klode@canonical.com>2018-03-12 08:56:59 +0100
commit4de4200ec2717e777bbf99ed82d1b4344f078ec2 (patch)
tree0b7e2c89802a69564f45e55907b698e63a84f205 /CMake/FindZstd.cmake
parent5206249ea92fccf9e812a2d373cbd2f16c623059 (diff)
apt-pkg: Add support for zstd
zstd is a compression algorithm developed by facebook. At level 19, it is about 6% worse in size than xz -6, but decompression is multiple times faster, saving about 40% install time, especially with eatmydata on cloud instances.
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)