Merge "Fix defect detected by static analysis tool" into tizen
[platform/core/uifw/stt.git] / CMakeLists.txt
1 # Copyright (c) 2011-2016 Samsung Electronics Co., Ltd All Rights Reserved
2 #
3 #    Licensed under the Apache License, Version 2.0 (the "License");
4 #    you may not use this file except in compliance with the License.
5 #    You may obtain a copy of the License at
6 #
7 #        http://www.apache.org/licenses/LICENSE-2.0
8 #
9 #    Unless required by applicable law or agreed to in writing, software
10 #    distributed under the License is distributed on an "AS IS" BASIS,
11 #    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 #    See the License for the specific language governing permissions and
13 #    limitations under the License.
14 #
15 #
16 # @file        CMakeLists.txt
17 # @author      Dongyeol Lee (dy3.lee@samsung.com)
18 # @version     0.1
19 # @brief
20
21 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
22 PROJECT(stt)
23
24 SET(PREFIX ${CMAKE_INSTALL_PREFIX})
25 SET(EXEC_PREFIX "${PREFIX}")
26 SET(VERSION ${VERSION})
27
28 FIND_PROGRAM(UNAME NAMES uname)
29 EXEC_PROGRAM("${UNAME}" ARGS "-m" OUTPUT_VARIABLE "ARCH")
30
31 ADD_DEFINITIONS("-DSTT_LIBDIR=\"${LIBDIR}\"")
32 ADD_DEFINITIONS("-Werror")
33
34 ## Include common directory ##
35 INCLUDE_DIRECTORIES("${CMAKE_SOURCE_DIR}/common")
36 INCLUDE_DIRECTORIES("${CMAKE_SOURCE_DIR}/include")
37
38 ## Dependent packages ##
39 INCLUDE(FindPkgConfig)
40 IF("${_TV_PRODUCT}" STREQUAL "TRUE")
41 pkg_check_modules(pkgs REQUIRED
42         aul capi-media-audio-io capi-media-wav-player capi-network-bluetooth capi-network-bluetooth-tv capi-system-info cynara-client cynara-session
43         dbus-1 dlog ecore glib-2.0 libgum libtzplatform-config libxml-2.0 vconf vconf-internal-keys buxton2 gmock farfield-voice-api
44 )
45 ELSE()
46 pkg_check_modules(pkgs REQUIRED
47         aul capi-media-audio-io capi-media-wav-player capi-system-info cynara-client cynara-session
48         dbus-1 dlog ecore glib-2.0 libgum libtzplatform-config libxml-2.0 vconf vconf-internal-keys buxton2 gmock
49 )
50 ENDIF()
51
52 pkg_check_modules(pkgs_test REQUIRED
53     dlog ecore
54 )
55
56 ## API ##
57 ADD_SUBDIRECTORY(include)
58
59 ## Client library ##
60 ADD_SUBDIRECTORY(client)
61
62 ## Server daemon ##
63 ADD_SUBDIRECTORY(server)
64
65 ## Test ##
66 #ADD_SUBDIRECTORY(test)
67
68 ## Engine Parser ##
69 ADD_SUBDIRECTORY(engine-parser)
70
71 ## Test
72 ENABLE_TESTING()
73 SET(UNITTEST_STT stt-unittests)
74 ADD_TEST(NAME ${UNITTEST_STT} COMMAND ${UNITTEST_STT}
75                         WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/tests)
76
77 ADD_SUBDIRECTORY(tests)
78
79 ## config ##
80 INSTALL(FILES ${CMAKE_SOURCE_DIR}/stt-config.xml DESTINATION ${TZ_SYS_RO_SHARE}/voice/stt/1.0)
81
82 ## Dbus service ##
83 INSTALL(FILES ${CMAKE_SOURCE_DIR}/org.tizen.voice.sttserver.service DESTINATION ${TZ_SYS_RO_SHARE}/dbus-1/services)
84 INSTALL(FILES ${CMAKE_SOURCE_DIR}/org.tizen.voice.sttservercustom.service DESTINATION ${TZ_SYS_RO_SHARE}/dbus-1/services)
85
86 INSTALL(FILES ${CMAKE_SOURCE_DIR}/stt-server.conf DESTINATION /etc/dbus-1/session.d)
87
88 ## voice_getengine ##
89 IF("${ARCH}" MATCHES "^arm.*")
90 INSTALL(PROGRAMS ${CMAKE_SOURCE_DIR}/bin/armv7l/voice_getengine DESTINATION ${TZ_SYS_BIN})
91 ELSEIF("${ARCH}" MATCHES "^i586.*")
92 INSTALL(PROGRAMS ${CMAKE_SOURCE_DIR}/bin/i586/voice_getengine DESTINATION ${TZ_SYS_BIN})
93 ELSEIF("${ARCH}" MATCHES "^i686.*")
94 INSTALL(PROGRAMS ${CMAKE_SOURCE_DIR}/bin/i586/voice_getengine DESTINATION ${TZ_SYS_BIN})
95 ELSEIF("${ARCH}" MATCHES "^aarch64.*")
96 INSTALL(PROGRAMS ${CMAKE_SOURCE_DIR}/bin/aarch64/voice_getengine DESTINATION ${TZ_SYS_BIN})
97 ELSEIF("${ARCH}" MATCHES "^x86_64.*")
98 INSTALL(PROGRAMS ${CMAKE_SOURCE_DIR}/bin/x86_64/voice_getengine DESTINATION ${TZ_SYS_BIN})
99 ENDIF()
100
101