summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Wick <markus@selfnet.de>2020-05-09 11:11:18 +0200
committerMarkus Wick <markus@selfnet.de>2020-05-09 12:43:42 +0200
commitc5c60e04ddae03165dc05b7f4a53969662b28cc3 (patch)
treea36dacbb21f4f2dd5361f48b4817b79e89276572
parentMerge pull request #3839 from Morph1984/r8g8ui (diff)
downloadyuzu-c5c60e04ddae03165dc05b7f4a53969662b28cc3.tar
yuzu-c5c60e04ddae03165dc05b7f4a53969662b28cc3.tar.gz
yuzu-c5c60e04ddae03165dc05b7f4a53969662b28cc3.tar.bz2
yuzu-c5c60e04ddae03165dc05b7f4a53969662b28cc3.tar.lz
yuzu-c5c60e04ddae03165dc05b7f4a53969662b28cc3.tar.xz
yuzu-c5c60e04ddae03165dc05b7f4a53969662b28cc3.tar.zst
yuzu-c5c60e04ddae03165dc05b7f4a53969662b28cc3.zip
-rw-r--r--externals/find-modules/Findzstd.cmake14
1 files changed, 14 insertions, 0 deletions
diff --git a/externals/find-modules/Findzstd.cmake b/externals/find-modules/Findzstd.cmake
index cd0158b0c..539abbafc 100644
--- a/externals/find-modules/Findzstd.cmake
+++ b/externals/find-modules/Findzstd.cmake
@@ -11,12 +11,26 @@ find_library(zstd_LIBRARY
PATHS ${PC_zstd_LIBRARY_DIRS}
)
+if(zstd_INCLUDE_DIR)
+ file(STRINGS "${zstd_INCLUDE_DIR}/zstd.h" _zstd_version_lines
+ REGEX "#define[ \t]+ZSTD_VERSION_(MAJOR|MINOR|RELEASE)")
+ string(REGEX REPLACE ".*ZSTD_VERSION_MAJOR *\([0-9]*\).*" "\\1" _zstd_version_major "${_zstd_version_lines}")
+ string(REGEX REPLACE ".*ZSTD_VERSION_MINOR *\([0-9]*\).*" "\\1" _zstd_version_minor "${_zstd_version_lines}")
+ string(REGEX REPLACE ".*ZSTD_VERSION_RELEASE *\([0-9]*\).*" "\\1" _zstd_version_release "${_zstd_version_lines}")
+ set(zstd_VERSION "${_zstd_version_major}.${_zstd_version_minor}.${_zstd_version_release}")
+ unset(_zstd_version_major)
+ unset(_zstd_version_minor)
+ unset(_zstd_version_release)
+ unset(_zstd_version_lines)
+endif()
+
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(zstd
FOUND_VAR zstd_FOUND
REQUIRED_VARS
zstd_LIBRARY
zstd_INCLUDE_DIR
+ zstd_VERSION
VERSION_VAR zstd_VERSION
)