1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-04-29 15:19:44 +02:00
audacity/cmake-modules/Findlibtwolame.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

82 lines
2.0 KiB
CMake

#[=======================================================================[.rst:
Findlibtwolame
--------
Finds the libtwolame library.
Imported Targets
^^^^^^^^^^^^^^^^
This module provides the following imported targets, if found:
``libtwolame::libtwolame``
The libtwolame library
Result Variables
^^^^^^^^^^^^^^^^
This will define the following variables:
``libtwolame_FOUND``
True if the system has the libtwolame library.
``libtwolame_INCLUDE_DIRS``
Include directories needed to use libtwolame.
``libtwolame_LIBRARIES``
Libraries needed to link to libtwolame.
``libtwolame_DEFINITIONS``
Compile definitions needed to use libtwolame.
Cache Variables
^^^^^^^^^^^^^^^
The following cache variables may also be set:
``libtwolame_INCLUDE_DIR``
The directory containing ``twolame.h``.
``libtwolame_LIBRARY``
The path to the libtwolame library.
#]=======================================================================]
find_package(PkgConfig QUIET)
if(PkgConfig_FOUND)
pkg_check_modules(PC_libtwolame QUIET twolame)
endif()
find_path(libtwolame_INCLUDE_DIR
NAMES twolame.h
PATHS ${PC_libtwolame_INCLUDE_DIRS}
DOC "libtwolame include directory")
mark_as_advanced(libtwolame_INCLUDE_DIR)
find_library(libtwolame_LIBRARY
NAMES twolame
PATHS ${PC_libtwolame_LIBRARY_DIRS}
DOC "libtwolame library"
)
mark_as_advanced(libtwolame_LIBRARY)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(
libtwolame
DEFAULT_MSG
libtwolame_LIBRARY
libtwolame_INCLUDE_DIR
)
if(libtwolame_FOUND)
set(libtwolame_LIBRARIES "${libtwolame_LIBRARY}")
set(libtwolame_INCLUDE_DIRS "${libtwolame_INCLUDE_DIR}")
set(libtwolame_DEFINITIONS ${PC_libtwolame_CFLAGS_OTHER})
if(NOT TARGET libtwolame::libtwolame)
add_library(libtwolame::libtwolame UNKNOWN IMPORTED)
set_target_properties(libtwolame::libtwolame
PROPERTIES
IMPORTED_LOCATION "${libtwolame_LIBRARY}"
INTERFACE_COMPILE_OPTIONS "${PC_libtwolame_CFLAGS_OTHER}"
INTERFACE_INCLUDE_DIRECTORIES "${libtwolame_INCLUDE_DIR}"
)
endif()
endif()