From d27de15964fbe4b8caaf5c03e2c4e1ac9a261585 Mon Sep 17 00:00:00 2001 From: Lubos Dolezel Date: Mon, 15 Jun 2015 10:39:38 +0200 Subject: Add a cmake check for bcg729 (issue #15) --- CMakeLists.txt | 15 +++++++++++++++ cmake/FindG729.cmake | 17 +++++++++++++++++ twinkle_config.h.in | 1 + 3 files changed, 33 insertions(+) create mode 100644 cmake/FindG729.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index 5057333..64a9dbe 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,6 +13,7 @@ OPTION(WITH_ALSA "Enable ALSA support" ON) OPTION(WITH_DIAMONDCARD "Enable Diamondcard integration" OFF) OPTION(WITH_QT4 "Enable Qt 4 GUI" OFF) OPTION(WITH_QT5 "Enable Qt 5 GUI" OFF) +OPTION(WITH_G729 "Enable G.729A support (incomplete)" OFF) list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake") @@ -101,6 +102,20 @@ if (WITH_ILBC) endif (ILBC_FOUND) endif (WITH_ILBC) +if (WITH_G729) + find_package(G729) + + if (G729_FOUND) + message(STATUS "bcg729 OK") + set(HAVE_BCG729 TRUE) + + include_directories(${G729_INCLUDE_DIR}) + else (G729_FOUND) + message(FATAL_ERROR "bcg729 not found!") + endif (G729_FOUND) +endif (WITH_G729) + + check_include_file(unistd.h HAVE_UNISTD_H) check_include_file(linux/types.h HAVE_LINUX_TYPES_H) check_include_file(linux/errqueue.h HAVE_LINUX_ERRQUEUE_H) diff --git a/cmake/FindG729.cmake b/cmake/FindG729.cmake new file mode 100644 index 0000000..d11a27e --- /dev/null +++ b/cmake/FindG729.cmake @@ -0,0 +1,17 @@ +FIND_PATH(G729_INCLUDE_DIR bcg729/decoder.h) +FIND_LIBRARY(G729_LIBRARIES NAMES bcg729) + +IF(G729_INCLUDE_DIR AND G729_LIBRARIES) + SET(G729_FOUND TRUE) +ENDIF(G729_INCLUDE_DIR AND G729_LIBRARIES) + +IF(G729_FOUND) + IF (NOT G729_FIND_QUIETLY) + MESSAGE(STATUS "Found bcg729 includes: ${G729_INCLUDE_DIR}/bcg729/decoder.h") + MESSAGE(STATUS "Found bcg729 library: ${G729_LIBRARIES}") + ENDIF (NOT G729_FIND_QUIETLY) +ELSE(G729_FOUND) + IF (G729_FIND_REQUIRED) + MESSAGE(FATAL_ERROR "Could NOT find bcg729 development files") + ENDIF (G729_FIND_REQUIRED) +ENDIF(G729_FOUND) diff --git a/twinkle_config.h.in b/twinkle_config.h.in index 880d704..4cf6fc9 100644 --- a/twinkle_config.h.in +++ b/twinkle_config.h.in @@ -2,6 +2,7 @@ #cmakedefine HAVE_SPEEX #cmakedefine HAVE_ILBC #cmakedefine HAVE_ZRTP +#cmakedefine HAVE_BCG729 #cmakedefine HAVE_UNISTD_H #cmakedefine HAVE_LINUX_TYPES_H -- cgit v1.2.3