CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
PROJECT(bt-service C)
+#Include Source files for bluetooth service common files only
SET(SRCS
-marshal.c
-bt-service-main.c
-bt-service-event-sender.c
-bt-service-headset-connection.c
-bt-service-event-receiver.c
-bt-service-common.c
-bt-service-util.c
-bt-service-adapter.c
-bt-service-adapter-le.c
-bt-service-device.c
-bt-service-hid.c
-bt-service-network.c
-bt-service-audio.c
-bt-service-oob.c
-bt-service-obex-agent.c
-bt-service-opp-client.c
-bt-service-obex-server.c
-bt-service-rfcomm-client.c
-bt-service-rfcomm-server.c
-bt-service-avrcp.c
-bt-request-handler.c
-bt-service-agent.c
-bt-service-gap-agent.c
-bt-service-pbap.c
+../include/bt-internal-types.c
+./services/bt-service-main.c
+./services/bt-service-common.c
+./services/bt-service-event-sender.c
+./services/bt-service-battery-monitor.c
+./services/bt-service-util.c
+./services/bt-request-handler.c
+./services/adapter/bt-service-core-adapter.c
+./services/adapter/bt-service-core-adapter-le.c
+./services/device/bt-service-core-device.c
+./services/device/bt-service-bonded-device.c
+./services/bt-service-event-receiver.c
+./services/bt-service-dpm.c
+./services/bt-service-agent-util.c
+./services/hid/bt-service-hidhost.c
+./services/hid/bt-service-hiddevice.c
+./services/socket/bt-service-socket.c
+./services/rfcomm/bt-service-rfcomm.c
+./services/audio/bt-service-audio.c
+./services/audio/bt-service-headset-connection.c
+./services/audio/hf/bt-service-hf.c
+./services/audio/a2dp_src/bt-service-a2dp-src.c
+./services/audio/a2dp_sink/bt-service-a2dp-sink.c
+./services/health/bt-service-hdp.c
+./services/audio/avrcp/bt-service-avrcp-tg.c
+./services/audio/avrcp/bt-service-avrcp-ctrl.c
+./services/gatt/bt-service-gatt.c
+./services/audio/hf/bt-service-hf-client.c
+./services/mesh/bt-service-mesh-util.c
+./services/mesh/bt-service-mesh-keys.c
+./services/mesh/bt-service-mesh-cdb.c
+./services/mesh/bt-service-mesh-nodes.c
+./services/mesh/bt-service-mesh-network.c
+./services/mesh/bt-service-mesh-main.c
+./services/mesh/bt-service-mesh-config-client.c
+./services/mesh/bt-service-mesh-model.c
)
-IF(LIBNOTIFY_SUPPORT)
-LIST(APPEND SRCS
-bt-popup.c
-)
-ENDIF(LIBNOTIFY_SUPPORT)
+IF("$ENV{CFLAGS}" MATCHES "-DTIZEN_FEATURE_BT_OBEX")
+LIST(APPEND SRCS ./services/obex/bt-service-obex-agent.c)
+LIST(APPEND SRCS ./services/obex/bt-service-obex-server.c)
+LIST(APPEND SRCS ./services/obex/bt-service-map-client.c)
+LIST(APPEND SRCS ./services/obex/bt-service-opp-client.c)
+LIST(APPEND SRCS ./services/obex/bt-service-pbap.c)
+LIST(APPEND SRCS ./services/obex/bt-service-obex-event-receiver.c)
+LIST(APPEND SRCS ./services/obex/bt-service-oob.c)
+ENDIF()
-IF(LIBNOTIFICATION_SUPPORT)
-LIST(APPEND SRCS
-bt-service-agent-notification.c
-)
-ENDIF(LIBNOTIFICATION_SUPPORT)
+IF("$ENV{CFLAGS}" MATCHES "-DTIZEN_FEATURE_BT_PAN_NAP")
+LIST(APPEND SRCS ./services/pan_nap/bt-service-pan-nap-event-receiver.c)
+LIST(APPEND SRCS ./services/pan_nap/bt-service-network.c)
+ENDIF()
+
+IF("$ENV{CFLAGS}" MATCHES "-DTIZEN_FEATURE_BT_IPSP")
+LIST(APPEND SRCS ./services/ipsp/bt-service-ipsp.c)
+LIST(APPEND SRCS ./services/ipsp/bt-service-ipsp-event-receiver.c)
+ENDIF()
+
+IF("$ENV{CFLAGS}" MATCHES "-DTIZEN_FEATURE_BT_AVC_TARGET")
+LIST(APPEND SRCS ./services/audio/bt-service-absolute-volume.c)
+ENDIF()
IF("${CMAKE_BUILD_TYPE}" STREQUAL "")
- SET(CMAKE_BUILD_TYPE "Release")
+ SET(CMAKE_BUILD_TYPE "Release")
ENDIF("${CMAKE_BUILD_TYPE}" STREQUAL "")
MESSAGE("Build type: ${CMAKE_BUILD_TYPE}")
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)
-INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include)
+INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/services/include)
+IF("$ENV{CFLAGS}" MATCHES "-DTIZEN_FEATURE_BT_OBEX")
+INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/services/obex/include)
+ENDIF()
+IF("$ENV{CFLAGS}" MATCHES "-DTIZEN_FEATURE_BT_PAN_NAP")
+INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/services/pan_nap/include)
+ENDIF()
+IF("$ENV{CFLAGS}" MATCHES "-DTIZEN_FEATURE_BT_IPSP")
+INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/services/ipsp/include)
+ENDIF()
+
+INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../bt-oal/include)
+LINK_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../bt-oal)
+IF("$ENV{CFLAGS}" MATCHES "-DTIZEN_FEATURE_BT_FACTORY_MODE")
SET(PKG_MODULES
- vconf
- aul
- vconf
- syspopup-caller
- dbus-glib-1
- status
- alarm-service
- notification
-# libnotify
-# gdk-pixbuf-2.0
-# gtk+-3.0
- capi-content-mime-type
- capi-network-connection
- pkgmgr
-# journal
- libprivilege-control
- cynara-client
- cynara-creds-dbus
+ vconf
+ dbus-1
+ gio-2.0
+ gio-unix-2.0
+ alarm-service
+ capi-network-connection
+ cynara-client
+ cynara-creds-gdbus
+ aul
+ json-c
+ ell
+ eventsystem
+ storage
+ capi-system-info
+ libsystemd-daemon
+ bincfg
+ libactd
)
-
-IF("$ENV{CFLAGS}" MATCHES "-DTIZEN_NETWORK_TETHERING_ENABLE")
-SET(PKG_MODULES ${PKG_MODULES}
- capi-network-tethering
+ELSE()
+SET(PKG_MODULES
+ vconf
+ dbus-1
+ gio-2.0
+ gio-unix-2.0
+ alarm-service
+ capi-network-connection
+ cynara-client
+ cynara-creds-gdbus
+ aul
+ json-c
+ ell
+ eventsystem
+ storage
+ capi-system-info
+ libsystemd-daemon
+ libactd
)
ENDIF()
pkg_check_modules(service_pkgs REQUIRED ${PKG_MODULES})
FOREACH(flag ${service_pkgs_CFLAGS})
- SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag} -Wall")
+ SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag} -Wall")
ENDFOREACH(flag)
-SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fPIC")
+SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fPIC -Wall -Werror")
SET(CMAKE_C_FLAGS_DEBUG "-O0 -g")
SET(CMAKE_C_FLAGS_RELEASE "-O2")
SET(APP_SYSCONFDIR /opt/var/lib/bluetooth)
FIND_PROGRAM(UNAME NAMES uname)
EXEC_PROGRAM("${UNAME}" ARGS "-m" OUTPUT_VARIABLE "ARCH")
IF("${ARCH}" STREQUAL "arm")
- ADD_DEFINITIONS("-DTARGET")
- MESSAGE("add -DTARGET")
+ ADD_DEFINITIONS("-DTARGET")
+ MESSAGE("add -DTARGET")
ENDIF("${ARCH}" STREQUAL "arm")
-FIND_PROGRAM(MARSHALTOOL NAMES glib-genmarshal)
-EXEC_PROGRAM("${MARSHALTOOL}" ARGS "--prefix=marshal ${CMAKE_CURRENT_SOURCE_DIR}/marshal.list --header > ${CMAKE_CURRENT_SOURCE_DIR}/include/marshal.h")
-EXEC_PROGRAM("${MARSHALTOOL}" ARGS "--prefix=marshal ${CMAKE_CURRENT_SOURCE_DIR}/marshal.list --body > ${CMAKE_CURRENT_SOURCE_DIR}/marshal.c")
-
FIND_PROGRAM(DBUS_BINDING_TOOL NAMES dbus-binding-tool)
-EXEC_PROGRAM("${DBUS_BINDING_TOOL}" ARGS "--prefix=bt ${CMAKE_CURRENT_SOURCE_DIR}/bt-request-service.xml --mode=glib-server --output=${CMAKE_CURRENT_SOURCE_DIR}/include/bt-service-method.h")
-EXEC_PROGRAM("${DBUS_BINDING_TOOL}" ARGS "--prefix=bt_obex_agent ${CMAKE_CURRENT_SOURCE_DIR}/bt-service-obex-agent.xml --mode=glib-server --output=${CMAKE_CURRENT_SOURCE_DIR}/include/bt-obex-agent-method.h")
-
-EXEC_PROGRAM("${DBUS_BINDING_TOOL}" ARGS "--prefix=gap_agent ${CMAKE_CURRENT_SOURCE_DIR}/bt-service-gap-agent1.xml --mode=glib-server --output=${CMAKE_CURRENT_SOURCE_DIR}/include/bt-gap-agent-method.h")
-
-EXEC_PROGRAM("${DBUS_BINDING_TOOL}" ARGS "--prefix=bt_media_agent ${CMAKE_CURRENT_SOURCE_DIR}/bt-service-media-agent.xml --mode=glib-server --output=${CMAKE_CURRENT_SOURCE_DIR}/include/bt-media-agent-method.h")
ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"")
ADD_DEFINITIONS("-DVENDOR=\"${APP_VENDOR}\"")
ADD_DEFINITIONS("-DAPP_DIR=\"${APP_DIR}\"")
ADD_DEFINITIONS("-DAPP_LOCALEDIR=\"${APP_LOCALEDIR}\"")
ADD_DEFINITIONS("-DAPP_SYSCONFDIR=\"${APP_SYSCONFDIR}\"")
-
-IF(LIBNOTIFY_SUPPORT OR LIBNOTIFICATION_SUPPORT)
- ADD_DEFINITIONS("-DDATA_DIR_ICON=\"${SHARE_INSTALL_PREFIX}\"")
- MESSAGE("Icon used for notification is : ${SHARE_INSTALL_PREFIX}/icons/default/bt-icon.png")
-ENDIF(LIBNOTIFY_SUPPORT OR LIBNOTIFICATION_SUPPORT)
+ADD_DEFINITIONS("-DHPS_FEATURE")
+ADD_DEFINITIONS("-DTIZEN_FEATURE_BT_DPM")
SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -pie")
ADD_EXECUTABLE(${PROJECT_NAME} ${SRCS})
+TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${service_pkgs_LDFLAGS} bt-oal -ldl)
-# to permit usage of bluetooth_cancel_bonding in bt-popup.c. This build bluetooth-api first.
-IF(LIBNOTIFY_SUPPORT)
- ADD_DEPENDENCIES(${PROJECT_NAME} bluetooth-api)
- TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${service_pkgs_LDFLAGS} bluetooth-api)
-ELSE(LIBNOTIFY_SUPPORT)
- TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${service_pkgs_LDFLAGS})
-ENDIF(LIBNOTIFY_SUPPORT)
-
-CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/org.projectx.bt.service.in ${CMAKE_CURRENT_SOURCE_DIR}/org.projectx.bt.service)
INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/org.projectx.bt.service DESTINATION share/dbus-1/system-services)
INSTALL(TARGETS ${PROJECT_NAME} DESTINATION bin)
# install booting script
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/bluetooth-frwk-service.conf.in ${CMAKE_CURRENT_SOURCE_DIR}/bluetooth-frwk-service.conf)
-IF (TIZEN_WEARABLE)
- INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/wearable/stack_info DESTINATION /usr/etc/bluetooth/)
-ELSE ()
- INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/mobile/stack_info DESTINATION /usr/etc/bluetooth/)
-ENDIF (TIZEN_WEARABLE)
+INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/wearable/stack_info DESTINATION /usr/etc/bluetooth/)
+INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/mobile/stack_info DESTINATION /usr/etc/bluetooth/)
INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/bluetooth-frwk-service.conf DESTINATION /etc/dbus-1/system.d)
+TARGET_LINK_LIBRARIES(${PROJECT_NAME} -ldl)
SET(PREFIX ${CMAKE_INSTALL_PREFIX})