FindMPEG2.cmake 1.93 KB
Newer Older
1 2 3 4 5 6
#.rst:
# FindMPEG2
# ---------
#
# Find the native MPEG2 includes and library
#
Ken Martin's avatar
Ken Martin committed
7
# This module defines
8 9 10 11 12 13 14
#
# ::
#
#   MPEG2_INCLUDE_DIR, path to mpeg2dec/mpeg2.h, etc.
#   MPEG2_LIBRARIES, the libraries required to use MPEG2.
#   MPEG2_FOUND, If false, do not try to use MPEG2.
#
Ken Martin's avatar
Ken Martin committed
15
# also defined, but not for general use are
16 17 18 19 20
#
# ::
#
#   MPEG2_mpeg2_LIBRARY, where to find the MPEG2 library.
#   MPEG2_vo_LIBRARY, where to find the vo library.
Ken Martin's avatar
Ken Martin committed
21

22 23 24 25 26 27 28 29 30 31
#=============================================================================
# Copyright 2003-2009 Kitware, Inc.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
32
# (To distribute this file outside of CMake, substitute the full
33 34
#  License text for the above reference.)

35
find_path(MPEG2_INCLUDE_DIR
36 37
  NAMES mpeg2.h mpeg2dec/mpeg2.h
  PATHS /usr/local/livid
Ken Martin's avatar
Ken Martin committed
38 39
)

40
find_library(MPEG2_mpeg2_LIBRARY mpeg2
Ken Martin's avatar
Ken Martin committed
41 42 43
  /usr/local/livid/mpeg2dec/libmpeg2/.libs
)

44
find_library( MPEG2_vo_LIBRARY vo
Ken Martin's avatar
Ken Martin committed
45 46 47
  /usr/local/livid/mpeg2dec/libvo/.libs
)

48

49
# handle the QUIETLY and REQUIRED arguments and set MPEG2_FOUND to TRUE if
50
# all listed variables are TRUE
51
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
52
FIND_PACKAGE_HANDLE_STANDARD_ARGS(MPEG2 DEFAULT_MSG MPEG2_mpeg2_LIBRARY MPEG2_INCLUDE_DIR)
53

54 55
if(MPEG2_FOUND)
  set( MPEG2_LIBRARIES ${MPEG2_mpeg2_LIBRARY}
56 57 58 59
                        ${MPEG2_vo_LIBRARY})

  #some native mpeg2 installations will depend
  #on libSDL, if found, add it in.
60
  include(${CMAKE_CURRENT_LIST_DIR}/FindSDL.cmake)
61 62
  if(SDL_FOUND)
    set( MPEG2_LIBRARIES ${MPEG2_LIBRARIES} ${SDL_LIBRARY})
63 64
  endif()
endif()
65

66
mark_as_advanced(MPEG2_INCLUDE_DIR MPEG2_mpeg2_LIBRARY MPEG2_vo_LIBRARY)