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
27 bt-service-gap-agent.c
35 ENDIF(LIBNOTIFY_SUPPORT)
37 IF(LIBNOTIFICATION_SUPPORT)
39 bt-service-agent-notification.c
41 ENDIF(LIBNOTIFICATION_SUPPORT)
43 IF("${CMAKE_BUILD_TYPE}" STREQUAL "")
44 SET(CMAKE_BUILD_TYPE "Release")
45 ENDIF("${CMAKE_BUILD_TYPE}" STREQUAL "")
46 MESSAGE("Build type: ${CMAKE_BUILD_TYPE}")
48 INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)
49 INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include)
64 capi-content-mime-type
65 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")
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}\"")
115 IF(LIBNOTIFY_SUPPORT OR LIBNOTIFICATION_SUPPORT)
116 ADD_DEFINITIONS("-DDATA_DIR_ICON=\"${SHARE_INSTALL_PREFIX}\"")
117 MESSAGE("Icon used for notification is : ${SHARE_INSTALL_PREFIX}/icons/default/bt-icon.png")
118 ENDIF(LIBNOTIFY_SUPPORT OR LIBNOTIFICATION_SUPPORT)
120 SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -pie")
122 ADD_EXECUTABLE(${PROJECT_NAME} ${SRCS})
124 # to permit usage of bluetooth_cancel_bonding in bt-popup.c. This build bluetooth-api first.
125 IF(LIBNOTIFY_SUPPORT)
126 ADD_DEPENDENCIES(${PROJECT_NAME} bluetooth-api)
127 TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${service_pkgs_LDFLAGS} bluetooth-api)
128 ELSE(LIBNOTIFY_SUPPORT)
129 TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${service_pkgs_LDFLAGS})
130 ENDIF(LIBNOTIFY_SUPPORT)
132 CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/org.projectx.bt.service.in ${CMAKE_CURRENT_SOURCE_DIR}/org.projectx.bt.service)
133 INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/org.projectx.bt.service DESTINATION share/dbus-1/system-services)
134 INSTALL(TARGETS ${PROJECT_NAME} DESTINATION bin)
136 INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/auto-pair-blacklist DESTINATION /opt/var/lib/bluetooth/)
138 # install booting script
139 CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/bluetooth-frwk-service.conf.in ${CMAKE_CURRENT_SOURCE_DIR}/bluetooth-frwk-service.conf)
142 INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/wearable/stack_info DESTINATION /usr/etc/bluetooth/)
144 INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/mobile/stack_info DESTINATION /usr/etc/bluetooth/)
145 ENDIF (TIZEN_WEARABLE)
147 SET(PREFIX ${CMAKE_INSTALL_PREFIX})