From 2088aacdc807e3fe0c551984cec2791d2ada6f9d Mon Sep 17 00:00:00 2001 From: Frederik Gladhorn Date: Tue, 17 Sep 2019 10:27:32 +0200 Subject: Port to CMake Tests pass. Android is still missing. Fixes: QTBUG-78186 Change-Id: Ic0bca490d6a4df6c247ab0f7d03ee82eb218dd4e Reviewed-by: Qt CMake Build Bot Reviewed-by: Alexandru Croitor --- CMakeLists.txt | 19 ++++++ cmake/FindFlite.cmake | 90 +++++++++++++++++++++++++ cmake/FindSpeechDispatcher.cmake | 7 ++ coin/module_config.yaml | 13 ++++ examples/CMakeLists.txt | 7 ++ examples/speech/CMakeLists.txt | 5 ++ examples/speech/hello_speak/CMakeLists.txt | 34 ++++++++++ src/CMakeLists.txt | 5 ++ src/doc/CMakeLists.txt | 2 + src/plugins/CMakeLists.txt | 5 ++ src/plugins/tts/CMakeLists.txt | 27 ++++++++ src/plugins/tts/android/CMakeLists.txt | 4 ++ src/plugins/tts/android/jar/CMakeLists.txt | 22 ++++++ src/plugins/tts/android/src/CMakeLists.txt | 24 +++++++ src/plugins/tts/flite/CMakeLists.txt | 36 ++++++++++ src/plugins/tts/ios/CMakeLists.txt | 26 +++++++ src/plugins/tts/osx/CMakeLists.txt | 24 +++++++ src/plugins/tts/sapi/CMakeLists.txt | 40 +++++++++++ src/plugins/tts/speechdispatcher/CMakeLists.txt | 31 +++++++++ src/plugins/tts/winrt/CMakeLists.txt | 25 +++++++ src/tts/CMakeLists.txt | 35 ++++++++++ src/tts/configure.cmake | 32 +++++++++ tests/CMakeLists.txt | 10 +++ tests/auto/CMakeLists.txt | 4 ++ tests/auto/texttospeech/CMakeLists.txt | 24 +++++++ 25 files changed, 551 insertions(+) create mode 100644 CMakeLists.txt create mode 100644 cmake/FindFlite.cmake create mode 100644 cmake/FindSpeechDispatcher.cmake create mode 100644 coin/module_config.yaml create mode 100644 examples/CMakeLists.txt create mode 100644 examples/speech/CMakeLists.txt create mode 100644 examples/speech/hello_speak/CMakeLists.txt create mode 100644 src/CMakeLists.txt create mode 100644 src/doc/CMakeLists.txt create mode 100644 src/plugins/CMakeLists.txt create mode 100644 src/plugins/tts/CMakeLists.txt create mode 100644 src/plugins/tts/android/CMakeLists.txt create mode 100644 src/plugins/tts/android/jar/CMakeLists.txt create mode 100644 src/plugins/tts/android/src/CMakeLists.txt create mode 100644 src/plugins/tts/flite/CMakeLists.txt create mode 100644 src/plugins/tts/ios/CMakeLists.txt create mode 100644 src/plugins/tts/osx/CMakeLists.txt create mode 100644 src/plugins/tts/sapi/CMakeLists.txt create mode 100644 src/plugins/tts/speechdispatcher/CMakeLists.txt create mode 100644 src/plugins/tts/winrt/CMakeLists.txt create mode 100644 src/tts/CMakeLists.txt create mode 100644 src/tts/configure.cmake create mode 100644 tests/CMakeLists.txt create mode 100644 tests/auto/CMakeLists.txt create mode 100644 tests/auto/texttospeech/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..f438863 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,19 @@ +# Generated from qtspeech.pro. + +cmake_minimum_required(VERSION 3.15.0) + +project(QtSpeech + VERSION 6.0.0 + DESCRIPTION "Qt Speech Libraries" + HOMEPAGE_URL "https://qt.io/" + LANGUAGES CXX C +) + +find_package(Qt6 ${PROJECT_VERSION} CONFIG REQUIRED + COMPONENTS + BuildInternals + Core + OPTIONAL_COMPONENTS + Gui) + +qt_build_repo() diff --git a/cmake/FindFlite.cmake b/cmake/FindFlite.cmake new file mode 100644 index 0000000..9ffa150 --- /dev/null +++ b/cmake/FindFlite.cmake @@ -0,0 +1,90 @@ +# We can't create the same interface imported target multiple times, CMake will complain if we do +# that. This can happen if the find_package call is done in multiple different subdirectories. +if(TARGET Flite::Flite) + set(Flite_FOUND 1) + return() +endif() + +find_path(FLITE_INCLUDE_DIR + NAMES + flite/flite.h +) +find_library(FLITE_LIBRARY + NAMES + flite +) + +if(NOT FLITE_INCLUDE_DIR OR NOT FLITE_LIBRARY) + set(Flite_FOUND 0) + return() +endif() + +include(CMakePushCheckState) +include(CheckCXXSourceCompiles) + +# Flite can be built with ALSA support, +# in which case we need to link ALSA as well +find_package(ALSA QUIET) + +cmake_push_check_state(RESET) + +set(CMAKE_REQUIRED_INCLUDES "${FLITE_INCLUDE_DIR}") +set(CMAKE_REQUIRED_LIBRARIES "${FLITE_LIBRARY}") + +if(ALSA_FOUND) +list(APPEND CMAKE_REQUIRED_LIBRARIES "${ALSA_LIBRARIES}") +endif() + +check_cxx_source_compiles(" +#include + +static int fliteAudioCb(const cst_wave *w, int start, int size, + int last, cst_audio_streaming_info *asi) +{ + (void)w; + (void)start; + (void)size; + (void)last; + (void)asi; + return CST_AUDIO_STREAM_STOP; +} + +int main() +{ + cst_audio_streaming_info *asi = new_audio_streaming_info(); + asi->asc = fliteAudioCb; // This fails for old Flite + new_audio_streaming_info(); + return 0; +} +" HAVE_FLITE) + +cmake_pop_check_state() + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(FLITE + FOUND_VAR + FLITE_FOUND + REQUIRED_VARS + FLITE_LIBRARY + FLITE_INCLUDE_DIR + HAVE_FLITE +) + +if(FLITE_FOUND) + add_library(Flite::Flite UNKNOWN IMPORTED) + set_target_properties(Flite::Flite PROPERTIES + IMPORTED_LOCATION "${FLITE_LIBRARY}" + INTERFACE_INCLUDE_DIRECTORIES "${FLITE_INCLUDE_DIR}" + INTERFACE_LINK_LIBRARIES "${ALSA_LIBRARIES}" + ) +endif() + +mark_as_advanced(FLITE_LIBRARY FLITE_INCLUDE_DIR HAVE_FLITE) + + +if(HAVE_FLITE) + set(Flite_FOUND 1) +else() + message("Flite was found, but the version is too old (<2.0.0)") + set(Flite_FOUND 0) +endif() diff --git a/cmake/FindSpeechDispatcher.cmake b/cmake/FindSpeechDispatcher.cmake new file mode 100644 index 0000000..e5f6d1a --- /dev/null +++ b/cmake/FindSpeechDispatcher.cmake @@ -0,0 +1,7 @@ +include(FindPkgConfig) + +pkg_check_modules(SpeechDispatcher "speech-dispatcher" IMPORTED_TARGET GLOBAL) + +if (TARGET PkgConfig::SpeechDispatcher) + add_library(SpeechDispatcher::SpeechDispatcher ALIAS PkgConfig::SpeechDispatcher) +endif() diff --git a/coin/module_config.yaml b/coin/module_config.yaml new file mode 100644 index 0000000..9f29e11 --- /dev/null +++ b/coin/module_config.yaml @@ -0,0 +1,13 @@ +version: 1 +accept_configuration: + condition: property + property: host.os + equals_property: target.os + +build_instructions: + - !include "{{qt/qtbase}}/prepare_building_env.yaml" + - !include "{{qt/qtbase}}/cmake_module_build_instructions.yaml" + - !include "{{qt/qtbase}}/cmake_build_and_upload_test_artifacts.yaml" + +test_instructions: + - !include "{{qt/qtbase}}/cmake_regular_test_instructions.yaml" diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt new file mode 100644 index 0000000..38fa822 --- /dev/null +++ b/examples/CMakeLists.txt @@ -0,0 +1,7 @@ +# Generated from examples.pro. + +qt_examples_build_begin() + +add_subdirectory(speech) + +qt_examples_build_end() diff --git a/examples/speech/CMakeLists.txt b/examples/speech/CMakeLists.txt new file mode 100644 index 0000000..e66e7a0 --- /dev/null +++ b/examples/speech/CMakeLists.txt @@ -0,0 +1,5 @@ +# Generated from speech.pro. + +if(TARGET Qt::Widgets) + add_subdirectory(hello_speak) +endif() diff --git a/examples/speech/hello_speak/CMakeLists.txt b/examples/speech/hello_speak/CMakeLists.txt new file mode 100644 index 0000000..f89bce1 --- /dev/null +++ b/examples/speech/hello_speak/CMakeLists.txt @@ -0,0 +1,34 @@ +# Generated from hello_speak.pro. + +cmake_minimum_required(VERSION 3.14) +project(hello_speak LANGUAGES CXX) + +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt6 COMPONENTS Core) +find_package(Qt6 COMPONENTS Gui) +find_package(Qt6 COMPONENTS Widgets) +find_package(Qt6 COMPONENTS TextToSpeech) + +add_qt_gui_executable(hello_speak + main.cpp + mainwindow.cpp mainwindow.h mainwindow.ui +) +target_link_libraries(hello_speak PUBLIC + Qt::Core + Qt::Gui + Qt::TextToSpeech + Qt::Widgets +) + +install(TARGETS hello_speak + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt new file mode 100644 index 0000000..9a831a4 --- /dev/null +++ b/src/CMakeLists.txt @@ -0,0 +1,5 @@ +# Generated from src.pro. + +add_subdirectory(tts) +add_subdirectory(plugins) +add_subdirectory(doc) diff --git a/src/doc/CMakeLists.txt b/src/doc/CMakeLists.txt new file mode 100644 index 0000000..21a0ea1 --- /dev/null +++ b/src/doc/CMakeLists.txt @@ -0,0 +1,2 @@ +# Generated from doc.pro. + diff --git a/src/plugins/CMakeLists.txt b/src/plugins/CMakeLists.txt new file mode 100644 index 0000000..d8e6478 --- /dev/null +++ b/src/plugins/CMakeLists.txt @@ -0,0 +1,5 @@ +# Generated from plugins.pro. + +if(TARGET Qt::TextToSpeech) + add_subdirectory(tts) +endif() diff --git a/src/plugins/tts/CMakeLists.txt b/src/plugins/tts/CMakeLists.txt new file mode 100644 index 0000000..1cc8b66 --- /dev/null +++ b/src/plugins/tts/CMakeLists.txt @@ -0,0 +1,27 @@ +# Generated from tts.pro. + +if(QT_FEATURE_speechd AND UNIX) + add_subdirectory(speechdispatcher) +endif() +if(WIN32 AND NOT WINRT) + add_subdirectory(sapi) +endif() +if(WINRT) + add_subdirectory(winrt) +endif() +if(APPLE_OSX) + # begin special case + if(TARGET Qt::Gui) + add_subdirectory(osx) + endif() + # end special case +endif() +if(APPLE_UIKIT) + add_subdirectory(ios) +endif() +if(ANDROID) + add_subdirectory(android) +endif() +if(QT_FEATURE_flite AND TARGET Qt::Multimedia) + add_subdirectory(flite) +endif() diff --git a/src/plugins/tts/android/CMakeLists.txt b/src/plugins/tts/android/CMakeLists.txt new file mode 100644 index 0000000..22fe2b6 --- /dev/null +++ b/src/plugins/tts/android/CMakeLists.txt @@ -0,0 +1,4 @@ +# Generated from android.pro. + +add_subdirectory(jar) +add_subdirectory(src) diff --git a/src/plugins/tts/android/jar/CMakeLists.txt b/src/plugins/tts/android/jar/CMakeLists.txt new file mode 100644 index 0000000..b8c8e3b --- /dev/null +++ b/src/plugins/tts/android/jar/CMakeLists.txt @@ -0,0 +1,22 @@ +# Generated from jar.pro. + +##################################################################### +## QtTextToSpeech Binary: +##################################################################### + +add_qt_executable(QtTextToSpeech + GUI + OUTPUT_DIRECTORY "$$[QT_INSTALL_PREFIX]/jar" + INSTALL_DIRECTORY "$$[QT_INSTALL_PREFIX]/jar" + OUTPUT_DIRECTORY "$$MODULE_BASE_OUTDIR/jar" + PUBLIC_LIBRARIES + Qt::Gui +) + +#### Keys ignored in scope 1:.:.:jar.pro:: +# API_VERSION = "android-21" +# JAVACLASSPATH = "$$PWD/src" +# JAVASOURCES = "$$PATHPREFIX/QtTextToSpeech.java" +# OTHER_FILES = "$$JAVASOURCES" +# PATHPREFIX = "$$PWD/src/org/qtproject/qt5/android/speech" +# _LOADED = "qt_build_paths" diff --git a/src/plugins/tts/android/src/CMakeLists.txt b/src/plugins/tts/android/src/CMakeLists.txt new file mode 100644 index 0000000..12c00d5 --- /dev/null +++ b/src/plugins/tts/android/src/CMakeLists.txt @@ -0,0 +1,24 @@ +# Generated from src.pro. + +##################################################################### +## qttexttospeech_android Plugin: +##################################################################### + +add_qt_plugin(qttexttospeech_android + TYPE texttospeech + CLASS_NAME QTextToSpeechEngineAndroid + SOURCES + qtexttospeech_android.cpp qtexttospeech_android.h + qtexttospeech_android_plugin.cpp qtexttospeech_android_plugin.h + LIBRARIES + Qt::CorePrivate + PUBLIC_LIBRARIES + Qt::Core + Qt::TextToSpeech +) + +#### Keys ignored in scope 1:.:.:src.pro:: +# OTHER_FILES = "android_plugin.json" +# PLUGIN_CLASS_NAME = "QTextToSpeechEngineAndroid" +# PLUGIN_TYPE = "texttospeech" +# _LOADED = "qt_plugin" diff --git a/src/plugins/tts/flite/CMakeLists.txt b/src/plugins/tts/flite/CMakeLists.txt new file mode 100644 index 0000000..a35301c --- /dev/null +++ b/src/plugins/tts/flite/CMakeLists.txt @@ -0,0 +1,36 @@ +# Generated from flite.pro. + +##################################################################### +## qttexttospeech_flite Plugin: +##################################################################### + +add_qt_plugin(qttexttospeech_flite + TYPE texttospeech + CLASS_NAME QTextToSpeechEngineFlite + SOURCES + ../common/qtexttospeechprocessor.cpp ../common/qtexttospeechprocessor_p.h + qtexttospeech_flite.cpp qtexttospeech_flite.h + qtexttospeech_flite_plugin.cpp qtexttospeech_flite_plugin.h + qtexttospeech_flite_processor.cpp qtexttospeech_flite_processor.h + LIBRARIES + Flite::Flite + PUBLIC_LIBRARIES + Qt::Core + Qt::Multimedia + Qt::TextToSpeech +) + +#### Keys ignored in scope 1:.:.:flite.pro:: +# OTHER_FILES = "flite_plugin.json" +# PLUGIN_CLASS_NAME = "QTextToSpeechEngineFlite" +# PLUGIN_TYPE = "texttospeech" +# QT_FOR_CONFIG = "texttospeech-private" +# _LOADED = "qt_plugin" + +## Scopes: +##################################################################### + +extend_target(qttexttospeech_flite CONDITION QT_FEATURE_flite_alsa + LIBRARIES + ALSA::ALSA +) diff --git a/src/plugins/tts/ios/CMakeLists.txt b/src/plugins/tts/ios/CMakeLists.txt new file mode 100644 index 0000000..d4bfc1e --- /dev/null +++ b/src/plugins/tts/ios/CMakeLists.txt @@ -0,0 +1,26 @@ +# Generated from ios.pro. + +##################################################################### +## qtexttospeech_speechios Plugin: +##################################################################### + +add_qt_plugin(qtexttospeech_speechios + TYPE texttospeech + CLASS_NAME QTextToSpeechPluginIos + SOURCES + qtexttospeech_ios.mm + qtexttospeech_ios_plugin.cpp qtexttospeech_ios_plugin.h + PUBLIC_LIBRARIES + ${FWAVFoundation} + ${FWFoundation} + Qt::Core + Qt::Gui + Qt::TextToSpeech +) + +#### Keys ignored in scope 1:.:.:ios.pro:: +# OBJECTIVE_HEADERS = "qtexttospeech_ios.h" +# OTHER_FILES = "ios_plugin.json" +# PLUGIN_CLASS_NAME = "QTextToSpeechPluginIos" +# PLUGIN_TYPE = "texttospeech" +# _LOADED = "qt_plugin" diff --git a/src/plugins/tts/osx/CMakeLists.txt b/src/plugins/tts/osx/CMakeLists.txt new file mode 100644 index 0000000..578f829 --- /dev/null +++ b/src/plugins/tts/osx/CMakeLists.txt @@ -0,0 +1,24 @@ +# Generated from osx.pro. + +##################################################################### +## qtexttospeech_speechosx Plugin: +##################################################################### + +add_qt_plugin(qtexttospeech_speechosx + TYPE texttospeech + CLASS_NAME QTextToSpeechPluginOsx + SOURCES + qtexttospeech_osx.h qtexttospeech_osx.mm + qtexttospeech_osx_plugin.cpp qtexttospeech_osx_plugin.h + PUBLIC_LIBRARIES + ${FWCocoa} + Qt::Core + Qt::Gui + Qt::TextToSpeech +) + +#### Keys ignored in scope 1:.:.:osx.pro:: +# OTHER_FILES = "osx_plugin.json" +# PLUGIN_CLASS_NAME = "QTextToSpeechPluginOsx" +# PLUGIN_TYPE = "texttospeech" +# _LOADED = "qt_plugin" diff --git a/src/plugins/tts/sapi/CMakeLists.txt b/src/plugins/tts/sapi/CMakeLists.txt new file mode 100644 index 0000000..7b2c156 --- /dev/null +++ b/src/plugins/tts/sapi/CMakeLists.txt @@ -0,0 +1,40 @@ +# Generated from sapi.pro. + +##################################################################### +## qtexttospeech_sapi Plugin: +##################################################################### + +add_qt_plugin(qtexttospeech_sapi + TYPE texttospeech + CLASS_NAME QTextToSpeechPluginSapi + SOURCES + qtexttospeech_sapi.cpp qtexttospeech_sapi.h + qtexttospeech_sapi_plugin.cpp qtexttospeech_sapi_plugin.h + PUBLIC_LIBRARIES + Qt::Core + Qt::Gui + Qt::TextToSpeech + # COMPILE_OPTIONS # special case + # --Zc:strictStrings # special case +) + +#### Keys ignored in scope 1:.:.:sapi.pro:: +# OTHER_FILES = "sapi_plugin.json" +# PLUGIN_CLASS_NAME = "QTextToSpeechPluginSapi" +# PLUGIN_TYPE = "texttospeech" +# QMAKE_CFLAGS = "--Zc:strictStrings" +# QMAKE_CFLAGS_RELEASE = "--Zc:strictStrings" +# QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO = "--Zc:strictStrings" +# QMAKE_CXXFLAGS_RELEASE = "--Zc:strictStrings" +# QMAKE_CXXFLAGS_RELEASE_WITH_DEBUGINFO = "--Zc:strictStrings" +# _LOADED = "qt_plugin" + +## Scopes: +##################################################################### + +extend_target(qtexttospeech_sapi CONDITION mingw + PUBLIC_LIBRARIES + ole32 + sapi + uuid +) diff --git a/src/plugins/tts/speechdispatcher/CMakeLists.txt b/src/plugins/tts/speechdispatcher/CMakeLists.txt new file mode 100644 index 0000000..179815b --- /dev/null +++ b/src/plugins/tts/speechdispatcher/CMakeLists.txt @@ -0,0 +1,31 @@ +# Generated from speechdispatcher.pro. + +##################################################################### +## qtexttospeech_speechd Plugin: +##################################################################### + +add_qt_plugin(qtexttospeech_speechd + TYPE texttospeech + CLASS_NAME QTextToSpeechPluginSpeechd + SOURCES + qtexttospeech_speechd.cpp qtexttospeech_speechd.h + qtexttospeech_speechd_plugin.cpp qtexttospeech_speechd_plugin.h + PUBLIC_LIBRARIES + Qt::Core + Qt::TextToSpeech +) + +#### Keys ignored in scope 1:.:.:speechdispatcher.pro:: +# OTHER_FILES = "speechd_plugin.json" +# PLUGIN_CLASS_NAME = "QTextToSpeechPluginSpeechd" +# PLUGIN_TYPE = "texttospeech" +# QT_FOR_CONFIG = "texttospeech-private" +# _LOADED = "qt_plugin" + +## Scopes: +##################################################################### + +extend_target(qtexttospeech_speechd CONDITION QT_FEATURE_speechd + LIBRARIES + SpeechDispatcher::SpeechDispatcher +) diff --git a/src/plugins/tts/winrt/CMakeLists.txt b/src/plugins/tts/winrt/CMakeLists.txt new file mode 100644 index 0000000..e9d5f50 --- /dev/null +++ b/src/plugins/tts/winrt/CMakeLists.txt @@ -0,0 +1,25 @@ +# Generated from winrt.pro. + +##################################################################### +## qtexttospeech_winrt Plugin: +##################################################################### + +add_qt_plugin(qtexttospeech_winrt + TYPE texttospeech + CLASS_NAME QTextToSpeechPluginWinRT + SOURCES + qtexttospeech_winrt.cpp qtexttospeech_winrt.h + qtexttospeech_winrt_plugin.cpp qtexttospeech_winrt_plugin.h + LIBRARIES + Qt::CorePrivate + PUBLIC_LIBRARIES + Qt::Core + Qt::Gui + Qt::TextToSpeech +) + +#### Keys ignored in scope 1:.:.:winrt.pro:: +# OTHER_FILES = "winrt_plugin.json" +# PLUGIN_CLASS_NAME = "QTextToSpeechPluginWinRT" +# PLUGIN_TYPE = "texttospeech" +# _LOADED = "qt_plugin" diff --git a/src/tts/CMakeLists.txt b/src/tts/CMakeLists.txt new file mode 100644 index 0000000..bb5f9ca --- /dev/null +++ b/src/tts/CMakeLists.txt @@ -0,0 +1,35 @@ +# Generated from tts.pro. + +##################################################################### +## TextToSpeech Module: +##################################################################### + +add_qt_module(TextToSpeech + PLUGIN_TYPES texttospeech + SOURCES + qtexttospeech.cpp qtexttospeech.h qtexttospeech_p.h + qtexttospeech_global.h + qtexttospeechengine.cpp qtexttospeechengine.h + qtexttospeechplugin.cpp qtexttospeechplugin.h + qvoice.cpp qvoice.h qvoice_p.h + DEFINES + QTEXTTOSPEECH_LIBRARY + LIBRARIES + Qt::CorePrivate + PUBLIC_LIBRARIES + Qt::Core +) + +if(ANDROID) + set_property(TARGET TextToSpeech APPEND PROPERTY QT_ANDROID_BUNDLED_JAR_DEPENDENCIES + jar/QtTextToSpeech.jar + ) + set_property(TARGET TextToSpeech APPEND PROPERTY QT_ANDROID_LIB_DEPENDENCIES + plugins/texttospeech/libqttexttospeech_android.so + ) +endif() + +#### Keys ignored in scope 1:.:.:tts.pro:: +# MODULE = "texttospeech" +# MODULE_PLUGIN_TYPES = "texttospeech" +# _LOADED = "qt_module" diff --git a/src/tts/configure.cmake b/src/tts/configure.cmake new file mode 100644 index 0000000..7e68d83 --- /dev/null +++ b/src/tts/configure.cmake @@ -0,0 +1,32 @@ + + +#### Inputs + + + +#### Libraries + +qt_find_package(Flite PROVIDED_TARGETS Flite::Flite) +qt_find_package(ALSA PROVIDED_TARGETS ALSA::ALSA) +qt_find_package(SpeechDispatcher PROVIDED_TARGETS SpeechDispatcher::SpeechDispatcher) + + +#### Tests + + + +#### Features + +qt_feature("flite" PRIVATE + LABEL "Flite" + CONDITION Flite_FOUND +) +qt_feature("flite_alsa" PRIVATE + LABEL "Flite with ALSA" + CONDITION Flite_FOUND AND ALSA_FOUND +) +qt_feature("speechd" PUBLIC + LABEL "Speech Dispatcher" + AUTODETECT UNIX + CONDITION SpeechDispatcher_FOUND +) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt new file mode 100644 index 0000000..eb3cbbb --- /dev/null +++ b/tests/CMakeLists.txt @@ -0,0 +1,10 @@ +# Generated from tests.pro. + +if(NOT TARGET Qt::Test) + cmake_minimum_required(VERSION 3.15.0) + project(QtSpeechTests LANGUAGES C CXX) # special case + find_package(Qt6 ${PROJECT_VERSION} REQUIRED COMPONENTS BuildInternals Core Test TextToSpeech) # special case + qt_set_up_standalone_tests_build() +endif() + +qt_build_tests() diff --git a/tests/auto/CMakeLists.txt b/tests/auto/CMakeLists.txt new file mode 100644 index 0000000..57e92e7 --- /dev/null +++ b/tests/auto/CMakeLists.txt @@ -0,0 +1,4 @@ +# Generated from auto.pro. + +# add_subdirectory(cmake) # special case +add_subdirectory(texttospeech) diff --git a/tests/auto/texttospeech/CMakeLists.txt b/tests/auto/texttospeech/CMakeLists.txt new file mode 100644 index 0000000..b9fecf7 --- /dev/null +++ b/tests/auto/texttospeech/CMakeLists.txt @@ -0,0 +1,24 @@ +# Generated from texttospeech.pro. + +##################################################################### +## tst_qtexttospeech Test: +##################################################################### + +add_qt_test(tst_qtexttospeech + GUI + SOURCES + tst_qtexttospeech.cpp + LIBRARIES + Qt::TextToSpeechPrivate + PUBLIC_LIBRARIES + Qt::TextToSpeech +) + +## Scopes: +##################################################################### + +qt_find_package(SpeechDispatcher PROVIDED_TARGETS SpeechDispatcher::SpeechDispatcher) # special case +extend_target(tst_qtexttospeech CONDITION QT_FEATURE_speechd + PUBLIC_LIBRARIES + SpeechDispatcher::SpeechDispatcher +) -- cgit v1.2.3