externals: Add option to use system SoundTouch (#6971)

This commit is contained in:
SachinVin
2023-09-17 03:16:32 +05:30
committed by GitHub
parent d2d37411bc
commit 8aee625a14
5 changed files with 84 additions and 7 deletions

View File

@@ -122,10 +122,13 @@ add_subdirectory(open_source_archives)
add_subdirectory(library-headers EXCLUDE_FROM_ALL)
# SoundTouch
set(INTEGER_SAMPLES ON CACHE BOOL "")
set(SOUNDSTRETCH OFF CACHE BOOL "")
set(SOUNDTOUCH_DLL OFF CACHE BOOL "")
add_subdirectory(soundtouch EXCLUDE_FROM_ALL)
if(NOT USE_SYSTEM_SOUNDTOUCH)
set(INTEGER_SAMPLES ON CACHE BOOL "")
set(SOUNDSTRETCH OFF CACHE BOOL "")
set(SOUNDTOUCH_DLL OFF CACHE BOOL "")
add_subdirectory(soundtouch EXCLUDE_FROM_ALL)
target_compile_definitions(SoundTouch PUBLIC SOUNDTOUCH_INTEGER_SAMPLES)
endif()
# sirit
add_subdirectory(sirit EXCLUDE_FROM_ALL)

View File

@@ -0,0 +1,27 @@
if(NOT SOUNDTOUCH_FOUND)
pkg_check_modules(SOUNDTOUCH_TMP soundtouch)
find_path(SOUNDTOUCH_INCLUDE_DIRS NAMES SoundTouch.h
PATHS
${SOUNDTOUCH_TMP_INCLUDE_DIRS}
/usr/include/soundtouch
/usr/include
/usr/local/include/soundtouch
/usr/local/include
)
find_library(SOUNDTOUCH_LIBRARIES NAMES SoundTouch
PATHS
${SOUNDTOUCH_TMP_LIBRARY_DIRS}
/usr/lib
/usr/local/lib
)
if(SOUNDTOUCH_INCLUDE_DIRS AND SOUNDTOUCH_LIBRARIES)
set(SOUNDTOUCH_FOUND TRUE CACHE INTERNAL "SoundTouch found")
message(STATUS "Found SoundTouch: ${SOUNDTOUCH_INCLUDE_DIRS}, ${SOUNDTOUCH_LIBRARIES}")
else()
set(SOUNDTOUCH_FOUND FALSE CACHE INTERNAL "SoundTouch found")
message(STATUS "SoundTouch not found.")
endif()
endif()