1 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
4 #Include Source files for bluetooth service common files only
6 ../include/bt-internal-types.c
7 ./services/bt-service-main.c
8 ./services/bt-service-common.c
9 ./services/bt-service-event-sender.c
10 ./services/bt-service-battery-monitor.c
11 ./services/bt-service-util.c
12 ./services/bt-request-handler.c
13 ./services/adapter/bt-service-core-adapter.c
14 ./services/adapter/bt-service-core-adapter-le.c
15 ./services/device/bt-service-core-device.c
16 ./services/device/bt-service-bonded-device.c
17 ./services/bt-service-event-receiver.c
18 ./services/bt-service-dpm.c
19 ./services/bt-service-agent-util.c
20 ./services/hid/bt-service-hidhost.c
21 ./services/hid/bt-service-hiddevice.c
22 ./services/socket/bt-service-socket.c
23 ./services/rfcomm/bt-service-rfcomm.c
24 ./services/audio/bt-service-audio.c
25 ./services/audio/bt-service-headset-connection.c
26 ./services/audio/hf/bt-service-hf.c
27 ./services/audio/a2dp_src/bt-service-a2dp-src.c
28 ./services/audio/a2dp_sink/bt-service-a2dp-sink.c
29 ./services/health/bt-service-hdp.c
30 ./services/audio/avrcp/bt-service-avrcp-tg.c
31 ./services/audio/avrcp/bt-service-avrcp-ctrl.c
32 ./services/gatt/bt-service-gatt.c
33 ./services/audio/hf/bt-service-hf-client.c
34 ./services/mesh/bt-service-mesh-util.c
35 ./services/mesh/bt-service-mesh-keys.c
36 ./services/mesh/bt-service-mesh-cdb.c
37 ./services/mesh/bt-service-mesh-nodes.c
38 ./services/mesh/bt-service-mesh-network.c
41 IF("$ENV{CFLAGS}" MATCHES "-DTIZEN_FEATURE_BT_OBEX")
42 LIST(APPEND SRCS ./services/obex/bt-service-obex-agent.c)
43 LIST(APPEND SRCS ./services/obex/bt-service-obex-server.c)
44 LIST(APPEND SRCS ./services/obex/bt-service-map-client.c)
45 LIST(APPEND SRCS ./services/obex/bt-service-opp-client.c)
46 LIST(APPEND SRCS ./services/obex/bt-service-pbap.c)
47 LIST(APPEND SRCS ./services/obex/bt-service-obex-event-receiver.c)
48 LIST(APPEND SRCS ./services/obex/bt-service-oob.c)
51 IF("$ENV{CFLAGS}" MATCHES "-DTIZEN_FEATURE_BT_PAN_NAP")
52 LIST(APPEND SRCS ./services/pan_nap/bt-service-pan-nap-event-receiver.c)
53 LIST(APPEND SRCS ./services/pan_nap/bt-service-network.c)
56 IF("$ENV{CFLAGS}" MATCHES "-DTIZEN_FEATURE_BT_IPSP")
57 LIST(APPEND SRCS ./services/ipsp/bt-service-ipsp.c)
58 LIST(APPEND SRCS ./services/ipsp/bt-service-ipsp-event-receiver.c)
61 IF("$ENV{CFLAGS}" MATCHES "-DTIZEN_FEATURE_BT_AVC_TARGET")
62 LIST(APPEND SRCS ./services/audio/bt-service-absolute-volume.c)
65 IF("${CMAKE_BUILD_TYPE}" STREQUAL "")
66 SET(CMAKE_BUILD_TYPE "Release")
67 ENDIF("${CMAKE_BUILD_TYPE}" STREQUAL "")
68 MESSAGE("Build type: ${CMAKE_BUILD_TYPE}")
70 INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)
71 INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/services/include)
72 IF("$ENV{CFLAGS}" MATCHES "-DTIZEN_FEATURE_BT_OBEX")
73 INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/services/obex/include)
75 IF("$ENV{CFLAGS}" MATCHES "-DTIZEN_FEATURE_BT_PAN_NAP")
76 INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/services/pan_nap/include)
78 IF("$ENV{CFLAGS}" MATCHES "-DTIZEN_FEATURE_BT_IPSP")
79 INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/services/ipsp/include)
82 INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../bt-oal/include)
83 LINK_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../bt-oal)
85 IF("$ENV{CFLAGS}" MATCHES "-DTIZEN_FEATURE_BT_FACTORY_MODE")
92 capi-network-connection
110 capi-network-connection
122 INCLUDE(FindPkgConfig)
123 pkg_check_modules(service_pkgs REQUIRED ${PKG_MODULES})
125 FOREACH(flag ${service_pkgs_CFLAGS})
126 SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag} -Wall")
129 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fPIC -Wall -Werror")
130 SET(CMAKE_C_FLAGS_DEBUG "-O0 -g")
131 SET(CMAKE_C_FLAGS_RELEASE "-O2")
132 SET(APP_SYSCONFDIR /opt/var/lib/bluetooth)
134 FIND_PROGRAM(UNAME NAMES uname)
135 EXEC_PROGRAM("${UNAME}" ARGS "-m" OUTPUT_VARIABLE "ARCH")
136 IF("${ARCH}" STREQUAL "arm")
137 ADD_DEFINITIONS("-DTARGET")
138 MESSAGE("add -DTARGET")
139 ENDIF("${ARCH}" STREQUAL "arm")
141 FIND_PROGRAM(DBUS_BINDING_TOOL NAMES dbus-binding-tool)
143 ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"")
144 ADD_DEFINITIONS("-DVENDOR=\"${APP_VENDOR}\"")
145 ADD_DEFINITIONS("-DAPPNAME=\"${APP_NAME}\"")
146 ADD_DEFINITIONS("-DAPP_DIR=\"${APP_DIR}\"")
147 ADD_DEFINITIONS("-DAPP_LOCALEDIR=\"${APP_LOCALEDIR}\"")
148 ADD_DEFINITIONS("-DAPP_SYSCONFDIR=\"${APP_SYSCONFDIR}\"")
149 ADD_DEFINITIONS("-DHPS_FEATURE")
150 ADD_DEFINITIONS("-DTIZEN_FEATURE_BT_DPM")
152 SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -pie")
154 ADD_EXECUTABLE(${PROJECT_NAME} ${SRCS})
155 TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${service_pkgs_LDFLAGS} bt-oal -ldl)
157 INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/org.projectx.bt.service DESTINATION share/dbus-1/system-services)
158 INSTALL(TARGETS ${PROJECT_NAME} DESTINATION bin)
160 INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/auto-pair-blacklist DESTINATION /opt/var/lib/bluetooth/)
162 # install booting script
163 CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/bluetooth-frwk-service.conf.in ${CMAKE_CURRENT_SOURCE_DIR}/bluetooth-frwk-service.conf)
165 INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/wearable/stack_info DESTINATION /usr/etc/bluetooth/)
166 INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/mobile/stack_info DESTINATION /usr/etc/bluetooth/)
168 INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/bluetooth-frwk-service.conf DESTINATION /etc/dbus-1/system.d)
170 TARGET_LINK_LIBRARIES(${PROJECT_NAME} -ldl)
172 SET(PREFIX ${CMAKE_INSTALL_PREFIX})