# # Copyright (c) 2011-2015 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. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an AS IS BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # # @file CMakeLists.txt # @author Dongyeol Lee (dy3.lee@samsung.com) # @version 0.1 # @brief # Check minimum CMake version CMAKE_MINIMUM_REQUIRED(VERSION 2.6) # Project name PROJECT(vc) SET(PREFIX ${CMAKE_INSTALL_PREFIX}) SET(EXEC_PREFIX "${PREFIX}") SET(VERSION 0.2.10) FIND_PROGRAM(UNAME NAMES uname) EXEC_PROGRAM("${UNAME}" ARGS "-m" OUTPUT_VARIABLE "ARCH") ADD_DEFINITIONS("-DVOICE_LIBDIR=\"${LIBDIR}\"") ADD_DEFINITIONS("-Werror") # for the use of ecore_wl2 ADD_DEFINITIONS("-DEFL_BETA_API_SUPPORT") FIND_PROGRAM(GDBUS_CODEGEN NAMES gdbus-codegen) EXEC_PROGRAM(${GDBUS_CODEGEN} ARGS "\\ --generate-c-code ${CMAKE_CURRENT_SOURCE_DIR}/common/vc_gdbus \\ --c-namespace GDBus\\ --interface-prefix org.tizen.voice. \\ ${CMAKE_CURRENT_SOURCE_DIR}/org.tizen.voice.voice-control.gdbus.xml \\ ") # pkg config tool INCLUDE(FindPkgConfig) ## Include common directory ## INCLUDE_DIRECTORIES("${CMAKE_SOURCE_DIR}/common") INCLUDE_DIRECTORIES("${CMAKE_SOURCE_DIR}/include") ## Dependent packages ## INCLUDE(FindPkgConfig) IF("${_TV_PRODUCT}" STREQUAL "TRUE") pkg_check_modules(pkgs REQUIRED aul buxton2 capi-appfw-app-control capi-appfw-app-manager capi-base-common capi-media-audio-io capi-media-sound-manager ecore-wl2 gio-2.0 gio-unix-2.0 capi-network-bluetooth capi-network-bluetooth-tv capi-system-info cynara-client cynara-session dbus-1 db-util dlog ecore glib-2.0 json-glib-1.0 libgum libtzplatform-config libxml-2.0 sqlite3 vconf msfapi farfield-voice-api ) ELSE() pkg_check_modules(pkgs REQUIRED aul buxton2 capi-appfw-app-control capi-appfw-app-manager capi-base-common capi-media-audio-io capi-media-sound-manager ecore-wl2 gio-2.0 gio-unix-2.0 capi-system-info cynara-client cynara-session dbus-1 db-util dlog ecore glib-2.0 json-glib-1.0 libgum libtzplatform-config libxml-2.0 sqlite3 vconf ) ENDIF() ## API ## ADD_SUBDIRECTORY(include) ## Client library ## ADD_SUBDIRECTORY(client) ## Server daemon ## ADD_SUBDIRECTORY(server) ## Engine Parser ## ADD_SUBDIRECTORY(engine-parser) INSTALL(FILES ${CMAKE_SOURCE_DIR}/voice-control.info DESTINATION ${TZ_SYS_RO_SHARE}/parser-plugins) ## config ## INSTALL(FILES ${CMAKE_SOURCE_DIR}/vc-config.xml DESTINATION ${TZ_SYS_RO_SHARE}/voice/vc/1.0) INSTALL(FILES ${CMAKE_SOURCE_DIR}/org.tizen.voice.vcdaemon.service DESTINATION ${TZ_SYS_RO_SHARE}/dbus-1/services) INSTALL(FILES ${CMAKE_SOURCE_DIR}/vc-service.conf DESTINATION /etc/dbus-1/session.d) ## vc_getengine ## IF("${ARCH}" MATCHES "^arm.*") INSTALL(PROGRAMS ${CMAKE_SOURCE_DIR}/bin/armv7l/vc_getengine DESTINATION ${TZ_SYS_BIN}) ELSEIF("${ARCH}" MATCHES "^i586.*") INSTALL(PROGRAMS ${CMAKE_SOURCE_DIR}/bin/i586/vc_getengine DESTINATION ${TZ_SYS_BIN}) ELSEIF("${ARCH}" MATCHES "^i686.*") INSTALL(PROGRAMS ${CMAKE_SOURCE_DIR}/bin/i586/vc_getengine DESTINATION ${TZ_SYS_BIN}) ELSEIF("${ARCH}" MATCHES "^aarch64.*") INSTALL(PROGRAMS ${CMAKE_SOURCE_DIR}/bin/aarch64/vc_getengine DESTINATION ${TZ_SYS_BIN}) ELSEIF("${ARCH}" MATCHES "^x86_64.*") INSTALL(PROGRAMS ${CMAKE_SOURCE_DIR}/bin/x86_64/vc_getengine DESTINATION ${TZ_SYS_BIN}) ENDIF()