1 From e4a0d0b48905bb949831c30c941e921da0b6f09c Mon Sep 17 00:00:00 2001
2 From: Emily <hello@emily.moe>
3 Date: Sat, 3 Aug 2024 12:21:12 +0100
4 Subject: [PATCH 4/4] Use pkg-config to find libresample and kissfft
8 CMakeLists.txt | 12 ++++++++++++
9 libmusly/CMakeLists.txt | 12 +++---------
10 libmusly/powerspectrum.h | 2 +-
11 libmusly/resampler.h | 2 +-
12 5 files changed, 19 insertions(+), 11 deletions(-)
14 diff --git a/.travis.yml b/.travis.yml
15 index b051004..b354641 100644
18 @@ -31,3 +31,5 @@ addons:
24 diff --git a/CMakeLists.txt b/CMakeLists.txt
25 index 8d8bf0e..c5b0d2c 100644
28 @@ -60,6 +60,18 @@ pkg_check_modules(FFMPEG REQUIRED IMPORTED_TARGET
32 +pkg_check_modules(LIBRESAMPLE REQUIRED IMPORTED_TARGET libresample)
33 +pkg_search_module(KISSFFT REQUIRED IMPORTED_TARGET
40 + kissfft-double-openmp
41 + kissfft-float-openmp
42 + kissfft-int32_t-openmp
43 + kissfft-int16_t-openmp)
46 "${PROJECT_SOURCE_DIR}/include")
47 diff --git a/libmusly/CMakeLists.txt b/libmusly/CMakeLists.txt
48 index b9f6d11..6f8c8e9 100644
49 --- a/libmusly/CMakeLists.txt
50 +++ b/libmusly/CMakeLists.txt
51 @@ -13,19 +13,11 @@ if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/external")
52 PROPERTIES COMPILE_FLAGS "-DLIBMUSLY_EXTERNAL ${LIBMUSLY_EXTERNAL_FLAGS}")
55 -if(USE_OPENMP AND OPENMP_FOUND)
56 - # disable OpenMP for kiss FFT, it slows things down terribly
57 - set_source_files_properties(kissfft/kiss_fft.c
58 - PROPERTIES COMPILE_FLAGS "-U_OPENMP")
63 ${CMAKE_CURRENT_SOURCE_DIR})
68 methods/mandelellis.cpp
71 @@ -56,7 +48,9 @@ set_target_properties(libmusly
72 target_link_libraries(libmusly
77 + PkgConfig::LIBRESAMPLE
80 # link against winsock2 for ntohl() and htonl()
81 target_link_libraries(libmusly ws2_32)
82 diff --git a/libmusly/powerspectrum.h b/libmusly/powerspectrum.h
83 index 6957db4..096fc31 100644
84 --- a/libmusly/powerspectrum.h
85 +++ b/libmusly/powerspectrum.h
90 - #include "kissfft/kiss_fftr.h"
91 + #include <kissfft/kiss_fftr.h>
95 diff --git a/libmusly/resampler.h b/libmusly/resampler.h
96 index df8aaa4..f48e22a 100644
97 --- a/libmusly/resampler.h
98 +++ b/libmusly/resampler.h
103 - #include "libresample/libresample.h"
104 + #include <libresample.h>