FindMPEG2.cmake 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. #.rst:
  2. # FindMPEG2
  3. # ---------
  4. #
  5. # Find the native MPEG2 includes and library
  6. #
  7. # This module defines
  8. #
  9. # ::
  10. #
  11. # MPEG2_INCLUDE_DIR, path to mpeg2dec/mpeg2.h, etc.
  12. # MPEG2_LIBRARIES, the libraries required to use MPEG2.
  13. # MPEG2_FOUND, If false, do not try to use MPEG2.
  14. #
  15. # also defined, but not for general use are
  16. #
  17. # ::
  18. #
  19. # MPEG2_mpeg2_LIBRARY, where to find the MPEG2 library.
  20. # MPEG2_vo_LIBRARY, where to find the vo library.
  21. #=============================================================================
  22. # Copyright 2003-2009 Kitware, Inc.
  23. #
  24. # Distributed under the OSI-approved BSD License (the "License");
  25. # see accompanying file Copyright.txt for details.
  26. #
  27. # This software is distributed WITHOUT ANY WARRANTY; without even the
  28. # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  29. # See the License for more information.
  30. #=============================================================================
  31. # (To distribute this file outside of CMake, substitute the full
  32. # License text for the above reference.)
  33. find_path(MPEG2_INCLUDE_DIR
  34. NAMES mpeg2.h mpeg2dec/mpeg2.h
  35. PATHS /usr/local/livid
  36. )
  37. find_library(MPEG2_mpeg2_LIBRARY mpeg2
  38. /usr/local/livid/mpeg2dec/libmpeg2/.libs
  39. )
  40. find_library( MPEG2_vo_LIBRARY vo
  41. /usr/local/livid/mpeg2dec/libvo/.libs
  42. )
  43. # handle the QUIETLY and REQUIRED arguments and set MPEG2_FOUND to TRUE if
  44. # all listed variables are TRUE
  45. include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
  46. FIND_PACKAGE_HANDLE_STANDARD_ARGS(MPEG2 DEFAULT_MSG MPEG2_mpeg2_LIBRARY MPEG2_INCLUDE_DIR)
  47. if(MPEG2_FOUND)
  48. set( MPEG2_LIBRARIES ${MPEG2_mpeg2_LIBRARY}
  49. ${MPEG2_vo_LIBRARY})
  50. #some native mpeg2 installations will depend
  51. #on libSDL, if found, add it in.
  52. include(${CMAKE_CURRENT_LIST_DIR}/FindSDL.cmake)
  53. if(SDL_FOUND)
  54. set( MPEG2_LIBRARIES ${MPEG2_LIBRARIES} ${SDL_LIBRARY})
  55. endif()
  56. endif()
  57. mark_as_advanced(MPEG2_INCLUDE_DIR MPEG2_mpeg2_LIBRARY MPEG2_vo_LIBRARY)