-# Copyright (c) 2011-2014 Samsung Electronics Co., Ltd All Rights Reserved
+# Copyright (c) 2011-2016 Samsung Electronics Co., Ltd All Rights Reserved
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
SET(PREFIX ${CMAKE_INSTALL_PREFIX})
SET(EXEC_PREFIX "${PREFIX}")
SET(INCLUDEDIR "${PREFIX}/include")
-SET(VERSION 0.2.44)
+SET(VERSION ${VERSION})
+
+FIND_PROGRAM(UNAME NAMES uname)
+EXEC_PROGRAM("${UNAME}" ARGS "-m" OUTPUT_VARIABLE "ARCH")
ADD_DEFINITIONS("-DTTS_LIBDIR=\"${LIBDIR}\"")
ADD_DEFINITIONS("-Werror")
## Dependent packages ##
INCLUDE(FindPkgConfig)
-pkg_check_modules(pkgs REQUIRED
- aul capi-media-audio-io capi-system-info dbus-1 dlog ecore
- glib-2.0 libtzplatform-config libxml-2.0 vconf
+pkg_check_modules(pkgs REQUIRED
+ aul capi-media-audio-io capi-appfw-app-manager capi-system-info dbus-1 dlog ecore
+ glib-2.0 libgum libtzplatform-config libxml-2.0 vconf bundle buxton2 pkgmgr gmock capi-appfw-app-common rpc-port
)
pkg_check_modules(pkgs_test REQUIRED
## Server daemon ##
ADD_SUBDIRECTORY(server)
-INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/LICENSE RENAME tts DESTINATION ${TZ_SYS_RO_SHARE}/license)
+## Engine Parser ##
+ADD_SUBDIRECTORY(engine-parser)
## Config ##
INSTALL(FILES ${CMAKE_SOURCE_DIR}/tts-config.xml DESTINATION ${TZ_SYS_RO_SHARE}/voice/tts/1.0)
INSTALL(FILES ${CMAKE_SOURCE_DIR}/tts-server.conf DESTINATION /etc/dbus-1/system.d)
## Dbus service ##
-INSTALL(FILES ${CMAKE_SOURCE_DIR}/org.tizen.voice.ttsserver.service DESTINATION ${TZ_SYS_RO_SHARE}/dbus-1/services)
-INSTALL(FILES ${CMAKE_SOURCE_DIR}/org.tizen.voice.ttsnotiserver.service DESTINATION ${TZ_SYS_RO_SHARE}/dbus-1/services)
-INSTALL(FILES ${CMAKE_SOURCE_DIR}/org.tizen.voice.ttssrserver.service DESTINATION ${TZ_SYS_RO_SHARE}/dbus-1/services)
+INSTALL(FILES ${CMAKE_SOURCE_DIR}/org.tizen.voice.ttsserver.service DESTINATION ${TZ_SYS_RO_SHARE}/dbus-1/system-services)
+INSTALL(FILES ${CMAKE_SOURCE_DIR}/org.tizen.voice.ttssrserver.service DESTINATION ${TZ_SYS_RO_SHARE}/dbus-1/system-services)
+INSTALL(FILES ${CMAKE_SOURCE_DIR}/org.tizen.voice.ttsnotiserver.service DESTINATION ${TZ_SYS_RO_SHARE}/dbus-1/system-services)
+INSTALL(FILES ${CMAKE_SOURCE_DIR}/org.tizen.voice.ttsinterruptserver.service DESTINATION ${TZ_SYS_RO_SHARE}/dbus-1/system-services)
+
+
+## tts_getengine ##
+IF("${ARCH}" MATCHES "^arm.*")
+INSTALL(PROGRAMS ${CMAKE_SOURCE_DIR}/bin/armv7l/tts_getengine DESTINATION ${TZ_SYS_BIN})
+ELSEIF("${ARCH}" MATCHES "^i586.*")
+INSTALL(PROGRAMS ${CMAKE_SOURCE_DIR}/bin/i586/tts_getengine DESTINATION ${TZ_SYS_BIN})
+ELSEIF("${ARCH}" MATCHES "^i686.*")
+INSTALL(PROGRAMS ${CMAKE_SOURCE_DIR}/bin/i586/tts_getengine DESTINATION ${TZ_SYS_BIN})
+ELSEIF("${ARCH}" MATCHES "^aarch64.*")
+INSTALL(PROGRAMS ${CMAKE_SOURCE_DIR}/bin/aarch64/tts_getengine DESTINATION ${TZ_SYS_BIN})
+ELSEIF("${ARCH}" MATCHES "^x86_64.*")
+INSTALL(PROGRAMS ${CMAKE_SOURCE_DIR}/bin/x86_64/tts_getengine DESTINATION ${TZ_SYS_BIN})
+ELSEIF("${ARCH}" MATCHES "^riscv64.*")
+INSTALL(PROGRAMS ${CMAKE_SOURCE_DIR}/bin/riscv64/tts_getengine DESTINATION ${TZ_SYS_BIN})
+ENDIF()
+
## Sample application ##
ADD_SUBDIRECTORY(test)
+
+## Test
+IF(NOT DEFINED MINIMUM_BUILD)
+ENABLE_TESTING()
+SET(UNITTEST_TTS tts-unittests)
+ADD_TEST(NAME ${UNITTEST_TTS} COMMAND ${UNITTEST_TTS}
+ WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/tests)
+
+ADD_SUBDIRECTORY(tests)
+ENDIF(NOT DEFINED MINIMUM_BUILD)