summaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorStefan Wildemann <metalstrolch@users.noreply.github.com>2017-05-05 20:03:51 +0200
committerPierre GRANDIN <pgrandin@users.noreply.github.com>2017-05-05 11:03:51 -0700
commit8c48382a411a0c16f1d1cf7d015ea921f1adb2d0 (patch)
treec88595bba7cb50af51e63c95b4cc3e5dea84ca39 /cmake
parentb6d8bc28e34d0f3623659a9c724fa24310cfd5d7 (diff)
downloadnavit-8c48382a411a0c16f1d1cf7d015ea921f1adb2d0.tar.gz
Add: Add speech module using espeak on QMultimedia. (#233)R7471
* Add: Add speech module using (external) espeak on QMultimedia. * Add: Find system espeak or use internal one This patch adds a cmake module to find installed libespeak. If not found, it builds against included libespeak, despite it being heavily patched. * Fix: allow building internal espeak for posix systems Allow the usage of the internal (ported to C) version of espeak as replacement for system installed libespeak. * Fix: use synchronous espeak mode if internal espeak is used * Fix: Clear buffer if samples are played * Fix: use syncronous mode always, as QBuffer is not thread safe * Sailfish: Use qt5_espeak * Remove espeak shell script now obsolete * Fix: remove the espeak script from the repo * Fix: code cleanup. Fix audio buffer size * Fix: apply coding style Apply automatic coding style with 'clang-format -style=WebKit -i' * Fix; restore correct include file order Seems, our internal include files depend on correct order. This usually is a bad thing and we should consider fixing them. But this is another story... * Add qtmultimedia-dev to windows build for qt5_espeak * Rename CMake INTERNAL_ESPEAK -> INTERNAL_ESPEAK_COMPLETE
Diffstat (limited to 'cmake')
-rw-r--r--cmake/Findespeak.cmake29
1 files changed, 29 insertions, 0 deletions
diff --git a/cmake/Findespeak.cmake b/cmake/Findespeak.cmake
new file mode 100644
index 000000000..6d390a9a8
--- /dev/null
+++ b/cmake/Findespeak.cmake
@@ -0,0 +1,29 @@
+# - Try to find espeak (with libespeak)
+# Once done, this will define
+#
+# espeak_FOUND - system has Glib
+# espeak_INCLUDE_DIRS - the Glib include directories
+# espeak_LIBRARIES - link these to use Glib
+
+include(LibFindMacros)
+
+# espeak-related libraries
+find_path(espeak_INCLUDE_DIR
+ NAMES speak_lib.h
+ PATHS /usr /sw/include
+ PATH_SUFFIXES espeak
+)
+
+# Finally the library itself
+find_library(espeak_LIBRARY
+ NAMES libespeak.so libespeak.a
+ PATHS /sw/lib
+)
+
+# Set the include dir variables and the libraries and let libfind_process do the rest.
+# NOTE: Singular variables for this library, plural for libraries this this lib depends on.
+set(espeak_PROCESS_INCLUDES espeak_INCLUDE_DIR)
+set(espeak_PROCESS_LIBS espeak_LIBRARY)
+libfind_process(espeak)
+
+