mirror of
https://github.com/Kitware/CMake.git
synced 2026-05-03 21:00:01 -05:00
FindMPEG, FindMPEG2: Update documentation
- Modules documentation updated and synced. - Added examples section. - FindMPEG and FindMPEG2 modules behave very much the same except that FindMPEG2 also adds the SDL library as a dependency. Added notes regarding this and recommended to use the FindMPEG2 as it also links in the SDL library at the time of writing.
This commit is contained in:
+51
-10
@@ -5,22 +5,63 @@
|
|||||||
FindMPEG
|
FindMPEG
|
||||||
--------
|
--------
|
||||||
|
|
||||||
Find the native MPEG includes and library
|
Finds the native MPEG library (libmpeg2).
|
||||||
|
|
||||||
This module defines
|
.. note::
|
||||||
|
|
||||||
::
|
This module is functionally identical to the :module:`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.
|
||||||
|
|
||||||
MPEG_INCLUDE_DIR, where to find MPEG.h, etc.
|
The ``FindMPEG2`` module additionally checks for the SDL dependency and
|
||||||
MPEG_LIBRARIES, the libraries required to use MPEG.
|
includes it in its usage requirements. For working with libmpeg2, it is
|
||||||
MPEG_FOUND, If false, do not try to use MPEG.
|
recommended to use the :module:`FindMPEG2` module instead of this one.
|
||||||
|
|
||||||
also defined, but not for general use are
|
Result Variables
|
||||||
|
^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
::
|
This module defines the following variables:
|
||||||
|
|
||||||
MPEG_mpeg2_LIBRARY, where to find the MPEG library.
|
``MPEG_FOUND``
|
||||||
MPEG_vo_LIBRARY, where to find the vo library.
|
Boolean indicating whether the libmpeg2 library is found.
|
||||||
|
``MPEG_LIBRARIES``
|
||||||
|
Libraries needed to link against to use libmpeg2.
|
||||||
|
|
||||||
|
Cache Variables
|
||||||
|
^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
The following cache variables may be also set:
|
||||||
|
|
||||||
|
``MPEG_INCLUDE_DIR``
|
||||||
|
The directory containing the ``mpeg2.h`` and related headers needed to use
|
||||||
|
libmpeg2 library.
|
||||||
|
``MPEG_mpeg2_LIBRARY``
|
||||||
|
The path to the libmpeg2 library.
|
||||||
|
``MPEG_vo_LIBRARY``
|
||||||
|
The path to the vo (Video Out) library.
|
||||||
|
|
||||||
|
Examples
|
||||||
|
^^^^^^^^
|
||||||
|
|
||||||
|
Finding libmpeg2 library and creating an imported interface target for linking
|
||||||
|
it to a project target:
|
||||||
|
|
||||||
|
.. code-block:: cmake
|
||||||
|
|
||||||
|
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)
|
||||||
#]=======================================================================]
|
#]=======================================================================]
|
||||||
|
|
||||||
find_path(MPEG_INCLUDE_DIR
|
find_path(MPEG_INCLUDE_DIR
|
||||||
|
|||||||
+47
-12
@@ -5,22 +5,58 @@
|
|||||||
FindMPEG2
|
FindMPEG2
|
||||||
---------
|
---------
|
||||||
|
|
||||||
Find the native MPEG2 includes and library
|
Finds the native MPEG2 library (libmpeg2).
|
||||||
|
|
||||||
This module defines
|
.. 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.
|
||||||
|
|
||||||
MPEG2_INCLUDE_DIR, path to mpeg2dec/mpeg2.h, etc.
|
Result Variables
|
||||||
MPEG2_LIBRARIES, the libraries required to use MPEG2.
|
^^^^^^^^^^^^^^^^
|
||||||
MPEG2_FOUND, If false, do not try to use MPEG2.
|
|
||||||
|
|
||||||
also defined, but not for general use are
|
This module defines the following variables:
|
||||||
|
|
||||||
::
|
``MPEG2_FOUND``
|
||||||
|
Boolean indicating whether the libmpeg2 library is found.
|
||||||
|
``MPEG2_LIBRARIES``
|
||||||
|
Libraries needed to link against to use libmpeg2.
|
||||||
|
|
||||||
MPEG2_mpeg2_LIBRARY, where to find the MPEG2 library.
|
Cache Variables
|
||||||
MPEG2_vo_LIBRARY, where to find the vo library.
|
^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
The following cache variables may be also set:
|
||||||
|
|
||||||
|
``MPEG2_INCLUDE_DIR``
|
||||||
|
The directory containing the ``mpeg2.h`` and related headers needed to use
|
||||||
|
libmpeg2 library.
|
||||||
|
``MPEG2_mpeg2_LIBRARY``
|
||||||
|
The path to the libmpeg2 library.
|
||||||
|
``MPEG2_vo_LIBRARY``
|
||||||
|
The path to the vo (Video Out) library.
|
||||||
|
|
||||||
|
Examples
|
||||||
|
^^^^^^^^
|
||||||
|
|
||||||
|
Finding libmpeg2 library and creating an imported interface target for linking
|
||||||
|
it to a project target:
|
||||||
|
|
||||||
|
.. code-block:: cmake
|
||||||
|
|
||||||
|
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)
|
||||||
#]=======================================================================]
|
#]=======================================================================]
|
||||||
|
|
||||||
find_path(MPEG2_INCLUDE_DIR
|
find_path(MPEG2_INCLUDE_DIR
|
||||||
@@ -39,8 +75,7 @@ if(MPEG2_FOUND)
|
|||||||
list(APPEND MPEG2_LIBRARIES ${MPEG2_vo_LIBRARY})
|
list(APPEND MPEG2_LIBRARIES ${MPEG2_vo_LIBRARY})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
#some native mpeg2 installations will depend
|
# Some native mpeg2 installations will depend on libSDL. If found, add it in.
|
||||||
#on libSDL, if found, add it in.
|
|
||||||
find_package(SDL)
|
find_package(SDL)
|
||||||
if(SDL_FOUND)
|
if(SDL_FOUND)
|
||||||
set( MPEG2_LIBRARIES ${MPEG2_LIBRARIES} ${SDL_LIBRARY})
|
set( MPEG2_LIBRARIES ${MPEG2_LIBRARIES} ${SDL_LIBRARY})
|
||||||
|
|||||||
Reference in New Issue
Block a user