Module: sems Branch: master Commit: 5312d88c8e7286ab2dca2ea1814e8b68b7fad95a URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sems/?a=commit;h=5312d88c8e7286ab2dca2ea1814e8b68b7fad95a
Author: Peter Lemenkov <[email protected]> Committer: Peter Lemenkov <[email protected]> Date: Fri Aug 3 13:18:37 2012 +0400 Allow build against external iLBC Signed-off-by: Peter Lemenkov <[email protected]> --- CMakeLists.txt | 11 ++++++++--- cmake/FindIlbc.cmake | 17 +++++++++++++++++ core/plug-in/ilbc/CMakeLists.txt | 8 ++++++-- 3 files changed, 31 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 90290ab..2e809a1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -40,7 +40,7 @@ OPTION(SEMS_USE_SPANDSP "Build with spandsp" OFF) OPTION(SEMS_USE_LIBSAMPLERATE "Build with libsamplerate" OFF) OPTION(SEMS_USE_ZRTP "Build with ZRTP" OFF) OPTION(SEMS_USE_MP3 "Build with Lame MP3" OFF) -OPTION(SEMS_USE_ILBC "Build with bundled iLBC library" ON) +OPTION(SEMS_USE_ILBC "Build with iLBC library (fallback to bundled)" ON) OPTION(SEMS_USE_TTS "Build with Text-to-speech support (requires Flite)" OFF) OPTION(SEMS_USE_OPENSSL "Build with OpenSSL" OFF) OPTION(SEMS_USE_MONITORING "Build with monitoring support" OFF) @@ -124,9 +124,14 @@ ELSE(SEMS_USE_MP3) ENDIF(SEMS_USE_MP3) IF(SEMS_USE_ILBC) - MESSAGE(STATUS "Using bundled iLBC library: YES (default)") + FIND_PACKAGE(Ilbc) + IF(ILBC_FOUND) + MESSAGE(STATUS "Using iLBC library: YES (external)") + ELSE(ILBC_FOUND) + MESSAGE(STATUS "Using iLBC library: YES (bundled, default)") + ENDIF(ILBC_FOUND) ELSE(SEMS_USE_ILBC) - MESSAGE(STATUS "Using bundled iLBC library: NO") + MESSAGE(STATUS "Uusing iLBC library: NO") ENDIF(SEMS_USE_ILBC) # build in support for monitoring? diff --git a/cmake/FindIlbc.cmake b/cmake/FindIlbc.cmake new file mode 100644 index 0000000..c5fa5c1 --- /dev/null +++ b/cmake/FindIlbc.cmake @@ -0,0 +1,17 @@ +FIND_PATH(ILBC_INCLUDE_DIR ilbc.h) +FIND_LIBRARY(ILBC_LIBRARIES NAMES ilbc) + +IF(ILBC_INCLUDE_DIR AND ILBC_LIBRARIES) + SET(ILBC_FOUND TRUE) +ENDIF(ILBC_INCLUDE_DIR AND ILBC_LIBRARIES) + +IF(ILBC_FOUND) + IF (NOT Ilbc_FIND_QUIETLY) + MESSAGE(STATUS "Found ilbc includes: ${ILBC_INCLUDE_DIR}/ilbc.h") + MESSAGE(STATUS "Found ilbc library: ${ILBC_LIBRARIES}") + ENDIF (NOT Ilbc_FIND_QUIETLY) +ELSE(ILBC_FOUND) + IF (Ilbc_FIND_REQUIRED) + MESSAGE(FATAL_ERROR "Could NOT find ilbc development files") + ENDIF (Ilbc_FIND_REQUIRED) +ENDIF(ILBC_FOUND) diff --git a/core/plug-in/ilbc/CMakeLists.txt b/core/plug-in/ilbc/CMakeLists.txt index 1f4dcfb..bf77875 100644 --- a/core/plug-in/ilbc/CMakeLists.txt +++ b/core/plug-in/ilbc/CMakeLists.txt @@ -2,10 +2,14 @@ set (ilbc_SRCS ilbc.c ) +SET(sems_module_name ilbc) +IF(ILBC_FOUND) +SET(sems_module_libs ilbc) +ELSE(ILBC_FOUND) ADD_SUBDIRECTORY (iLBC_rfc3951) INCLUDE_DIRECTORIES (iLBC_rfc3951) - -SET(sems_module_name ilbc) SET(sems_module_libs libilbc) +ENDIF(ILBC_FOUND) + INCLUDE(${CMAKE_SOURCE_DIR}/cmake/module.rules.txt) _______________________________________________ Semsdev mailing list [email protected] http://lists.iptel.org/mailman/listinfo/semsdev
