31 lines
991 B
Diff
31 lines
991 B
Diff
|
From 69afd09aee3727f2804e1b063ef50800b22c6bb9 Mon Sep 17 00:00:00 2001
|
||
|
From: =?UTF-8?q?Patrik=20Novotn=C3=BD?= <panovotn@redhat.com>
|
||
|
Date: Wed, 1 Jul 2020 11:18:08 +0200
|
||
|
Subject: [PATCH] Use pkg-config to find ZSTD
|
||
|
|
||
|
[Retrieved from: https://github.com/nmoinvaz/minizip/pull/509]
|
||
|
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
|
||
|
---
|
||
|
CMakeLists.txt | 8 +++++++-
|
||
|
1 file changed, 7 insertions(+), 1 deletion(-)
|
||
|
|
||
|
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||
|
index a6deb4ce..987e7947 100644
|
||
|
--- a/CMakeLists.txt
|
||
|
+++ b/CMakeLists.txt
|
||
|
@@ -115,7 +115,13 @@ endif()
|
||
|
# Check if zstd installation is present
|
||
|
if(MZ_ZSTD)
|
||
|
if(NOT ZSTD_FORCE_FETCH)
|
||
|
- find_package(ZSTD QUIET)
|
||
|
+ find_package(PkgConfig)
|
||
|
+ if(PKGCONFIG_FOUND)
|
||
|
+ pkg_check_modules(ZSTD libzstd)
|
||
|
+ endif()
|
||
|
+ if(NOT ZSTD_FOUND)
|
||
|
+ find_package(ZSTD QUIET)
|
||
|
+ endif()
|
||
|
endif()
|
||
|
if(ZSTD_FOUND AND NOT ZSTD_FORCE_FETCH)
|
||
|
message(STATUS "Using ZSTD")
|