Imported Upstream version 2.8.10.2
[platform/upstream/cmake.git] / Modules / FindMPEG2.cmake
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 #=============================================================================
11 # Copyright 2003-2009 Kitware, Inc.
12 #
13 # Distributed under the OSI-approved BSD License (the "License");
14 # see accompanying file Copyright.txt for details.
15 #
16 # This software is distributed WITHOUT ANY WARRANTY; without even the
17 # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 # See the License for more information.
19 #=============================================================================
20 # (To distribute this file outside of CMake, substitute the full
21 #  License text for the above reference.)
22
23 find_path(MPEG2_INCLUDE_DIR
24   NAMES mpeg2.h mpeg2dec/mpeg2.h
25   PATHS /usr/local/livid
26 )
27
28 find_library(MPEG2_mpeg2_LIBRARY mpeg2
29   /usr/local/livid/mpeg2dec/libmpeg2/.libs
30 )
31
32 find_library( MPEG2_vo_LIBRARY vo
33   /usr/local/livid/mpeg2dec/libvo/.libs
34 )
35
36
37 # handle the QUIETLY and REQUIRED arguments and set MPEG2_FOUND to TRUE if
38 # all listed variables are TRUE
39 include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
40 FIND_PACKAGE_HANDLE_STANDARD_ARGS(MPEG2 DEFAULT_MSG MPEG2_mpeg2_LIBRARY MPEG2_INCLUDE_DIR)
41
42 if(MPEG2_FOUND)
43   set( MPEG2_LIBRARIES ${MPEG2_mpeg2_LIBRARY}
44                         ${MPEG2_vo_LIBRARY})
45
46   #some native mpeg2 installations will depend
47   #on libSDL, if found, add it in.
48   include( FindSDL )
49   if(SDL_FOUND)
50     set( MPEG2_LIBRARIES ${MPEG2_LIBRARIES} ${SDL_LIBRARY})
51   endif()
52 endif()
53
54 mark_as_advanced(MPEG2_INCLUDE_DIR MPEG2_mpeg2_LIBRARY MPEG2_vo_LIBRARY)