pkg_check_modules(pkgs REQUIRED glib-2.0 bluetooth-api
dbus-glib-1 appcore-common
dlog vconf pmapi sysman
- notification calendar-service2 contacts-service2
+ notification
appsvc appcore-efl libprivilege-control
capi-content-media-content
libtzplatform-config)
+pkg_check_modules(CALENDAR_SERVICE2 calendar-service2)
+pkg_check_modules(CONTACTS_SERVICE2 contacts-service2)
-FOREACH(flag ${pkgs_CFLAGS})
+FOREACH(flag ${pkgs_CFLAGS} ${CALENDAR_SERVICE2_CFLAGS} ${CONTACTS_SERVICE2_CFLAGS})
SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
ENDFOREACH(flag)
#SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -finstrument-functions")
ADD_DEFINITIONS("-DFACTORYFS=\"$ENV{FACTORYFS}\"")
ADD_DEFINITIONS("-DTARGET")
ADD_DEFINITIONS("-DSLP_DEBUG")
+if(CALENDAR_SERVICE2_FOUND)
+ ADD_DEFINITIONS("-DENABLE_CALENDAR_SERVICE2")
+endif(CALENDAR_SERVICE2_FOUND)
+if(CONTACTS_SERVICE2_FOUND)
+ ADD_DEFINITIONS("-DENABLE_CONTACTS_SERVICE2")
+endif(CONTACTS_SERVICE2_FOUND)
ADD_EXECUTABLE(${PROJECT_NAME} ${SRCS})
-TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_LDFLAGS} -L${CMAKE_CURRENT_SOURCE_DIR}/../lib -lbluetooth-share-api)
+TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_LDFLAGS} ${CALENDAR_SERVICE2_LDFLAGS} ${CONTACTS_SERVICE2_LDFLAGS} -L${CMAKE_CURRENT_SOURCE_DIR}/../lib -lbluetooth-share-api)
INSTALL(TARGETS ${PROJECT_NAME} DESTINATION bin)
#include <string.h>
#include <glib.h>
#include <vconf-keys.h>
+#ifdef ENABLE_CALENDAR_SERVICE2
#include <calendar2.h>
+#endif
+#ifdef ENABLE_CONTACTS_SERVICE2
#include <contacts.h>
+#endif
#include <vconf.h>
#include <Ecore_File.h>
#include <bluetooth-share-api.h>
return BT_FILE_OTHER;
}
+#ifdef ENABLE_CONTACTS_SERVICE2
static bool __bt_vcard_handler(contacts_record_h record, void *user_data)
{
int ret;
return true;
}
+#endif /* ENABLE_CONTACTS_SERVICE2 */
+#ifdef ENABLE_CALENDAR_SERVICE2
static bool __bt_vcalendar_handler(calendar_record_h record, void *user_data)
{
int ret;
return true;
}
+#endif /* ENABLE_CALENDAR_SERVICE2 */
static gboolean __bt_save_v_object(char *file_path,
bt_file_type_t file_type)
DBG("file_path = %s, file_type = %d\n", file_path, file_type);
switch (file_type) {
+#ifdef ENABLE_CONTACTS_SERVICE2
case BT_FILE_VCARD:
ret = contacts_connect2();
if (ret != CONTACTS_ERROR_NONE) {
return FALSE;
}
break;
+#endif /* ENABLE_CONTACTS_SERVICE2 */
+#ifdef ENABLE_CALENDAR_SERVICE2
case BT_FILE_VCAL:
ret = calendar_connect();
if (ret != CALENDAR_ERROR_NONE) {
return FALSE;
}
break;
+#endif /* ENABLE_CALENDAR_SERVICE2 */
default:
break;
BuildRequires: pkgconfig(bluetooth-api)
BuildRequires: pkgconfig(glib-2.0)
BuildRequires: pkgconfig(dlog)
+# Same check as in tizen-extensions-crosswalk. A per-package or global
+# bcond would be better, but for now let's follow Crosswalk's approach.
+%if "%{profile}" == "mobile"
BuildRequires: pkgconfig(calendar-service2)
BuildRequires: pkgconfig(contacts-service2)
+%endif
BuildRequires: pkgconfig(vconf)
BuildRequires: pkgconfig(pmapi)
BuildRequires: pkgconfig(sysman)