Skip to content

Commit 36c2e03

Browse files
authored
Merge pull request #308 from cmusphinx/258-resurrect-gstreamer-support
Resurrect GStreamer support
2 parents 8c214d2 + adf20a3 commit 36c2e03

7 files changed

+1150
-0
lines changed

CMakeLists.txt

+5
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,11 @@ else()
111111
install(DIRECTORY include TYPE INCLUDE)
112112
install(DIRECTORY ${CMAKE_BINARY_DIR}/include TYPE INCLUDE)
113113
install(FILES ${CMAKE_BINARY_DIR}/pocketsphinx.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
114+
115+
option(BUILD_GSTREAMER "Build GStreamer plugin" OFF)
116+
if(BUILD_GSTREAMER)
117+
add_subdirectory(gst)
118+
endif()
114119
endif()
115120

116121
# Can print this at the end, just to know what it was

MANIFEST.in

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ include setup.cfg
1515
include setup.py
1616
include sphinx_config.h.in
1717
recursive-include cython *
18+
recursive-include gst *
1819
recursive-include docs *
1920
recursive-include doxygen *
2021
recursive-include examples *

gst/CMakeLists.txt

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
find_package(PkgConfig REQUIRED)
2+
pkg_check_modules(GOBJECT gobject-2.0 REQUIRED)
3+
pkg_check_modules(GSTREAMER gstreamer-1.0 gstreamer-base-1.0)
4+
add_library(gstpocketsphinx SHARED gstpocketsphinx.c)
5+
set_property(TARGET pocketsphinx PROPERTY POSITION_INDEPENDENT_CODE on)
6+
target_link_libraries(gstpocketsphinx PUBLIC
7+
pocketsphinx
8+
${GSTREAMER_LIBRARIES}
9+
${GOBJECT_LIBRARIES}
10+
)
11+
target_include_directories(
12+
gstpocketsphinx PRIVATE ${CMAKE_BINARY_DIR}
13+
gstpocketsphinx PRIVATE ${CMAKE_SOURCE_DIR}/src
14+
gstpocketsphinx PUBLIC ${CMAKE_SOURCE_DIR}/include
15+
gstpocketsphinx PUBLIC ${CMAKE_BINARY_DIR}/include
16+
gstpocketsphinx INTERFACE ${CMAKE_SOURCE_DIR}/include
17+
gstpocketsphinx INTERFACE ${CMAKE_BINARY_DIR}/include
18+
gstpocketsphinx PUBLIC ${GSTREAMER_INCLUDE_DIRS} ${GOBJECT_INCLUDE_DIRS}
19+
)
20+
message("Installing GStreamer plugin to ${CMAKE_INSTALL_FULL_LIBDIR}/gstreamer-1.0")
21+
install(TARGETS gstpocketsphinx LIBRARY DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR}/gstreamer-1.0)

0 commit comments

Comments
 (0)