3rdparty: add libsamplerate cmake defs

This commit is contained in:
Gauvain 'GovanifY' Roussel-Tarbouriech 2020-11-02 12:21:00 +01:00 committed by refractionpcsx2
parent 8f8a83a038
commit 2788198b75
3 changed files with 34 additions and 2 deletions

View File

@ -0,0 +1,25 @@
# - Try to find libsamplerate
# Once done this will define
#
# LIBSAMPLERATE_FOUND - system has libsamplerate
# LIBSAMPLERATE_INCLUDE_DIRS - the libsamplerate include directory
# LIBSAMPLERATE_LIBRARIES - The libsamplerate libraries
find_package(PkgConfig)
if(PKG_CONFIG_FOUND)
pkg_check_modules (LIBSAMPLERATE samplerate)
list(APPEND LIBSAMPLERATE_INCLUDE_DIRS ${LIBSAMPLERATE_INCLUDEDIR})
endif()
if(NOT LIBSAMPLERATE_FOUND)
find_path( LIBSAMPLERATE_INCLUDE_DIRS "samplerate.h"
PATH_SUFFIXES "samplerate" )
find_library( LIBSAMPLERATE_LIBRARIES samplerate)
endif()
# handle the QUIETLY and REQUIRED arguments and set SAMPLERATE_FOUND to TRUE if
# all listed variables are TRUE
include( "FindPackageHandleStandardArgs" )
find_package_handle_standard_args(libsamplerate DEFAULT_MSG LIBSAMPLERATE_INCLUDE_DIRS LIBSAMPLERATE_LIBRARIES)
mark_as_advanced(LIBSAMPLERATE_INCLUDE_DIRS LIBSAMPLERATE_LIBRARIES)

View File

@ -93,6 +93,9 @@ find_package(ZLIB)
## Use pcsx2 package to find module
include(FindLibc)
## Use pcsx2 package to find module
include(Findlibsamplerate)
## Use CheckLib package to find module
include(CheckLib)
if(Linux)
@ -189,6 +192,10 @@ if(PCAP_FOUND)
include_directories(${PCAP_INCLUDE_DIR})
endif()
if(LIBSAMPLERATE_FOUND)
include_directories(${LIBSAMPLERATE_INCLUDE_DIR})
endif()
if(LIBXML2_FOUND)
include_directories(${LIBXML2_INCLUDE_DIRS})
endif()

View File

@ -361,8 +361,6 @@ set(pcsx2USBSources
# USB headers
set(pcsx2USBHeaders
USB/USB.h
USB/PS2Etypes.h
USB/PS2Edefs.h
USB/proxybase.h
USB/deviceproxy.h
USB/configuration.h
@ -905,6 +903,7 @@ set(pcsx2FinalLibs
Utilities
x86emitter
fmt::fmt
libsamplerate
${wxWidgets_LIBRARIES}
${GTK2_LIBRARIES}
${ZLIB_LIBRARIES}
@ -914,6 +913,7 @@ set(pcsx2FinalLibs
${SOUNDTOUCH_LIBRARIES}
${SDL2_LIBRARIES}
${PCAP_LIBRARY}
${LIBSAMPLERATE_LIBRARIES}
${LIBXML2_LIBRARIES}
${Platform_Libs}
)