1 # - Try to find Speex extended library
2 # Once done this will define
4 # SPEEXDSP_FOUND - system has Speex extended library
5 # SPEEXDSP_INCLUDE_DIRS - the Speex extended library include directory
6 # SPEEXDSP_LIBRARIES - Link these to use Speex extended library
7 # SPEEXDSP_DEFINITIONS - Compiler switches required for using Speex extended library
9 # Copyright (c) 2006 Andreas Schneider <mail@cynapses.org>
10 # Edited by Saikrishna Arcot <saiarcot895@gmail.com> to find the Speex extended library
12 # Redistribution and use is allowed according to the terms of the New
14 # For details see the accompanying COPYING-CMAKE-SCRIPTS file.
18 if (SPEEXDSP_LIBRARIES AND SPEEXDSP_INCLUDE_DIRS)
20 set(SPEEXDSP_FOUND TRUE)
21 else (SPEEXDSP_LIBRARIES AND SPEEXDSP_INCLUDE_DIRS)
22 # use pkg-config to get the directories and then use these values
23 # in the FIND_PATH() and FIND_LIBRARY() calls
24 #include(UsePkgConfig)
26 #FIXME pkgconfig does not work: return a carriage return that makes compilation failed
27 #pkgconfig(speexdsp _SpeexDspIncDir _SpeexDspLinkDir _SpeexDspLinkFlags _SpeexDspCflags)
29 #set(SPEEXDSP_DEFINITIONS ${_SpeexDspCflags})
30 set(SPEEXDSP_DEFINITIONS "")
32 find_path(SPEEXDSP_INCLUDE_DIR
34 speex/speex_preprocess.h
44 find_library(SPEEXDSP_LIBRARY
57 set(SPEEXDSP_FOUND TRUE)
58 endif (SPEEXDSP_LIBRARY)
60 set(SPEEXDSP_INCLUDE_DIRS
61 ${SPEEXDSP_INCLUDE_DIR}
65 set(SPEEXDSP_LIBRARIES
69 endif (SPEEXDSP_FOUND)
71 if (SPEEXDSP_INCLUDE_DIRS AND SPEEXDSP_LIBRARIES)
72 set(SPEEXDSP_FOUND TRUE)
73 endif (SPEEXDSP_INCLUDE_DIRS AND SPEEXDSP_LIBRARIES)
76 if (NOT Speexdsp_FIND_QUIETLY)
77 message(STATUS "Found Speex extended library: ${SPEEXDSP_LIBRARIES}")
78 endif (NOT Speexdsp_FIND_QUIETLY)
80 if (Speexdsp_FIND_REQUIRED)
81 message(FATAL_ERROR "Could not find Speex extended library")
82 endif (Speexdsp_FIND_REQUIRED)
83 endif (SPEEXDSP_FOUND)
85 # show the SPEEXDSP_INCLUDE_DIRS and SPEEXDSP_LIBRARIES variables only in the advanced view
86 mark_as_advanced(SPEEXDSP_INCLUDE_DIRS SPEEXDSP_LIBRARIES)
88 endif (SPEEXDSP_LIBRARIES AND SPEEXDSP_INCLUDE_DIRS)