FindMPEG.cmake 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. # Distributed under the OSI-approved BSD 3-Clause License. See accompanying
  2. # file Copyright.txt or https://cmake.org/licensing for details.
  3. #.rst:
  4. # FindMPEG
  5. # --------
  6. #
  7. # Find the native MPEG includes and library
  8. #
  9. # This module defines
  10. #
  11. # ::
  12. #
  13. # MPEG_INCLUDE_DIR, where to find MPEG.h, etc.
  14. # MPEG_LIBRARIES, the libraries required to use MPEG.
  15. # MPEG_FOUND, If false, do not try to use MPEG.
  16. #
  17. # also defined, but not for general use are
  18. #
  19. # ::
  20. #
  21. # MPEG_mpeg2_LIBRARY, where to find the MPEG library.
  22. # MPEG_vo_LIBRARY, where to find the vo library.
  23. find_path(MPEG_INCLUDE_DIR
  24. NAMES mpeg2.h mpeg2dec/mpeg2.h mpeg2dec/include/video_out.h)
  25. find_library(MPEG_mpeg2_LIBRARY mpeg2)
  26. find_library(MPEG_vo_LIBRARY vo)
  27. include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
  28. FIND_PACKAGE_HANDLE_STANDARD_ARGS(MPEG DEFAULT_MSG MPEG_mpeg2_LIBRARY MPEG_INCLUDE_DIR)
  29. if(MPEG_FOUND)
  30. set( MPEG_LIBRARIES ${MPEG_mpeg2_LIBRARY} )
  31. if(MPEG_vo_LIBRARY)
  32. list(APPEND MPEG2_LIBRARIES ${MPEG_vo_LIBRARY})
  33. endif()
  34. endif()
  35. mark_as_advanced(MPEG_INCLUDE_DIR MPEG_mpeg2_LIBRARY MPEG_vo_LIBRARY)