1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-04-29 23:29:41 +02:00
audacity/cmake-modules/FindOgg.cmake
Be b1549dd13e
CMake: replace Conan with find_package and add find modules
Also, necessarily coupled with this:
* add CMakeLists.txt for vendored libnyquist
* fix SoundTouch header include paths
* move nyq_reformat_aud_do_response function
* handle portSMF headers installed to portsmf or portSMF

Signed-off-by: Be <be@mixxx.org>
2021-08-16 13:22:01 -05:00

78 lines
1.8 KiB
CMake

# Copyright (C) 2001-2020 Mixxx Development Team
# Distributed under the GNU General Public Licence (GPL) version 2 or any later
# later version. See the LICENSE.txt file for details.
#[=======================================================================[.rst:
FindOgg
-------
Finds the Ogg library.
Result Variables
^^^^^^^^^^^^^^^^
This will define the following variables:
``Ogg_FOUND``
True if the system has the Ogg library.
``Ogg_INCLUDE_DIRS``
Include directories needed to use Ogg.
``Ogg_LIBRARIES``
Libraries needed to link to Ogg.
``Ogg_DEFINITIONS``
Compile definitions needed to use Ogg.
Cache Variables
^^^^^^^^^^^^^^^
The following cache variables may also be set:
``Ogg_INCLUDE_DIR``
The directory containing ``ogg/ogg.h``.
``Ogg_LIBRARY``
The path to the Ogg library.
#]=======================================================================]
find_package(PkgConfig QUIET)
if(PkgConfig_FOUND)
pkg_check_modules(PC_Ogg QUIET ogg)
endif()
find_path(Ogg_INCLUDE_DIR
NAMES ogg/ogg.h
PATHS ${PC_Ogg_INCLUDE_DIRS}
DOC "Ogg include directory"
)
mark_as_advanced(Ogg_INCLUDE_DIR)
find_library(Ogg_LIBRARY
NAMES ogg
PATHS ${PC_Ogg_LIBRARY_DIRS}
DOC "Ogg library"
)
mark_as_advanced(Ogg_LIBRARY)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(
Ogg
REQUIRED_VARS
Ogg_INCLUDE_DIR
Ogg_LIBRARY
)
if(Ogg_FOUND)
set(Ogg_LIBRARIES ${Ogg_LIBRARY})
set(Ogg_INCLUDE_DIRS ${Ogg_INCLUDE_DIR})
set(Ogg_DEFINITIONS ${PC_Ogg_CFLAGS_OTHER})
if(NOT TARGET Ogg::ogg)
add_library(Ogg::ogg UNKNOWN IMPORTED)
set_target_properties(Ogg::ogg
PROPERTIES
IMPORTED_LOCATION "${Ogg_LIBRARY}"
INTERFACE_COMPILE_OPTIONS "${PC_Ogg_CFLAGS_OTHER}"
INTERFACE_INCLUDE_DIRECTORIES "${Ogg_INCLUDE_DIR}"
)
endif()
endif()