diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-10 18:07:22 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-10 18:07:22 +0000 |
commit | c04dcc2e7d834218ef2d4194331e383402495ae1 (patch) | |
tree | 7333e38d10d75386e60f336b80c2443c1166031d /cmake/modules/FindLzo2.cmake | |
parent | Initial commit. (diff) | |
download | kodi-c04dcc2e7d834218ef2d4194331e383402495ae1.tar.xz kodi-c04dcc2e7d834218ef2d4194331e383402495ae1.zip |
Adding upstream version 2:20.4+dfsg.upstream/2%20.4+dfsg
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | cmake/modules/FindLzo2.cmake | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/cmake/modules/FindLzo2.cmake b/cmake/modules/FindLzo2.cmake new file mode 100644 index 0000000..5e3e686 --- /dev/null +++ b/cmake/modules/FindLzo2.cmake @@ -0,0 +1,37 @@ +#.rst: +# FindLzo2 +# -------- +# Finds the Lzo2 library +# +# This will define the following variables:: +# +# LZO2_FOUND - system has Lzo2 +# LZO2_INCLUDE_DIRS - the Lzo2 include directory +# LZO2_LIBRARIES - the Lzo2 libraries +# +# and the following imported targets:: +# +# Lzo2::Lzo2 - The Lzo2 library + +find_path(LZO2_INCLUDE_DIR NAMES lzo1x.h + PATH_SUFFIXES lzo) + +find_library(LZO2_LIBRARY NAMES lzo2 liblzo2) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(Lzo2 + REQUIRED_VARS LZO2_LIBRARY LZO2_INCLUDE_DIR) + +if(LZO2_FOUND) + set(LZO2_LIBRARIES ${LZO2_LIBRARY}) + set(LZO2_INCLUDE_DIRS ${LZO2_INCLUDE_DIR}) + + if(NOT TARGET Lzo2::Lzo2) + add_library(Lzo2::Lzo2 UNKNOWN IMPORTED) + set_target_properties(Lzo2::Lzo2 PROPERTIES + IMPORTED_LOCATION "${LZO2_LIBRARY}" + INTERFACE_INCLUDE_DIRECTORIES "${LZO2_INCLUDE_DIR}") + endif() +endif() + +mark_as_advanced(LZO2_INCLUDE_DIR LZO2_LIBRARY) |