11cmake_minimum_required (VERSION 3.14) # I like pie
22
3- project (PocketSphinx VERSION 4.9.999 .0
3+ project (PocketSphinx VERSION 5.0 .0
44 DESCRIPTION "A small speech recognizer"
55 HOMEPAGE_URL "https://github.com/cmusphinx/pocketsphinx" )
66include (CMakePrintHelpers)
@@ -60,10 +60,6 @@ else()
6060 add_compile_options (-Wall -Wextra)
6161endif ()
6262
63- option (BUILD_SHARED_LIBS "Build using shared libraries" ON )
64- if (BUILD_SHARED_LIBS )
65- add_definitions (-DSPHINX_DLL)
66- endif ()
6763option (FIXED_POINT "Build using fixed-point math" OFF )
6864if (NOT DEFAULT_RADIX)
6965 set (DEFAULT_RADIX 12)
@@ -79,18 +75,24 @@ configure_file(config.h.in config.h)
7975configure_file (sphinx_config.h.in include /sphinxbase/sphinx_config.h)
8076add_definitions (-DHAVE_CONFIG_H)
8177
82- add_subdirectory (src)
83- # Only build SWIG and Python if we are building the package
84- if (CALL_FROM_SETUP_PY )
85- add_subdirectory (swig )
78+ # Python build
79+ if (SKBUILD)
80+ add_subdirectory (src )
81+ add_subdirectory (cython )
8682else ()
87- # Don't build or install these in Python
83+ # C shared library build
84+ option (BUILD_SHARED_LIBS "Build using shared libraries" ON )
85+ if (BUILD_SHARED_LIBS )
86+ add_definitions (-DSPHINX_DLL)
87+ endif ()
88+ add_subdirectory (src)
8889 add_subdirectory (model)
8990 add_subdirectory (doc )
9091 add_subdirectory (include )
9192 add_subdirectory (programs)
9293 add_subdirectory (test )
9394 configure_file (pocketsphinx.pc.in pocketsphinx.pc @ONLY)
95+ install (TARGETS pocketsphinx LIBRARY)
9496 install (FILES ${CMAKE_BINARY_DIR} /pocketsphinx.pc DESTINATION ${CMAKE_INSTALL_LIBDIR} /pkgconfig)
9597endif ()
9698
0 commit comments