From 06eaf7232e9a920468c0f8d74dcf2fe8b555501c Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 13 Apr 2024 14:24:36 +0200 Subject: Adding upstream version 1:10.11.6. Signed-off-by: Daniel Baumann --- cmake/FindLZ4.cmake | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 cmake/FindLZ4.cmake (limited to 'cmake/FindLZ4.cmake') diff --git a/cmake/FindLZ4.cmake b/cmake/FindLZ4.cmake new file mode 100644 index 00000000..eebd8596 --- /dev/null +++ b/cmake/FindLZ4.cmake @@ -0,0 +1,17 @@ +find_path(LZ4_INCLUDE_DIRS NAMES lz4.h) +find_library(LZ4_LIBRARIES NAMES lz4) + +if(LZ4_INCLUDE_DIRS AND EXISTS "${LZ4_INCLUDE_DIRS}/lz4.h") + file(STRINGS "${LZ4_INCLUDE_DIRS}/lz4.h" LZ4_H REGEX "^#define LZ4_VERSION_[MR]") + string(REGEX REPLACE "LZ4_VERSION" "" LZ4_H "${LZ4_H}") + string(REGEX MATCHALL "[0-9]+" LZ4_H "${LZ4_H}") + string(REGEX REPLACE ";" "." LZ4_VERSION_STRING "${LZ4_H}") +endif() + +include(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS( + LZ4 + REQUIRED_VARS LZ4_LIBRARIES LZ4_INCLUDE_DIRS + VERSION_VAR LZ4_VERSION_STRING) + +mark_as_advanced(LZ4_INCLUDE_DIRS LZ4_LIBRARIES) -- cgit v1.2.3