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:
8 Find the native MPEG2 includes and library
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)
37 set(MPEG2_LIBRARIES ${MPEG2_mpeg2_LIBRARY})
39 list(APPEND MPEG2_LIBRARIES ${MPEG2_vo_LIBRARY})
42 #some native mpeg2 installations will depend
43 #on libSDL, if found, add it in.
46 set( MPEG2_LIBRARIES ${MPEG2_LIBRARIES} ${SDL_LIBRARY})
50 mark_as_advanced(MPEG2_INCLUDE_DIR MPEG2_mpeg2_LIBRARY MPEG2_vo_LIBRARY)