FindMPEG¶
Finds the native MPEG library (libmpeg2).
Note
This module is functionally identical to the FindMPEG2 module, which
also finds the libmpeg2 library. Both modules were introduced in the past to
provide flexibility in handling potential differences in future versions of
the MPEG library and to maintain backward compatibility across CMake releases.
The FindMPEG2 module additionally checks for the SDL dependency and
includes it in its usage requirements. For working with libmpeg2, it is
recommended to use the FindMPEG2 module instead of this one.
Result Variables¶
This module defines the following variables:
MPEG_FOUNDBoolean indicating whether the libmpeg2 library is found.
MPEG_LIBRARIESLibraries needed to link against to use libmpeg2.
Cache Variables¶
The following cache variables may be also set:
MPEG_INCLUDE_DIRThe directory containing the
mpeg2.hand related headers needed to use libmpeg2 library.MPEG_mpeg2_LIBRARYThe path to the libmpeg2 library.
MPEG_vo_LIBRARYThe path to the vo (Video Out) library.
Examples¶
Finding libmpeg2 library and creating an imported interface target for linking it to a project target:
find_package(MPEG)
if(MPEG_FOUND AND NOT TARGET MPEG::MPEG)
add_library(MPEG::MPEG INTERFACE IMPORTED)
set_target_properties(
MPEG::MPEG
PROPERTIES
INTERFACE_LINK_LIBRARIES "${MPEG_LIBRARIES}"
INTERFACE_INCLUDE_DIRECTORIES "${MPEG_INCLUDE_DIR}"
)
endif()
target_link_libraries(project_target PRIVATE MPEG::MPEG)