Warning, /libraries/ktextaddons/textspeechtotext/speechtotext/plugins/vosk/CMakeLists.txt is written in an unsupported language. File is not indexed.

0001 # SPDX-License-Identifier: BSD-3-Clause
0002 # SPDX-FileCopyrightText: 2023-2024 Laurent Montel <montel.org>
0003 
0004 # TODO reenable it
0005 set(HAVE_VOSK_API_SUPPORT TRUE)
0006 configure_file(config-vosk-plugin.h.in ${CMAKE_CURRENT_BINARY_DIR}/config-vosk-plugin.h)
0007 
0008 add_library(voskspeechtotext)
0009 
0010 target_sources(voskspeechtotext PRIVATE
0011     voskspeechtotextmodel.h
0012     voskspeechtotextmodel.cpp
0013     voskspeechtotextproxymodel.cpp
0014     voskspeechtotextproxymodel.h
0015 
0016     managermodelvoskspeechtotext.h
0017     managermodelvoskspeechtotext.cpp
0018 
0019     voskspeechtotextinfo.h
0020     voskspeechtotextinfo.cpp
0021 
0022     voskdownloadlanguagejob.cpp
0023     voskdownloadlanguagejob.h
0024 
0025     generateinstalledlanguageinfojob.h
0026     generateinstalledlanguageinfojob.cpp
0027 
0028     voskextractlanguagejob.h
0029     voskextractlanguagejob.cpp
0030 
0031     voskengineutils.cpp
0032     voskengineutils.h
0033 
0034     voskenginelanguagewidget.h
0035     voskenginelanguagewidget.cpp
0036 
0037     voskengineutils.h
0038     voskengineutils.cpp
0039 
0040     voskenginedialog.h
0041     voskenginedialog.cpp
0042 
0043 
0044     voskspeechtotextdevice.h
0045     voskspeechtotextdevice.cpp
0046 
0047 )
0048 
0049 generate_export_header(voskspeechtotext BASE_NAME libvoskspeechtotext)
0050 
0051 ecm_qt_declare_logging_category(voskspeechtotext HEADER libvoskspeechtotext_debug.h IDENTIFIER  LIBVOSKSPEECHTOTEXT_LOG
0052     CATEGORY_NAME org.kde.voskspeechtotext DESCRIPTION "lib vosk speech to text" EXPORT KTEXTADDONS)
0053 
0054 target_link_libraries(voskspeechtotext
0055     Qt::Widgets
0056     KF${KF_MAJOR_VERSION}::Archive
0057     KF${KF_MAJOR_VERSION}::I18n
0058     KF${KF_MAJOR_VERSION}::TextSpeechToText
0059     KF${KF_MAJOR_VERSION}::WidgetsAddons
0060     KF${KF_MAJOR_VERSION}::ConfigWidgets
0061     KF${KF_MAJOR_VERSION}::KIOCore
0062     Vosk
0063 )
0064 
0065 set_target_properties(voskspeechtotext
0066     PROPERTIES OUTPUT_NAME voskspeechtotext VERSION ${TEXTSPEECHTOTEXT_VERSION} SOVERSION ${TEXTSPEECHTOTEXT_SOVERSION}
0067 )
0068 
0069 install(TARGETS voskspeechtotext ${KDE_INSTALL_TARGETS_DEFAULT_ARGS} LIBRARY NAMELINK_SKIP)
0070 
0071 # Improve it. We need to fix on windows too.
0072 install(FILES "${CMAKE_BINARY_DIR}/vosk/libvosk.so" DESTINATION ${KDE_INSTALL_LIBDIR})
0073 
0074 
0075 add_library(speechtotext_vosk MODULE)
0076 
0077 ecm_qt_declare_logging_category(speechtotext_vosk
0078     HEADER speechtotext_vosk_debug.h
0079     IDENTIFIER SPEECHTOTEXT_VOSK_LOG
0080     CATEGORY_NAME org.kde.kf.speechtotext.vosk
0081     DESCRIPTION "vosk speechtotext"
0082     EXPORT KTEXTADDONS
0083 )
0084 
0085 target_sources(speechtotext_vosk PRIVATE
0086     voskspeechtotextclient.h
0087     voskspeechtotextclient.cpp
0088 
0089     voskspeechtotextplugin.h
0090     voskspeechtotextplugin.cpp
0091 
0092 )
0093 
0094 target_link_libraries(speechtotext_vosk PRIVATE KF${KF_MAJOR_VERSION}::TextSpeechToText KF${KF_MAJOR_VERSION}::I18n voskspeechtotext)
0095 
0096 install(TARGETS speechtotext_vosk  DESTINATION ${KDE_INSTALL_PLUGINDIR}/kf${QT_MAJOR_VERSION}/speechtotext/)
0097 
0098 if (BUILD_TESTING)
0099     add_subdirectory(autotests)
0100     add_subdirectory(tests)
0101 endif()