FindMPEG2¶
Finds the native MPEG2 library (libmpeg2):
find_package(MPEG2 [...])
Note
Depending on how the native libmpeg2 library is built and installed, it may depend on the SDL (Simple DirectMedia Layer) library. If SDL is found, this module includes it in its usage requirements when used.
Result Variables¶
This module defines the following variables:
MPEG2_FOUNDBoolean indicating whether the libmpeg2 library was found.
MPEG2_LIBRARIESLibraries needed to link against to use libmpeg2.
Cache Variables¶
The following cache variables may also be set:
MPEG2_INCLUDE_DIRThe directory containing the
mpeg2.hand related headers needed to use libmpeg2 library.MPEG2_mpeg2_LIBRARYThe path to the libmpeg2 library.
MPEG2_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(MPEG2)
if(MPEG2_FOUND AND NOT TARGET MPEG2::MPEG2)
add_library(MPEG2::MPEG2 INTERFACE IMPORTED)
set_target_properties(
MPEG2::MPEG2
PROPERTIES
INTERFACE_LINK_LIBRARIES "${MPEG2_LIBRARIES}"
INTERFACE_INCLUDE_DIRECTORIES "${MPEG2_INCLUDE_DIR}"
)
endif()
target_link_libraries(project_target PRIVATE MPEG2::MPEG2)