summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt13
-rw-r--r--cmake/FindGsm.cmake17
-rw-r--r--src/CMakeLists.txt11
-rw-r--r--src/audio/audio_tx.h7
-rw-r--r--twinkle_config.h.in1
5 files changed, 46 insertions, 3 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d41f749..d8cd1fc 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -14,6 +14,7 @@ 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" OFF)
+OPTION(WITH_GSM "Use external GSM library" OFF)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake")
@@ -114,6 +115,18 @@ if (WITH_G729)
endif (G729_FOUND)
endif (WITH_G729)
+if (WITH_GSM)
+ find_package(Gsm)
+
+ if (GSM_FOUND)
+ message(STATUS "gsm OK")
+ set(HAVE_GSM TRUE)
+
+ include_directories(${GSM_INCLUDE_DIR})
+ else (GSM_FOUND)
+ message(FATAL_ERROR "gsm not found!")
+ endif (GSM_FOUND)
+endif (WITH_GSM)
check_include_file(unistd.h HAVE_UNISTD_H)
check_include_file(linux/types.h HAVE_LINUX_TYPES_H)
diff --git a/cmake/FindGsm.cmake b/cmake/FindGsm.cmake
new file mode 100644
index 0000000..85f367b
--- /dev/null
+++ b/cmake/FindGsm.cmake
@@ -0,0 +1,17 @@
+FIND_PATH(GSM_INCLUDE_DIR gsm/gsm.h)
+FIND_LIBRARY(GSM_LIBRARY NAMES gsm)
+
+IF(GSM_INCLUDE_DIR AND GSM_LIBRARY)
+ SET(GSM_FOUND TRUE)
+ENDIF(GSM_INCLUDE_DIR AND GSM_LIBRARY)
+
+IF(GSM_FOUND)
+ IF (NOT Gsm_FIND_QUIETLY)
+ MESSAGE(STATUS "Found gsm includes: ${GSM_INCLUDE_DIR}/gsm/config.h")
+ MESSAGE(STATUS "Found gsm library: ${GSM_LIBRARY}")
+ ENDIF (NOT Gsm_FIND_QUIETLY)
+ELSE(GSM_FOUND)
+ IF (Gsm_FIND_REQUIRED)
+ MESSAGE(FATAL_ERROR "Could NOT find gsm development files")
+ ENDIF (Gsm_FIND_REQUIRED)
+ENDIF(GSM_FOUND)
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index a721272..11c79f6 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -3,7 +3,9 @@ project(libtwinkle)
include_directories("${CMAKE_CURRENT_SOURCE_DIR}")
add_subdirectory(audio)
-add_subdirectory(audio/gsm/src)
+if (NOT WITH_GSM)
+ add_subdirectory(audio/gsm/src)
+endif (NOT WITH_GSM)
add_subdirectory(audits)
add_subdirectory(im)
add_subdirectory(mwi)
@@ -57,7 +59,6 @@ add_library(libtwinkle OBJECT ${LIBTWINKLE_SRCS})
set(twinkle_OBJS
$<TARGET_OBJECTS:libtwinkle>
$<TARGET_OBJECTS:libtwinkle-audio>
- $<TARGET_OBJECTS:libtwinkle-gsm>
$<TARGET_OBJECTS:libtwinkle-audits>
$<TARGET_OBJECTS:libtwinkle-im>
$<TARGET_OBJECTS:libtwinkle-mwi>
@@ -70,6 +71,9 @@ set(twinkle_OBJS
$<TARGET_OBJECTS:libtwinkle-threads>
$<TARGET_OBJECTS:libtwinkle-utils>
)
+if (NOT WITH_GSM)
+ list(APPEND twinkle_OBJS $<TARGET_OBJECTS:libtwinkle-gsm>)
+endif (NOT WITH_GSM)
add_executable(twinkle-console
main.cpp
@@ -92,6 +96,9 @@ set(twinkle_LIBS
${ALSA_LIBRARY}
${G729_LIBRARY}
)
+if (WITH_GSM)
+ list(APPEND twinkle_LIBS ${GSM_LIBRARY})
+endif (WITH_GSM)
if (WITH_QT4 OR WITH_QT5)
add_subdirectory(gui)
diff --git a/src/audio/audio_tx.h b/src/audio/audio_tx.h
index a51ef9a..20daebc 100644
--- a/src/audio/audio_tx.h
+++ b/src/audio/audio_tx.h
@@ -30,11 +30,16 @@
#include "rtp_telephone_event.h"
#include "user.h"
#include "threads/mutex.h"
-#include "gsm/inc/gsm.h"
#include "audio_device.h"
#include "twinkle_rtp_session.h"
#include "twinkle_config.h"
+#ifdef HAVE_GSM
+#include <gsm/gsm.h>
+#else
+#include "gsm/inc/gsm.h"
+#endif
+
using namespace std;
using namespace ost;
diff --git a/twinkle_config.h.in b/twinkle_config.h.in
index 4cf6fc9..3928565 100644
--- a/twinkle_config.h.in
+++ b/twinkle_config.h.in
@@ -3,6 +3,7 @@
#cmakedefine HAVE_ILBC
#cmakedefine HAVE_ZRTP
#cmakedefine HAVE_BCG729
+#cmakedefine HAVE_GSM
#cmakedefine HAVE_UNISTD_H
#cmakedefine HAVE_LINUX_TYPES_H