diff options
author | Joerg Bornemann <joerg.bornemann@qt.io> | 2019-05-07 09:02:17 +0200 |
---|---|---|
committer | Joerg Bornemann <joerg.bornemann@qt.io> | 2019-06-07 10:01:00 +0200 |
commit | e80a2764eae65743d3d6a3195c92fd3a3fee998a (patch) | |
tree | df9207c41dc8caa305674afb97985b389032efa9 | |
parent | 5cf744a096bb079bd33e417e9fb62a6d6726a3a3 (diff) |
Move qtspeech over to the new config system
Started-by: Liang Qi <liang.qi@qt.io>
Change-Id: If60400ca3eac3cd0fe99ffb5024862eb22e5b744
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Liang Qi <liang.qi@qt.io>
-rw-r--r-- | config.tests/flite/flite.cpp | 56 | ||||
-rw-r--r-- | config.tests/flite/flite.pri | 5 | ||||
-rw-r--r-- | config.tests/flite/flite.pro | 1 | ||||
-rw-r--r-- | config.tests/flite_alsa/flite_alsa.pro | 2 | ||||
-rw-r--r-- | config.tests/speechd/speechd.cpp | 45 | ||||
-rw-r--r-- | config.tests/speechd/speechd.pro | 3 | ||||
-rw-r--r-- | config_help.txt | 5 | ||||
-rw-r--r-- | configure.json | 5 | ||||
-rw-r--r-- | qtspeech.pro | 6 | ||||
-rw-r--r-- | src/plugins/tts/flite/flite.pro | 6 | ||||
-rw-r--r-- | src/plugins/tts/speechdispatcher/speechdispatcher.pro | 7 | ||||
-rw-r--r-- | src/plugins/tts/tts.pro | 6 | ||||
-rw-r--r-- | src/tts/configure.json | 85 | ||||
-rw-r--r-- | tests/auto/texttospeech/texttospeech.pro | 11 | ||||
-rw-r--r-- | tests/auto/texttospeech/tst_qtexttospeech.cpp | 3 |
15 files changed, 108 insertions, 138 deletions
diff --git a/config.tests/flite/flite.cpp b/config.tests/flite/flite.cpp deleted file mode 100644 index 10b135f..0000000 --- a/config.tests/flite/flite.cpp +++ /dev/null @@ -1,56 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Speech module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPLv3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include <flite/flite.h> - -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; -} diff --git a/config.tests/flite/flite.pri b/config.tests/flite/flite.pri deleted file mode 100644 index 9d24740..0000000 --- a/config.tests/flite/flite.pri +++ /dev/null @@ -1,5 +0,0 @@ - -SOURCES = $$PWD/flite.cpp -CONFIG -= qt - -LIBS += -lflite_cmu_us_kal16 -lflite_usenglish -lflite_cmulex -lflite diff --git a/config.tests/flite/flite.pro b/config.tests/flite/flite.pro deleted file mode 100644 index 3f4b1ce..0000000 --- a/config.tests/flite/flite.pro +++ /dev/null @@ -1 +0,0 @@ -include(flite.pri) diff --git a/config.tests/flite_alsa/flite_alsa.pro b/config.tests/flite_alsa/flite_alsa.pro deleted file mode 100644 index be24c6e..0000000 --- a/config.tests/flite_alsa/flite_alsa.pro +++ /dev/null @@ -1,2 +0,0 @@ -LIBS += -lasound -include(../flite/flite.pri) diff --git a/config.tests/speechd/speechd.cpp b/config.tests/speechd/speechd.cpp deleted file mode 100644 index 9910b31..0000000 --- a/config.tests/speechd/speechd.cpp +++ /dev/null @@ -1,45 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the Qt Speech module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL3$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see http://www.qt.io/terms-conditions. For further -** information use the contact form at http://www.qt.io/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPLv3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or later as published by the Free -** Software Foundation and appearing in the file LICENSE.GPL included in -** the packaging of this file. Please review the following information to -** ensure the GNU General Public License version 2.0 requirements will be -** met: http://www.gnu.org/licenses/gpl-2.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include <libspeechd.h> - -int main() -{ - SPDConnection *speechDispatcher = spd_open("QtConfigTest", "main", 0, SPD_MODE_THREADED); - if (speechDispatcher) - spd_close(speechDispatcher); - return 0; -} diff --git a/config.tests/speechd/speechd.pro b/config.tests/speechd/speechd.pro deleted file mode 100644 index 48e2ffa..0000000 --- a/config.tests/speechd/speechd.pro +++ /dev/null @@ -1,3 +0,0 @@ -SOURCES = speechd.cpp - -LIBS += -lspeechd diff --git a/config_help.txt b/config_help.txt new file mode 100644 index 0000000..22d4f09 --- /dev/null +++ b/config_help.txt @@ -0,0 +1,5 @@ +TextToSpeech options: + + -flite ............... Enable Flite support [auto] (Unix only) + -flite-alsa .......... Enable Flite with ALSA support [auto] (Unix only) + -speechd ............. Enable speech dispatcher support [auto] (Unix only) diff --git a/configure.json b/configure.json new file mode 100644 index 0000000..010d569 --- /dev/null +++ b/configure.json @@ -0,0 +1,5 @@ +{ + "subconfigs": [ + "src/tts" + ] +} diff --git a/qtspeech.pro b/qtspeech.pro index 0ae27e2..58c33f2 100644 --- a/qtspeech.pro +++ b/qtspeech.pro @@ -1,7 +1 @@ -load(configure) -qtCompileTest(flite) -qtCompileTest(flite_alsa) -!packagesExist(speech-dispatcher) { - qtCompileTest(speechd) -} load(qt_parts) diff --git a/src/plugins/tts/flite/flite.pro b/src/plugins/tts/flite/flite.pro index 3a5af39..acf60cc 100644 --- a/src/plugins/tts/flite/flite.pro +++ b/src/plugins/tts/flite/flite.pro @@ -1,5 +1,6 @@ TARGET = qttexttospeech_flite QT = core multimedia texttospeech +QT_FOR_CONFIG += texttospeech-private PLUGIN_TYPE = texttospeech PLUGIN_CLASS_NAME = QTextToSpeechEngineFlite @@ -20,6 +21,5 @@ SOURCES += \ OTHER_FILES += \ flite_plugin.json -LIBS += -lflite_cmu_us_kal16 -lflite_usenglish -lflite_cmulex -lflite - -config_flite_alsa: LIBS += -lasound +QMAKE_USE_PRIVATE += flite +qtConfig(flite_alsa): QMAKE_USE_PRIVATE += flite_alsa diff --git a/src/plugins/tts/speechdispatcher/speechdispatcher.pro b/src/plugins/tts/speechdispatcher/speechdispatcher.pro index a6795e5..d600700 100644 --- a/src/plugins/tts/speechdispatcher/speechdispatcher.pro +++ b/src/plugins/tts/speechdispatcher/speechdispatcher.pro @@ -5,10 +5,7 @@ PLUGIN_CLASS_NAME = QTextToSpeechPluginSpeechd load(qt_plugin) QT = core texttospeech - -CONFIG += link_pkgconfig -packagesExist(speech-dispatcher): PKGCONFIG = speech-dispatcher -config_speechd: LIBS += -lspeechd +QT_FOR_CONFIG += texttospeech-private HEADERS += \ qtexttospeech_speechd.h \ @@ -20,3 +17,5 @@ SOURCES += \ OTHER_FILES += \ speechd_plugin.json + +qtConfig(speechd): QMAKE_USE_PRIVATE += speechd diff --git a/src/plugins/tts/tts.pro b/src/plugins/tts/tts.pro index 7307e40..693bda1 100644 --- a/src/plugins/tts/tts.pro +++ b/src/plugins/tts/tts.pro @@ -1,8 +1,8 @@ TEMPLATE = subdirs +QT_FOR_CONFIG += texttospeech-private unix { - CONFIG += link_pkgconfig - config_speechd | packagesExist(speech-dispatcher) { + qtConfig(speechd) { SUBDIRS += speechdispatcher } } @@ -15,6 +15,6 @@ uikit: SUBDIRS += ios android: SUBDIRS += android -config_flite | config_flite_alsa { +qtConfig(flite) { qtHaveModule(multimedia): SUBDIRS += flite } diff --git a/src/tts/configure.json b/src/tts/configure.json new file mode 100644 index 0000000..2fb68e2 --- /dev/null +++ b/src/tts/configure.json @@ -0,0 +1,85 @@ +{ + "module": "texttospeech", + "depends": [ + "gui" + ], + + "commandline": { + "options": { + "flite": "boolean", + "flite-alsa": { "type": "boolean", "name": "flite_alsa" }, + "speechd": "boolean" + } + }, + + "libraries": { + "flite": { + "label": "Flite", + "test": { + "include": "flite/flite.h", + "tail": [ + "static int fliteAudioCb(const cst_wave *, int, int, int, cst_audio_streaming_info *)", + "{ return CST_AUDIO_STREAM_STOP; }" + ], + "main": [ + "cst_audio_streaming_info *asi = new_audio_streaming_info();", + "asi->asc = fliteAudioCb; // This fails for old Flite", + "new_audio_streaming_info();" + ] + }, + "sources": [ + "-lflite_cmu_us_kal16 -lflite_usenglish -lflite_cmulex -lflite" + ] + }, + "flite_alsa": { + "label": "Flite with ALSA", + "sources": [ + { "type": "pkgConfig", "args": "alsa" }, + "-lasound" + ] + }, + "speechd": { + "label": "Speech Dispatcher", + "test": { + "include": "libspeechd.h", + "main": [ + "spd_close(spd_open(\"QtConfigTest\", \"main\", 0, SPD_MODE_THREADED));" + ] + }, + "sources": [ + { "type": "pkgConfig", "args": "speech-dispatcher" }, + "-lspeechd" + ] + } + }, + + "features": { + "flite": { + "label": "Flite", + "condition": "libs.flite", + "output": [ "privateFeature" ] + }, + "flite_alsa": { + "label": "Flite with ALSA", + "condition": "libs.flite && libs.flite_alsa", + "output": [ "privateFeature" ] + }, + "speechd": { + "label": "Speech Dispatcher", + "autoDetect": "config.unix", + "condition": "libs.speechd", + "output": [ "publicFeature" ] + } + }, + + "summary": [ + { + "section": "Qt TextToSpeech", + "entries": [ + "flite", + "flite_alsa", + "speechd" + ] + } + ] +} diff --git a/tests/auto/texttospeech/texttospeech.pro b/tests/auto/texttospeech/texttospeech.pro index 4ca4419..8d89574 100644 --- a/tests/auto/texttospeech/texttospeech.pro +++ b/tests/auto/texttospeech/texttospeech.pro @@ -1,13 +1,6 @@ CONFIG += testcase TARGET = tst_qtexttospeech -QT = testlib core texttospeech +QT = testlib core texttospeech-private SOURCES += tst_qtexttospeech.cpp -unix { - CONFIG += link_pkgconfig - packagesExist(speech-dispatcher): PKGCONFIG = speech-dispatcher - config_speechd | packagesExist(speech-dispatcher) { - DEFINES += HAVE_SPEECHD - } - config_speechd: LIBS += -lspeechd -} +qtConfig(speechd): QMAKE_USE += speechd diff --git a/tests/auto/texttospeech/tst_qtexttospeech.cpp b/tests/auto/texttospeech/tst_qtexttospeech.cpp index a5a1f0d..9996659 100644 --- a/tests/auto/texttospeech/tst_qtexttospeech.cpp +++ b/tests/auto/texttospeech/tst_qtexttospeech.cpp @@ -38,8 +38,9 @@ #include <QTest> #include <QTextToSpeech> #include <QSignalSpy> +#include <qttexttospeech-config.h> -#if defined(HAVE_SPEECHD) +#if QT_CONFIG(speechd) #include <libspeechd.h> #if LIBSPEECHD_MAJOR_VERSION == 0 && LIBSPEECHD_MINOR_VERSION < 9 #define HAVE_SPEECHD_BEFORE_090 |