Files
tenacity/cmake-modules/Findlibtwolame.cmake
Be 95ed3e77c2 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

===========================================================

Cherry picked from Tenacity commit b1549dd. This commit has been
modified to apply to Saucedacity in the following ways:

* Soxr::soxr and EXPAT::EXPAT not needed for target "Saucedacity" but
  they are needed for lib-math and lib-xml, respectively.

* Our libraries have been updated appropriately.

* libnyquist's new CMakeLists.txt was slightly modified to remove a
  dependency for wxWidgets. libnyquist appears to be written in C and
  therefore does not depend on wxWidgets (it can't, really).

* Don't use wx-config to set the version. CMake generation succeeds but
  building fails.

Signed-off-by: Avery King <avery98@pm.me>
Co-authored-by: Be <be@mixxx.org>
2022-11-20 10:24:00 -08: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()