summaryrefslogtreecommitdiff
path: root/CMakeModules/Findzstd.cmake
diff options
context:
space:
mode:
authorGravatar liamwhite2023-01-02 13:45:36 -0500
committerGravatar GitHub2023-01-02 13:45:36 -0500
commita7e610403df97203a2ab5c7eb53c7d11960b3d79 (patch)
treec17a3f5362f35d7ffbcc46c881f1b656e71db81b /CMakeModules/Findzstd.cmake
parentMerge pull request #9541 from abouvier/cmake-option (diff)
parentcmake: move find-modules to root cmake dir (diff)
downloadyuzu-a7e610403df97203a2ab5c7eb53c7d11960b3d79.tar.gz
yuzu-a7e610403df97203a2ab5c7eb53c7d11960b3d79.tar.xz
yuzu-a7e610403df97203a2ab5c7eb53c7d11960b3d79.zip
Merge pull request #9542 from abouvier/cmake-module-path
cmake: move find-modules to root cmake dir
Diffstat (limited to 'CMakeModules/Findzstd.cmake')
-rw-r--r--CMakeModules/Findzstd.cmake26
1 files changed, 26 insertions, 0 deletions
diff --git a/CMakeModules/Findzstd.cmake b/CMakeModules/Findzstd.cmake
new file mode 100644
index 000000000..ae3ea0865
--- /dev/null
+++ b/CMakeModules/Findzstd.cmake
@@ -0,0 +1,26 @@
1# SPDX-FileCopyrightText: 2022 yuzu Emulator Project
2# SPDX-License-Identifier: GPL-2.0-or-later
3
4include(FindPackageHandleStandardArgs)
5
6find_package(zstd QUIET CONFIG)
7if (zstd_CONSIDERED_CONFIGS)
8 find_package_handle_standard_args(zstd CONFIG_MODE)
9else()
10 find_package(PkgConfig QUIET)
11 pkg_search_module(ZSTD QUIET IMPORTED_TARGET libzstd)
12 find_package_handle_standard_args(zstd
13 REQUIRED_VARS ZSTD_LINK_LIBRARIES
14 VERSION_VAR ZSTD_VERSION
15 )
16endif()
17
18if (zstd_FOUND AND NOT TARGET zstd::zstd)
19 if (TARGET zstd::libzstd_shared)
20 add_library(zstd::zstd ALIAS zstd::libzstd_shared)
21 elseif (TARGET zstd::libzstd_static)
22 add_library(zstd::zstd ALIAS zstd::libzstd_static)
23 else()
24 add_library(zstd::zstd ALIAS PkgConfig::ZSTD)
25 endif()
26endif()