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/FindGIF.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 'cmake/modules/FindGIF.cmake')
-rw-r--r-- | cmake/modules/FindGIF.cmake | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/cmake/modules/FindGIF.cmake b/cmake/modules/FindGIF.cmake new file mode 100644 index 0000000..7564a58 --- /dev/null +++ b/cmake/modules/FindGIF.cmake @@ -0,0 +1,40 @@ +#.rst: +# FindGIF +# ------- +# Finds the libgif library +# +# This will define the following variables:: +# +# GIF_FOUND - system has libgif +# GIF_INCLUDE_DIRS - the libgif include directory +# GIF_LIBRARIES - the libgif libraries +# +# and the following imported targets:: +# +# GIF::GIF - The libgif library + +find_path(GIF_INCLUDE_DIR gif_lib.h) + +include(FindPackageHandleStandardArgs) +find_library(GIF_LIBRARY NAMES gif) +find_package_handle_standard_args(GIF + REQUIRED_VARS GIF_LIBRARY GIF_INCLUDE_DIR) + +if(GIF_FOUND) + set(GIF_LIBRARIES ${GIF_LIBRARY}) + set(GIF_INCLUDE_DIRS ${GIF_INCLUDE_DIR}) + set(GIF_DEFINITIONS -DHAVE_LIBGIF=1) + + if(NOT TARGET GIF::GIF) + add_library(GIF::GIF UNKNOWN IMPORTED) + if(GIF_LIBRARY) + set_target_properties(GIF::GIF PROPERTIES + IMPORTED_LOCATION "${GIF_LIBRARY}") + endif() + set_target_properties(GIF::GIF PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "${GIF_INCLUDE_DIR}" + INTERFACE_COMPILE_DEFINITIONS HAVE_LIBGIF=1) + endif() +endif() + +mark_as_advanced(GIF_INCLUDE_DIR GIF_LIBRARY) |