FindMPEG2¶
Finds the native MPEG2 library (libmpeg2):
find_package(MPEG2 [...])
備註
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.
結果變數¶
該模組定義了以下變數:
MPEG2_FOUND布林值,表示是否找到 libmpeg2 程式庫。
MPEG2_LIBRARIES使用 libmpeg2 所需連結的程式庫。
快取變數¶
還可能設定以下變數:
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.
範例¶
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)