-
Notifications
You must be signed in to change notification settings - Fork 4
/
CMakeLists.txt
83 lines (58 loc) · 2.09 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
project(unity-voice CXX)
cmake_minimum_required(VERSION 2.8.9)
set(GETTEXT_PACKAGE unity-voice)
set(API_VERSION 1)
set(ABI_VERSION 1)
set(HMM_PATH "/usr/share/sphinx-voxforge-en/hmm/voxforge_en_sphinx.cd_cont_3000/" CACHE PATH "Path to hidden markov model")
set(DICT_PATH "/usr/share/sphinx-voxforge-en/lm/voxforge_en_sphinx.cd_cont_3000/voxforge_en_sphinx.dic" CACHE PATH "Path to dictionary")
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake" "${CMAKE_MODULE_PATH}")
option(ENABLE_VOICE_TESTS "Determine if voice tests will be run" OFF)
find_package(PkgConfig REQUIRED)
find_package(Qt5Core REQUIRED)
include_directories(${Qt5Core_INCLUDE_DIRS})
find_package(Qt5DBus COMPONENTS Qt5DBusMacros REQUIRED)
include_directories(${Qt5DBus_INCLUDE_DIRS})
pkg_check_modules(POCKETSPHINX REQUIRED pocketsphinx)
include_directories(${POCKETSPHINX_INCLUDE_DIRS})
find_package(Qt5Concurrent REQUIRED)
include_directories(${Qt5Concurrent_INCLUDE_DIRS})
find_package(Qt5Test REQUIRED)
include_directories(${Qt5Test_INCLUDE_DIRS})
pkg_check_modules(QTDBUSTEST REQUIRED libqtdbustest-1 REQUIRED)
include_directories(${QTDBUSTEST_INCLUDE_DIRS})
set(CMAKE_AUTOMOC ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(DATA_DIR "${CMAKE_SOURCE_DIR}/data")
set(SOURCE_DIR "${CMAKE_SOURCE_DIR}/src")
set(SOURCE_BINARY_DIR "${CMAKE_BINARY_DIR}/src")
include_directories(${SOURCE_DIR})
include_directories(${SOURCE_BINARY_DIR})
include(GNUInstallDirs)
include(Coverage)
include(GenerateExportHeader)
add_compiler_export_flags()
# Workaround for libexecdir on debian
if (EXISTS "/etc/debian_version")
set(CMAKE_INSTALL_LIBEXECDIR ${CMAKE_INSTALL_LIBDIR})
set(CMAKE_INSTALL_FULL_LIBEXECDIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBEXECDIR}")
endif()
set(LOCALE_DIR "${CMAKE_INSTALL_FULL_DATADIR}/locale")
add_definitions(
-std=c++11
-fno-permissive
-pedantic
-Wall
-Wextra
)
configure_file(
"${SOURCE_DIR}/config.h.in"
"${SOURCE_BINARY_DIR}/config.h"
)
add_subdirectory("src")
add_subdirectory("data")
enable_testing()
ADD_CUSTOM_TARGET(
check
${CMAKE_CTEST_COMMAND} --force-new-ctest-process --output-on-failure
)
add_subdirectory(tests)