Skip to content

Commit

Permalink
Merge pull request #308 from cmusphinx/258-resurrect-gstreamer-support
Browse files Browse the repository at this point in the history
Resurrect GStreamer support
  • Loading branch information
dhdaines authored Sep 29, 2022
2 parents 8c214d2 + adf20a3 commit 36c2e03
Show file tree
Hide file tree
Showing 7 changed files with 1,150 additions and 0 deletions.
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,11 @@ else()
install(DIRECTORY include TYPE INCLUDE)
install(DIRECTORY ${CMAKE_BINARY_DIR}/include TYPE INCLUDE)
install(FILES ${CMAKE_BINARY_DIR}/pocketsphinx.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)

option(BUILD_GSTREAMER "Build GStreamer plugin" OFF)
if(BUILD_GSTREAMER)
add_subdirectory(gst)
endif()
endif()

# Can print this at the end, just to know what it was
Expand Down
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ include setup.cfg
include setup.py
include sphinx_config.h.in
recursive-include cython *
recursive-include gst *
recursive-include docs *
recursive-include doxygen *
recursive-include examples *
Expand Down
21 changes: 21 additions & 0 deletions gst/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
find_package(PkgConfig REQUIRED)
pkg_check_modules(GOBJECT gobject-2.0 REQUIRED)
pkg_check_modules(GSTREAMER gstreamer-1.0 gstreamer-base-1.0)
add_library(gstpocketsphinx SHARED gstpocketsphinx.c)
set_property(TARGET pocketsphinx PROPERTY POSITION_INDEPENDENT_CODE on)
target_link_libraries(gstpocketsphinx PUBLIC
pocketsphinx
${GSTREAMER_LIBRARIES}
${GOBJECT_LIBRARIES}
)
target_include_directories(
gstpocketsphinx PRIVATE ${CMAKE_BINARY_DIR}
gstpocketsphinx PRIVATE ${CMAKE_SOURCE_DIR}/src
gstpocketsphinx PUBLIC ${CMAKE_SOURCE_DIR}/include
gstpocketsphinx PUBLIC ${CMAKE_BINARY_DIR}/include
gstpocketsphinx INTERFACE ${CMAKE_SOURCE_DIR}/include
gstpocketsphinx INTERFACE ${CMAKE_BINARY_DIR}/include
gstpocketsphinx PUBLIC ${GSTREAMER_INCLUDE_DIRS} ${GOBJECT_INCLUDE_DIRS}
)
message("Installing GStreamer plugin to ${CMAKE_INSTALL_FULL_LIBDIR}/gstreamer-1.0")
install(TARGETS gstpocketsphinx LIBRARY DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR}/gstreamer-1.0)
Loading

0 comments on commit 36c2e03

Please sign in to comment.