mirror of
https://github.com/Kitware/CMake.git
synced 2025-12-30 02:10:10 -06:00
This marks all `<PACKAGENAME>_FOUND` result variables as deprecated where possible (for `<PackageName>` find modules) to make it clearer which variable to use. In CMake 3.3, the FindPackageHandleStandardArgs module was refactored to set both `<PackageName>_FOUND` and uppercase `<PACKAGENAME>_FOUND` result variables to the same values. Before that, the FOUND_VAR argument could be used to set the result variable. * FindMatlab: Uppercased MATLAB_FOUND is not mentioned as it was never documented. * Documentation for FindPythonInterp and FindPythonLibs modules synced accordingly to their deprecation (3.12 instead of 4.2). * OPENGL_FOUND: deprecation version synced with other find modules. * DevIL_FOUND was introduced in CMake 3.8. The uppercased variant not mentioned as it was previously never documented. Fixes: #27242
89 lines
2.5 KiB
CMake
89 lines
2.5 KiB
CMake
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
|
# file LICENSE.rst or https://cmake.org/licensing for details.
|
|
|
|
#[=======================================================================[.rst:
|
|
FindMPEG
|
|
--------
|
|
|
|
Finds the native MPEG library (libmpeg2):
|
|
|
|
.. code-block:: cmake
|
|
|
|
find_package(MPEG [...])
|
|
|
|
.. 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.
|
|
|
|
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 :module:`FindMPEG2` module instead of this one.
|
|
|
|
Result Variables
|
|
^^^^^^^^^^^^^^^^
|
|
|
|
This module defines the following variables:
|
|
|
|
``MPEG_FOUND``
|
|
Boolean indicating whether the libmpeg2 library was found.
|
|
``MPEG_LIBRARIES``
|
|
Libraries needed to link against to use libmpeg2.
|
|
|
|
Cache Variables
|
|
^^^^^^^^^^^^^^^
|
|
|
|
The following cache variables may also be 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
|
|
NAMES mpeg2.h mpeg2dec/mpeg2.h mpeg2dec/include/video_out.h)
|
|
|
|
find_library(MPEG_mpeg2_LIBRARY mpeg2)
|
|
|
|
find_library(MPEG_vo_LIBRARY vo)
|
|
|
|
include(FindPackageHandleStandardArgs)
|
|
find_package_handle_standard_args(MPEG DEFAULT_MSG MPEG_mpeg2_LIBRARY MPEG_INCLUDE_DIR)
|
|
|
|
if(MPEG_FOUND)
|
|
set( MPEG_LIBRARIES ${MPEG_mpeg2_LIBRARY} )
|
|
if(MPEG_vo_LIBRARY)
|
|
list(APPEND MPEG2_LIBRARIES ${MPEG_vo_LIBRARY})
|
|
endif()
|
|
endif()
|
|
|
|
mark_as_advanced(MPEG_INCLUDE_DIR MPEG_mpeg2_LIBRARY MPEG_vo_LIBRARY)
|