Mesh: Add dependency on ELL & JSON-C
[platform/core/connectivity/bluetooth-frwk.git] / bt-oal / bluez_hal / CMakeLists.txt
1 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
2 PROJECT(bluetooth.default C)
3
4 SET(SRCS
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
12 ./src/bt-hal-utils.c
13 ./src/bt-hal-gap-agent.c
14 ./src/bt-hal-agent.c
15 ./src/bt-hal-hidhost.c
16 ./src/bt-hal-hiddevice.c
17 ./src/bt-hal-av.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
26 ./src/bt-hal-hf.c
27 ./src/bt-hal-hf-dbus-handler.c
28 ./src/bt-hal-hid-dbus-handler.c
29 ./src/bt-hal-socket.c
30 ./src/bt-hal-rfcomm-dbus-handler.c
31 ./src/bt-hal-hdp.c
32 ./src/bt-hal-hdp-dbus-handler.c
33 ./src/bt-hal-gatt.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
38 )
39
40 SET(PREFIX ${CMAKE_INSTALL_PREFIX})
41 SET(EXEC_PREFIX "\${prefix}")
42 SET(LIBDIR ${CMAKE_LIB_DIR})
43 SET(INCLUDEDIR "\${prefix}/include")
44 SET(VERSION_MAJOR 1)
45 SET(VERSION ${VERSION_MAJOR}.0.0)
46 SET(APP_SYSCONFDIR /opt/var/lib/bluetooth)
47
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/)
52
53 SET(PKG_MODULES
54         vconf
55         glib-2.0
56         gio-2.0
57         syspopup-caller
58         dbus-1
59         ell
60         dlog
61         gobject-2.0
62         bundle
63         gio-unix-2.0
64         capi-system-info
65 )
66
67 INCLUDE(FindPkgConfig)
68 pkg_check_modules(bluez_hal_pkgs REQUIRED ${PKG_MODULES})
69
70 FIND_PROGRAM(DBUS_BINDING_TOOL NAMES dbus-binding-tool)
71
72 FOREACH(flag ${bluez_hal_pkgs_CFLAGS})
73         SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
74 ENDFOREACH(flag)
75
76 SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -g ")
77
78 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fPIC -Wall -Werror")
79
80 FIND_PROGRAM(UNAME NAMES uname)
81
82 FIND_PROGRAM(DBUS_BINDING_TOOL NAMES dbus-binding-tool)
83
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")
89
90 ADD_DEFINITIONS("-DAPP_SYSCONFDIR=\"${APP_SYSCONFDIR}\"")
91
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")
96
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)