FindMPEG2.cmake 1.9 KB

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