1 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
2 PROJECT(bluetooth.default C)
5 ../../include/bt-internal-types.c
6 ./src/bt-hal-bluetooth.c
7 ./src/bt-hal-adapter-dbus-handler.c
8 ./src/bt-hal-adapter-le.c
9 ./src/bt-hal-device-dbus-handler.c
10 ./src/bt-hal-dbus-common-utils.c
11 ./src/bt-hal-event-receiver.c
13 ./src/bt-hal-gap-agent.c
15 ./src/bt-hal-hidhost.c
16 ./src/bt-hal-hiddevice.c
18 ./src/bt-hal-av-dbus-handler.c
19 ./src/bt-hal-a2dp-sink.c
20 ./src/bt-hal-a2dp-sink-dbus-handler.c
21 ./src/bt-hal-avrcp-tg.c
22 ./src/bt-hal-avrcp-tg-dbus-handler.c
23 ./src/bt-hal-avrcp-ctrl.c
24 ./src/bt-hal-avrcp-ctrl-dbus-handler.c
25 ./src/bt-hal-avrcp-transport-dbus-handler.c
27 ./src/bt-hal-hf-dbus-handler.c
28 ./src/bt-hal-hid-dbus-handler.c
30 ./src/bt-hal-rfcomm-dbus-handler.c
32 ./src/bt-hal-hdp-dbus-handler.c
34 ./src/bt-hal-gatt-server.c
35 ./src/bt-hal-gatt-client.c
36 ./src/bt-hal-hf-client.c
37 ./src/bt-hal-hf-client-dbus-handler.c
40 SET(PREFIX ${CMAKE_INSTALL_PREFIX})
41 SET(EXEC_PREFIX "\${prefix}")
42 SET(LIBDIR ${CMAKE_LIB_DIR})
43 SET(INCLUDEDIR "\${prefix}/include")
45 SET(VERSION ${VERSION_MAJOR}.0.0)
46 SET(APP_SYSCONFDIR /opt/var/lib/bluetooth)
48 INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/bt-oal/)
49 INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/)
50 INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/src/)
51 INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/inc/)
67 INCLUDE(FindPkgConfig)
68 pkg_check_modules(bluez_hal_pkgs REQUIRED ${PKG_MODULES})
70 FIND_PROGRAM(DBUS_BINDING_TOOL NAMES dbus-binding-tool)
72 FOREACH(flag ${bluez_hal_pkgs_CFLAGS})
73 SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
76 SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -g ")
78 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fPIC -Wall -Werror")
80 FIND_PROGRAM(UNAME NAMES uname)
82 FIND_PROGRAM(DBUS_BINDING_TOOL NAMES dbus-binding-tool)
84 EXEC_PROGRAM("${UNAME}" ARGS "-m" OUTPUT_VARIABLE "ARCH")
85 IF("${ARCH}" STREQUAL "arm")
86 ADD_DEFINITIONS("-DTARGET")
87 MESSAGE("add -DTARGET")
88 ENDIF("${ARCH}" STREQUAL "arm")
90 ADD_DEFINITIONS("-DAPP_SYSCONFDIR=\"${APP_SYSCONFDIR}\"")
92 ADD_LIBRARY(${PROJECT_NAME} SHARED ${SRCS})
93 SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES SOVERSION ${VERSION_MAJOR})
94 SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES VERSION ${VERSION})
95 TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${bluez_hal_pkgs_LDFLAGS} "-ldl")
97 INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${LIBDIR} COMPONENT RuntimeLibraries)
98 INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/bluetooth-frwk-gap-agent.conf DESTINATION /etc/dbus-1/system.d)