diff options
| author | manuel <manuel@mausz.at> | 2016-03-08 21:02:53 +0100 |
|---|---|---|
| committer | manuel <manuel@mausz.at> | 2016-03-08 21:02:53 +0100 |
| commit | 9fc8b732737f139d3e466510d75668ab45578960 (patch) | |
| tree | 76db9bf5cb8cc869be908a5ed3d6f4cca3e3608a /project/cmake/modules/FindGIF.cmake | |
| parent | b75e2659df11c23aa921d2eed83c23adc282ed27 (diff) | |
| download | kodi-pvr-build-9fc8b732737f139d3e466510d75668ab45578960.tar.gz kodi-pvr-build-9fc8b732737f139d3e466510d75668ab45578960.tar.bz2 kodi-pvr-build-9fc8b732737f139d3e466510d75668ab45578960.zip | |
sync with upstream
Diffstat (limited to 'project/cmake/modules/FindGIF.cmake')
| -rw-r--r-- | project/cmake/modules/FindGIF.cmake | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/project/cmake/modules/FindGIF.cmake b/project/cmake/modules/FindGIF.cmake new file mode 100644 index 0000000..8649bd4 --- /dev/null +++ b/project/cmake/modules/FindGIF.cmake | |||
| @@ -0,0 +1,46 @@ | |||
| 1 | #.rst: | ||
| 2 | # FindGIF | ||
| 3 | # ------- | ||
| 4 | # Finds the libgif library | ||
| 5 | # | ||
| 6 | # This will will define the following variables:: | ||
| 7 | # | ||
| 8 | # GIF_FOUND - system has libgif | ||
| 9 | # GIF_INCLUDE_DIRS - the libgif include directory | ||
| 10 | # GIF_LIBRARIES - the libgif libraries | ||
| 11 | # | ||
| 12 | # and the following imported targets:: | ||
| 13 | # | ||
| 14 | # GIF::GIF - The libgif library | ||
| 15 | |||
| 16 | find_path(GIF_INCLUDE_DIR gif_lib.h) | ||
| 17 | |||
| 18 | include(FindPackageHandleStandardArgs) | ||
| 19 | if(NOT WIN32) | ||
| 20 | find_library(GIF_LIBRARY NAMES gif) | ||
| 21 | find_package_handle_standard_args(GIF | ||
| 22 | REQUIRED_VARS GIF_LIBRARY GIF_INCLUDE_DIR) | ||
| 23 | else() | ||
| 24 | # Dynamically loaded DLL | ||
| 25 | find_package_handle_standard_args(GIF | ||
| 26 | REQUIRED_VARS GIF_INCLUDE_DIR) | ||
| 27 | endif() | ||
| 28 | |||
| 29 | if(GIF_FOUND) | ||
| 30 | set(GIF_LIBRARIES ${GIF_LIBRARY}) | ||
| 31 | set(GIF_INCLUDE_DIRS ${GIF_INCLUDE_DIR}) | ||
| 32 | set(GIF_DEFINITIONS -DHAVE_LIBGIF=1) | ||
| 33 | |||
| 34 | if(NOT TARGET GIF::GIF) | ||
| 35 | add_library(GIF::GIF UNKNOWN IMPORTED) | ||
| 36 | if(GIF_LIBRARY) | ||
| 37 | set_target_properties(GIF::GIF PROPERTIES | ||
| 38 | IMPORTED_LOCATION "${GIF_LIBRARY}") | ||
| 39 | endif() | ||
| 40 | set_target_properties(GIF::GIF PROPERTIES | ||
| 41 | INTERFACE_INCLUDE_DIRECTORIES "${GIF_INCLUDE_DIR}" | ||
| 42 | INTERFACE_COMPILE_DEFINITIONS HAVE_LIBGIF=1) | ||
| 43 | endif() | ||
| 44 | endif() | ||
| 45 | |||
| 46 | mark_as_advanced(GIF_INCLUDE_DIR GIF_LIBRARY) | ||
