Skip to content

Commit

Permalink
[ci] Fix CI on systems without libsamplerate config file
Browse files Browse the repository at this point in the history
  • Loading branch information
jcelerier committed Jun 8, 2024
1 parent 47cf5bf commit 23f64e4
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion cmake/deps/samplerate.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
if(OSSIA_USE_SYSTEM_LIBRARIES)
find_package(SampleRate CONFIG REQUIRED GLOBAL)
find_package(SampleRate CONFIG GLOBAL)

if(NOT TARGET SampleRate::samplerate)
find_library(SAMPLREATE_LIBRARY NAMES samplerate)
find_path(SAMPLERATE_INCLUDE_DIR samplerate.h)
if(SAMPLREATE_LIBRARY AND SAMPLERATE_INCLUDE_DIR)
add_library(samplerate IMPORTED INTERFACE GLOBAL)
add_library(SampleRate::samplerate ALIAS samplerate)
target_include_directories(samplerate INTERFACE ${SAMPLERATE_INCLUDE_DIR})
target_link_libraries(samplerate INTERFACE ${SAMPLREATE_LIBRARY})
endif()
endif()
endif()

if(NOT TARGET SampleRate::samplerate)
Expand Down

0 comments on commit 23f64e4

Please sign in to comment.