mirror of
https://github.com/cookiengineer/audacity
synced 2025-10-18 08:31:13 +02:00
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>
This commit is contained in:
57
cmake-modules/FindPortAudio.cmake
Normal file
57
cmake-modules/FindPortAudio.cmake
Normal file
@@ -0,0 +1,57 @@
|
||||
# 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:
|
||||
FindPortAudio
|
||||
--------
|
||||
|
||||
Finds the PortAudio library.
|
||||
|
||||
Imported Targets
|
||||
^^^^^^^^^^^^^^^^
|
||||
|
||||
This module provides the following imported targets, if found:
|
||||
|
||||
``PortAudio::PortAudio``
|
||||
The PortAudio library
|
||||
|
||||
Result Variables
|
||||
^^^^^^^^^^^^^^^^
|
||||
|
||||
This will define the following variables:
|
||||
|
||||
``PortAudio_FOUND``
|
||||
True if the system has the PortAudio library.
|
||||
|
||||
#]=======================================================================]
|
||||
|
||||
find_package(PkgConfig QUIET)
|
||||
if(PkgConfig_FOUND)
|
||||
pkg_check_modules(PortAudio portaudio-2.0)
|
||||
else()
|
||||
find_path(PortAudio_INCLUDEDIR
|
||||
NAMES portaudio.h
|
||||
DOC "PortAudio include directory")
|
||||
|
||||
find_library(PortAudio_LINK_LIBRARIES
|
||||
NAMES portaudio
|
||||
DOC "PortAudio library"
|
||||
)
|
||||
endif()
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(
|
||||
PortAudio
|
||||
DEFAULT_MSG
|
||||
PortAudio_LINK_LIBRARIES
|
||||
PortAudio_INCLUDEDIR
|
||||
)
|
||||
|
||||
if(PortAudio_FOUND)
|
||||
if(NOT TARGET PortAudio::PortAudio)
|
||||
add_library(PortAudio::PortAudio INTERFACE IMPORTED)
|
||||
target_link_libraries(PortAudio::PortAudio INTERFACE "${PortAudio_LINK_LIBRARIES}")
|
||||
target_include_directories(PortAudio::PortAudio INTERFACE "${PortAudio_INCLUDEDIR}")
|
||||
endif()
|
||||
endif()
|
Reference in New Issue
Block a user