Merge topic 'cxx-checks-tolerate-unused-arguments'
[kiteware-cmake.git] / Modules / FindMPEG2.cmake
blob763d86a85e7c1dc18fc9747d12f4c24c09706cd3
1 # Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
2 # file Copyright.txt or https://cmake.org/licensing for details.
4 #[=======================================================================[.rst:
5 FindMPEG2
6 ---------
8 Find the native MPEG2 includes and library
10 This module defines
14   MPEG2_INCLUDE_DIR, path to mpeg2dec/mpeg2.h, etc.
15   MPEG2_LIBRARIES, the libraries required to use MPEG2.
16   MPEG2_FOUND, If false, do not try to use MPEG2.
18 also defined, but not for general use are
22   MPEG2_mpeg2_LIBRARY, where to find the MPEG2 library.
23   MPEG2_vo_LIBRARY, where to find the vo library.
24 #]=======================================================================]
26 find_path(MPEG2_INCLUDE_DIR
27   NAMES mpeg2.h mpeg2dec/mpeg2.h)
29 find_library(MPEG2_mpeg2_LIBRARY mpeg2)
31 find_library(MPEG2_vo_LIBRARY vo)
33 include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
34 FIND_PACKAGE_HANDLE_STANDARD_ARGS(MPEG2 DEFAULT_MSG MPEG2_mpeg2_LIBRARY MPEG2_INCLUDE_DIR)
36 if(MPEG2_FOUND)
37   set(MPEG2_LIBRARIES ${MPEG2_mpeg2_LIBRARY})
38   if(MPEG2_vo_LIBRARY)
39     list(APPEND MPEG2_LIBRARIES ${MPEG2_vo_LIBRARY})
40   endif()
42   #some native mpeg2 installations will depend
43   #on libSDL, if found, add it in.
44   find_package(SDL)
45   if(SDL_FOUND)
46     set( MPEG2_LIBRARIES ${MPEG2_LIBRARIES} ${SDL_LIBRARY})
47   endif()
48 endif()
50 mark_as_advanced(MPEG2_INCLUDE_DIR MPEG2_mpeg2_LIBRARY MPEG2_vo_LIBRARY)