diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-10 20:34:10 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-10 20:34:10 +0000 |
commit | e4ba6dbc3f1e76890b22773807ea37fe8fa2b1bc (patch) | |
tree | 68cb5ef9081156392f1dd62a00c6ccc1451b93df /cmake/modules/FindSpeexDSP.cmake | |
parent | Initial commit. (diff) | |
download | wireshark-e4ba6dbc3f1e76890b22773807ea37fe8fa2b1bc.tar.xz wireshark-e4ba6dbc3f1e76890b22773807ea37fe8fa2b1bc.zip |
Adding upstream version 4.2.2.upstream/4.2.2
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'cmake/modules/FindSpeexDSP.cmake')
-rw-r--r-- | cmake/modules/FindSpeexDSP.cmake | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/cmake/modules/FindSpeexDSP.cmake b/cmake/modules/FindSpeexDSP.cmake new file mode 100644 index 0000000..2df717d --- /dev/null +++ b/cmake/modules/FindSpeexDSP.cmake @@ -0,0 +1,58 @@ +# Find the system's SpeexDSP includes and library +# +# SPEEXDSP_INCLUDE_DIRS - where to find SpeexDSP headers +# SPEEXDSP_LIBRARIES - List of libraries when using SpeexDSP +# SPEEXDSP_FOUND - True if SpeexDSP found +# SPEEXDSP_DLL_DIR - (Windows) Path to the SpeexDSP DLL +# SPEEXDSP_DLL - (Windows) Name of the SpeexDSP DLL + +include(FindWSWinLibs) +FindWSWinLibs("speexdsp-.*" "SPEEXDSP_HINTS") + +if(NOT USE_REPOSITORY) + find_package(PkgConfig) + pkg_search_module(PC_SPEEXDSP speexdsp) +endif() + + +find_path(SPEEXDSP_INCLUDE_DIR + NAMES + speex/speex_resampler.h + HINTS + ${PC_SPEEXDSP_INCLUDE_DIRS} + ${SPEEXDSP_HINTS}/include +) + +find_library(SPEEXDSP_LIBRARY + NAMES + speexdsp + HINTS + ${PC_SPEEXDSP_LIBRARY_DIRS} + ${SPEEXDSP_HINTS}/lib +) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(SpeexDSP DEFAULT_MSG SPEEXDSP_LIBRARY SPEEXDSP_INCLUDE_DIR) + +if(SPEEXDSP_FOUND) + set(SPEEXDSP_LIBRARIES ${SPEEXDSP_LIBRARY}) + set(SPEEXDSP_INCLUDE_DIRS ${SPEEXDSP_INCLUDE_DIR}) + if(WIN32) + set(SPEEXDSP_DLL_DIR "${SPEEXDSP_HINTS}/bin" + CACHE PATH "Path to SpeexDSP DLL" + ) + file(GLOB _speexdsp_dll RELATIVE "${SPEEXDSP_DLL_DIR}" + "${SPEEXDSP_DLL_DIR}/libspeexdsp.dll" + ) + set(SPEEXDSP_DLL ${_speexdsp_dll} + # We're storing filenames only. Should we use STRING instead? + CACHE FILEPATH "SpeexDSP DLL file name" + ) + mark_as_advanced(SPEEXDSP_DLL_DIR SPEEXDSP_DLL) + endif() +else() + set(SPEEXDSP_LIBRARIES) + set(SPEEXDSP_INCLUDE_DIRS) +endif() + +mark_as_advanced(SPEEXDSP_LIBRARIES SPEEXDSP_INCLUDE_DIRS) |