-
-
Notifications
You must be signed in to change notification settings - Fork 18
/
CMakeLists.txt
162 lines (132 loc) · 5.1 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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
cmake_minimum_required(VERSION 2.8.9)
cmake_policy(SET CMP0017 NEW)
cmake_policy(SET CMP0002 OLD)
cmake_policy(SET CMP0026 OLD)
if(NOT "${CMAKE_VERSION}" VERSION_LESS 2.8.12)
cmake_policy(SET CMP0022 OLD)
endif()
project(Simon)
ENABLE_TESTING()
set(CMAKE_SIMON_VERSION_MAJOR 0)
set(CMAKE_SIMON_VERSION_MINOR 4)
set(CMAKE_SIMON_VERSION_PATCH 80)
set(CMAKE_SIMON_VERSION_STRING "${CMAKE_SIMON_VERSION_MAJOR}.${CMAKE_SIMON_VERSION_MINOR}.${CMAKE_SIMON_VERSION_PATCH}")
configure_file(version.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/version.h)
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH})
find_package(KDE4 "4.4" REQUIRED)
include(KDE4Macros NO_POLICY_SCOPE)
find_package(Qt4 COMPONENTS QtCore QtDbus QtGui QtTest QtXml QtScript QtConcurrent REQUIRED)
find_package(Qwt6 REQUIRED)
macro_optional_find_package(LibSampleRate)
macro_log_feature(LIBSAMPLERATE_FOUND "LibSampleRate" "Resampling library" "http://www.mega-nerd.com/SRC/" FALSE "" "Required to activate resampling.")
include_directories(${CMAKE_BINARY_DIR} .)
if(LIBSAMPLERATE_FOUND)
include_directories(${LIBSAMPLERATE_INCLUDE_DIR})
add_definitions(${LIBSAMPLERATE_DEFINITIONS})
endif(LIBSAMPLERATE_FOUND)
IF(UNIX AND NOT APPLE AND NOT WIN32)
find_package(ALSA REQUIRED)
set(plattformLibraries ${ALSA_LIBRARY})
include_directories(${ALSA_INCLUDE_DIR})
ENDIF()
if (APPLE)
ENDIF()
IF (WIN32)
find_package(DirectSound REQUIRED)
set(plattformLibraries ${DIRECTSOUND_LIBRARY})
include_directories(${DIRECTSOUND_INCLUDE_DIRS})
ENDIF()
find_program(PSPHINX "pocketsphinx_batch")
find_program(PJULIUS "julius")
if(UNIX)
FIND_LIBRARY(X11_XTest_LIB Xtst ${X11_LIB_SEARCH_PATH})
FIND_LIBRARY(X11_X11_LIB X11 ${X11_LIB_SEARCH_PATH})
endif(UNIX)
macro_optional_find_package(KdepimLibs 4.5.60)
macro_log_feature(KdepimLibs_FOUND "KDE PIM Libs" "KDE Libraries for PIM" "http://pim.kde.org/" FALSE "4.5.60" "Required for PIM plugin.")
if(UNIX AND NOT APPLE)
set(USE_PLASMA true CACHE BOOL "Use the plasma data engines in the dialog plugin")
else()
set(USE_PLASMA false)
endif()
if(USE_PLASMA)
add_definitions(-DUSE_PLASMA)
endif(USE_PLASMA)
macro_optional_find_package(QAccessibilityClient)
macro_log_feature(QAccessibilityClient_FOUND "qaccessibilityclient" "KDE client-side accessibility library" "https://projects.kde.org/projects/playground/accessibility/libkdeaccessibilityclient" FALSE "" "Required to enable ATSPI plugin.")
find_package(Sphinxbase)
macro_log_feature(SphinxBase_LIBRARIES "Sphinxbase"
"Open source toolkit for speech recognition" "http://cmusphinx.sourceforge.net/"
FALSE "" "Required to build Sphinx backend")
find_package(Pocketsphinx)
macro_log_feature(POCKETSPHINX_LIBRARIES "PocketSphinx"
"PocketSphinx is a small-footprint continuous speech recognition system"
"http://cmusphinx.sourceforge.net/" FALSE ""
"Required to build Pocket Sphinx backend")
macro_optional_find_package(OpenCV)
macro_log_feature(OpenCV_FOUND "OpenCV"
"OpenCV (Open Source Computer Vision) is a library of programming functions for real time computer vision" "http://http://opencv.willowgarage.com/"
FALSE "" "Required for Simon Vision")
macro_optional_find_package(VRPN)
macro_log_feature(VRPN_LIBRARY "VRPN"
"Virtual-Reality Peripheral Network Connector"
"http://www.cs.unc.edu/Research/vrpn/index.html" FALSE ""
"Required to build the VRPN command plugin")
set(BackendType "both" CACHE STRING "Backend type used while building")
set_property(CACHE BackendType PROPERTY STRINGS jhtk both)
if(OpenCV_FOUND)
link_directories(${OpenCV_LIB_DIR})
add_definitions(-DWITH_SIMONCV)
set(WITH_SIMONCV true CACHE BOOL "If SimonCV libraries are present")
endif()
if(SphinxBase_LIBRARIES AND POCKETSPHINX_LIBRARIES)
set(BackendType both)
else()
set(BackendType jhtk)
endif()
message(STATUS "BackendType='${BackendType}'")
if(${BackendType} STREQUAL both)
ADD_DEFINITIONS(-DBACKEND_TYPE_BOTH)
find_package(Sphinxbase REQUIRED)
find_package(Pocketsphinx REQUIRED)
include_directories(${POCKETSPHINX_INCLUDE_DIR}/pocketsphinx ${SphinxBase_INCLUDE_DIR} ${SphinxBase_INCLUDE_DIR}/sphinxbase ../../simonlib)
endif()
if(${BackendType} STREQUAL jhtk)
ADD_DEFINITIONS(-DBACKEND_TYPE_JHTK)
endif()
include(KDE4Defaults)
include(SimonDirs)
include_directories(${QT_INCLUDES} ${KDE4_INCLUDES} ${KDE_INCLUDES} ${KDEPIMLIBS_INCLUDE_DIRS}
${Qwt6_INCLUDE_DIR} simonlib)
add_definitions(${QT_DEFINITIONS} ${KDE4_DEFINITIONS})
if(WIN32)
# old gcc because of MinGW
add_definitions(-D__INTERLOCKED_DECLARED)
if(MSVC)
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
endif(MSVC)
endif(WIN32)
if(CMAKE_COMPILER_IS_GNUCXX)
add_definitions(-fexceptions)
endif(CMAKE_COMPILER_IS_GNUCXX)
add_subdirectory(simonlib)
add_subdirectory(simon)
add_subdirectory(simond)
add_subdirectory(ksimond)
add_subdirectory(plugins)
add_subdirectory(sam)
add_subdirectory(ssc)
add_subdirectory(sscd)
add_subdirectory(afaras)
add_subdirectory(doc)
if(USE_PLASMA)
add_subdirectory(simonoid)
endif()
install(FILES ${CMAKE_BINARY_DIR}/version.h
DESTINATION ${INCLUDE_INSTALL_DIR}/simon
COMPONENT simondevel
)
if(NOT WIN32)
include(simon_package_settings)
endif(NOT WIN32)
macro_display_feature_log()