2 # Once done this will define
4 # SPEEX_FOUND - system has Speex
5 # SPEEX_INCLUDE_DIRS - the Speex include directory
6 # SPEEX_LIBRARIES - Link these to use Speex
7 # SPEEX_DEFINITIONS - Compiler switches required for using Speex
9 # Copyright (c) 2006 Andreas Schneider <mail@cynapses.org>
11 # Redistribution and use is allowed according to the terms of the New
13 # For details see the accompanying COPYING-CMAKE-SCRIPTS file.
17 if (SPEEX_LIBRARIES AND SPEEX_INCLUDE_DIRS)
20 else (SPEEX_LIBRARIES AND SPEEX_INCLUDE_DIRS)
21 # use pkg-config to get the directories and then use these values
22 # in the FIND_PATH() and FIND_LIBRARY() calls
23 #include(UsePkgConfig)
25 #FIXME pkgconfig does not work: return a carriage return that makes compilation failed
26 #pkgconfig(speex _SpeexIncDir _SpeexLinkDir _SpeexLinkFlags _SpeexCflags)
28 #set(SPEEX_DEFINITIONS ${_SpeexCflags})
29 set(SPEEX_DEFINITIONS "")
31 find_path(SPEEX_INCLUDE_DIR
43 find_library(SPEEX_LIBRARY
59 set(SPEEX_INCLUDE_DIRS
70 if (SPEEX_INCLUDE_DIRS AND SPEEX_LIBRARIES)
72 endif (SPEEX_INCLUDE_DIRS AND SPEEX_LIBRARIES)
75 if (NOT Speex_FIND_QUIETLY)
76 message(STATUS "Found Speex: ${SPEEX_LIBRARIES}")
77 endif (NOT Speex_FIND_QUIETLY)
79 if (Speex_FIND_REQUIRED)
80 message(FATAL_ERROR "Could not find Speex")
81 endif (Speex_FIND_REQUIRED)
84 # show the SPEEX_INCLUDE_DIRS and SPEEX_LIBRARIES variables only in the advanced view
85 mark_as_advanced(SPEEX_INCLUDE_DIRS SPEEX_LIBRARIES)
87 endif (SPEEX_LIBRARIES AND SPEEX_INCLUDE_DIRS)