1#
2# Find an MPEG2 library
3#
4# This file is used to manage using either a natively provided MPEG2
5# library or the one in v3p if provided.
6#
7#
8# As per the standard scheme the following definitions are used
9# MPEG2_INCLUDE_DIR - where to find mpeg2dec/mpeg2.h
10# MPEG2_LIBRARIES   - the set of libraries to include to use MPEG2.
11# MPEG2_FOUND       - TRUE, if available somewhere on the system.
12
13# Additionally
14# VXL_USING_NATIVE_MPEG2  - True if we are using a MPEG2 library provided outside vxl (or v3p)
15
16# If this FORCE variable is unset or is FALSE, try to find a native library.
17if( VXL_FORCE_V3P_MPEG2 )
18else()
19  find_package( MPEG2 QUIET )
20endif()
21
22if( MPEG2_FOUND )
23
24  set(VXL_USING_NATIVE_MPEG2 "YES")
25
26else()
27
28  #
29  # At some point, in a "release" version, it is possible that someone
30  # will not have the v3p mpeg2 library
31  #
32
33  if(EXISTS ${VXL_ROOT_SOURCE_DIR}/v3p/mpeg2/include/mpeg2dec/mpeg2.h)
34
35    set( MPEG2_FOUND "YES" )
36    set( MPEG2_LIBRARIES mpeg2 vo )
37    set( MPEG2_INCLUDE_DIR
38      ${VXL_ROOT_SOURCE_DIR}/v3p/mpeg2/include
39      # use of the following is deprecated
40      # it is better to use #include <mpeg2dec/mpeg2.h> in client code
41      ${VXL_ROOT_SOURCE_DIR}/v3p/mpeg2/include/mpeg2dec
42    )
43    set( MPEG2_INSTALL_INCLUDE_DIR
44      ${CMAKE_INSTALL_PREFIX}/include/vxl/v3p/mpeg2/include
45      # use of the following is deprecated
46      # it is better to use #include <mpeg2dec/mpeg2.h> in client code
47      ${CMAKE_INSTALL_PREFIX}/include/vxl/v3p/mpeg2/include/mpeg2dec
48    )
49
50  endif()
51
52endif()
53