diff options
-rw-r--r-- | CMakeLists.txt | 3 | ||||
-rw-r--r-- | cmake/FindIlbc.cmake | 19 | ||||
-rw-r--r-- | twinkle_config.h.in | 1 |
3 files changed, 23 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index c20bd16..5e347b1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -88,6 +88,9 @@ if (WITH_ILBC) if (ILBC_FOUND) message(STATUS "iLBC OK") set(HAVE_ILBC TRUE) + if (ILBC_CPP) + set(HAVE_ILBC_CPP TRUE) + endif (ILBC_CPP) include_directories(${ILBC_INCLUDE_DIR}) else (ILBC_FOUND) diff --git a/cmake/FindIlbc.cmake b/cmake/FindIlbc.cmake index f66ca55..7bbffa9 100644 --- a/cmake/FindIlbc.cmake +++ b/cmake/FindIlbc.cmake @@ -1,8 +1,27 @@ +include (CMakePushCheckState) +include (CheckCXXSourceCompiles) + FIND_PATH(ILBC_INCLUDE_DIR ilbc/iLBC_decode.h) FIND_LIBRARY(ILBC_LIBRARIES NAMES ilbc) IF(ILBC_INCLUDE_DIR AND ILBC_LIBRARIES) SET(ILBC_FOUND TRUE) + + # Check if libilbc can be used without 'extern "C"' + CMAKE_PUSH_CHECK_STATE() + LIST(APPEND CMAKE_REQUIRED_INCLUDES "${ILBC_INCLUDE_DIR}") + LIST(APPEND CMAKE_REQUIRED_LIBRARIES "-lilbc") + SET(CMAKE_REQUIRED_QUIET TRUE) + CHECK_CXX_SOURCE_COMPILES(" + #include <ilbc/iLBC_decode.h> + + int main() { + iLBC_Dec_Inst_t *iLBCdec_inst; + initDecode(iLBCdec_inst, 0, 0); + return 0; + } + " ILBC_CPP) + CMAKE_POP_CHECK_STATE() ENDIF(ILBC_INCLUDE_DIR AND ILBC_LIBRARIES) IF(ILBC_FOUND) diff --git a/twinkle_config.h.in b/twinkle_config.h.in index 2f03cf2..4e649f7 100644 --- a/twinkle_config.h.in +++ b/twinkle_config.h.in @@ -1,6 +1,7 @@ #cmakedefine WITH_DIAMONDCARD #cmakedefine HAVE_SPEEX #cmakedefine HAVE_ILBC +#cmakedefine HAVE_ILBC_CPP #cmakedefine HAVE_ZRTP #cmakedefine HAVE_BCG729 #cmakedefine HAVE_GSM |