1 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
2 PROJECT(bluetooth-pb-agent C)
4 SET(SRCS bluetooth_pb_agent.c bluetooth_pb_vcard.c)
6 INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
9 pkg_check_modules(pkgs_pb_agent
11 dbus-glib-1 dlog contacts-service2 tapi vconf)
13 FOREACH(flag ${pkgs_pb_agent_CFLAGS})
14 SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
16 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}")
18 FIND_PROGRAM(DBUS_BINDING_TOOL NAMES dbus-binding-tool)
19 EXEC_PROGRAM("${DBUS_BINDING_TOOL}"
20 ARGS "--prefix=bluetooth_pb \\
21 ${CMAKE_CURRENT_SOURCE_DIR}/bluetooth_pb_agent.xml \\
23 --output=${CMAKE_CURRENT_SOURCE_DIR}/bluetooth_pb_agent_glue.h")
25 ADD_EXECUTABLE(${PROJECT_NAME} ${SRCS})
26 TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_pb_agent_LDFLAGS})
28 INSTALL(TARGETS ${PROJECT_NAME} DESTINATION bin)
29 INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/org.bluez.pb_agent.service
30 DESTINATION share/dbus-1/services)