1 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
7 bt-service-event-sender.c
8 bt-service-headset-connection.c
9 bt-service-event-receiver.c
13 bt-service-adapter-le.c
19 bt-service-obex-agent.c
20 bt-service-opp-client.c
21 bt-service-obex-server.c
22 bt-service-rfcomm-client.c
23 bt-service-rfcomm-server.c
25 bt-service-avrcp-controller.c
28 bt-service-gap-agent.c
37 ENDIF(LIBNOTIFY_SUPPORT)
39 IF(LIBNOTIFICATION_SUPPORT)
41 bt-service-agent-notification.c
43 ENDIF(LIBNOTIFICATION_SUPPORT)
45 IF("${CMAKE_BUILD_TYPE}" STREQUAL "")
46 SET(CMAKE_BUILD_TYPE "Release")
47 ENDIF("${CMAKE_BUILD_TYPE}" STREQUAL "")
48 MESSAGE("Build type: ${CMAKE_BUILD_TYPE}")
50 INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)
51 INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include)
62 capi-content-mime-type
63 capi-network-connection
71 IF("$ENV{CFLAGS}" MATCHES "-DTIZEN_NETWORK_TETHERING_ENABLE")
72 SET(PKG_MODULES ${PKG_MODULES}
73 capi-network-tethering
77 INCLUDE(FindPkgConfig)
78 pkg_check_modules(service_pkgs REQUIRED ${PKG_MODULES})
80 FOREACH(flag ${service_pkgs_CFLAGS})
81 SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag} -Wall")
84 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fPIC -Wall")
85 SET(CMAKE_C_FLAGS_DEBUG "-O0 -g")
86 SET(CMAKE_C_FLAGS_RELEASE "-O2")
87 SET(APP_SYSCONFDIR /opt/var/lib/bluetooth)
89 FIND_PROGRAM(UNAME NAMES uname)
90 EXEC_PROGRAM("${UNAME}" ARGS "-m" OUTPUT_VARIABLE "ARCH")
91 IF("${ARCH}" STREQUAL "arm")
92 ADD_DEFINITIONS("-DTARGET")
93 MESSAGE("add -DTARGET")
94 ENDIF("${ARCH}" STREQUAL "arm")
96 FIND_PROGRAM(MARSHALTOOL NAMES glib-genmarshal)
97 EXEC_PROGRAM("${MARSHALTOOL}" ARGS "--prefix=marshal ${CMAKE_CURRENT_SOURCE_DIR}/marshal.list --header > ${CMAKE_CURRENT_SOURCE_DIR}/include/marshal.h")
98 EXEC_PROGRAM("${MARSHALTOOL}" ARGS "--prefix=marshal ${CMAKE_CURRENT_SOURCE_DIR}/marshal.list --body > ${CMAKE_CURRENT_SOURCE_DIR}/marshal.c")
100 FIND_PROGRAM(DBUS_BINDING_TOOL NAMES dbus-binding-tool)
101 #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")
102 #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")
104 #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")
106 #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")
108 ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"")
109 ADD_DEFINITIONS("-DVENDOR=\"${APP_VENDOR}\"")
110 ADD_DEFINITIONS("-DAPPNAME=\"${APP_NAME}\"")
111 ADD_DEFINITIONS("-DAPP_DIR=\"${APP_DIR}\"")
112 ADD_DEFINITIONS("-DAPP_LOCALEDIR=\"${APP_LOCALEDIR}\"")
113 ADD_DEFINITIONS("-DAPP_SYSCONFDIR=\"${APP_SYSCONFDIR}\"")
114 ADD_DEFINITIONS("-DHPS_FEATURE")
115 ADD_DEFINITIONS("-DTIZEN_DPM_ENABLE")
117 IF(LIBNOTIFY_SUPPORT OR LIBNOTIFICATION_SUPPORT)
118 ADD_DEFINITIONS("-DDATA_DIR_ICON=\"${SHARE_INSTALL_PREFIX}\"")
119 MESSAGE("Icon used for notification is : ${SHARE_INSTALL_PREFIX}/icons/default/bt-icon.png")
120 ENDIF(LIBNOTIFY_SUPPORT OR LIBNOTIFICATION_SUPPORT)
122 SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -pie")
124 ADD_EXECUTABLE(${PROJECT_NAME} ${SRCS})
125 TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${service_pkgs_LDFLAGS})
127 # to permit usage of bluetooth_cancel_bonding in bt-popup.c. This build bluetooth-api first.
128 IF(LIBNOTIFY_SUPPORT)
129 ADD_DEPENDENCIES(${PROJECT_NAME} bluetooth-api)
130 TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${service_pkgs_LDFLAGS} bluetooth-api)
131 ELSE(LIBNOTIFY_SUPPORT)
132 TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${service_pkgs_LDFLAGS})
133 ENDIF(LIBNOTIFY_SUPPORT)
135 #CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/org.projectx.bt.service.in ${CMAKE_CURRENT_SOURCE_DIR}/org.projectx.bt.service)
136 INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/org.projectx.bt.service DESTINATION share/dbus-1/services)
137 INSTALL(TARGETS ${PROJECT_NAME} DESTINATION bin)
139 INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/auto-pair-blacklist DESTINATION /opt/var/lib/bluetooth/)
141 # install booting script
142 CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/bluetooth-frwk-service.conf.in ${CMAKE_CURRENT_SOURCE_DIR}/bluetooth-frwk-service.conf)
145 INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/wearable/stack_info DESTINATION /usr/etc/bluetooth/)
147 INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/mobile/stack_info DESTINATION /usr/etc/bluetooth/)
148 ENDIF (TIZEN_WEARABLE)
150 INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/bluetooth-frwk-service.conf DESTINATION /etc/dbus-1/session.d)
152 SET(PREFIX ${CMAKE_INSTALL_PREFIX})