Skip to content

Commit

Permalink
plugin/CMakeLists: add CMake detection fallback for SoundTouch
Browse files Browse the repository at this point in the history
  • Loading branch information
qyot27 committed Feb 14, 2025
1 parent 93b9f37 commit b014233
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions plugins/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,26 @@ else()
endif()

find_package(PkgConfig)
pkg_check_modules(SOUNDTOUCH soundtouch)
if(PkgConfig_FOUND)
pkg_check_modules(SOUNDTOUCH soundtouch)
endif()

if(SOUNDTOUCH_FOUND)
set(SOUNDTOUCH_PLUGIN_STATE ON)
else()
MESSAGE(WARNING "SoundTouch library not found. TimeStretch plugin will not be built.")
set(SOUNDTOUCH_PLUGIN_STATE OFF)
# check to see if SoundTouch's CMake files were installed and whether the library itself exists
find_package(SoundTouch)
find_library(SOUNDTOUCH SoundTouch PATH ${SoundTouch_LIBRARY_DIRS})
if(SoundTouch_FOUND)
# override the SOUNDTOUCH_LINK_LIBRARIES and SOUNDTOUCH_INCLUDE_DIRS variables
# that pkg-config would have set, and allow these to be overridden at configure time as well
set(SOUNDTOUCH_LINK_LIBRARIES ${SOUNDTOUCH} CACHE PATH "Path to SoundTouch library")
set(SOUNDTOUCH_INCLUDE_DIRS ${CMAKE_PREFIX_PATH}/include/soundtouch CACHE PATH "Path to SoundTouch headers")
set(SOUNDTOUCH_PLUGIN_STATE ON)
else()
MESSAGE(WARNING "SoundTouch library not found. TimeStretch plugin will not be built.")
set(SOUNDTOUCH_PLUGIN_STATE OFF)
endif()
endif()

option(BUILD_IMAGESEQ "Build ImageSeq plugin" ${DEVIL_PLUGIN_STATE})
Expand Down

0 comments on commit b014233

Please sign in to comment.