1 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
2 PROJECT(contacts-service C)
4 #IF("${CMAKE_BUILD_TYPE}" STREQUAL "")
5 # SET(CMAKE_BUILD_TYPE "Release")
6 #ENDIF("${CMAKE_BUILD_TYPE}" STREQUAL "")
7 #MESSAGE("Build type: ${CMAKE_BUILD_TYPE}")
9 SET(DEST_INCLUDE_DIR "include/contacts-svc")
10 SET(SRC_INCLUDE_DIR "${CMAKE_SOURCE_DIR}/include")
12 SET(PREFIX ${CMAKE_INSTALL_PREFIX})
13 SET(EXEC_PREFIX "\${prefix}")
14 SET(INCLUDEDIR "\${prefix}/${DEST_INCLUDE_DIR}")
16 SET(VERSION "${VERSION_MAJOR}.9.70.1")
18 EXECUTE_PROCESS(COMMAND build-util/generator.sh)
20 SET(PC_REQUIRED "capi-base-common")
22 #INCLUDE_DIRECTORIES(${SRC_INCLUDE_DIR})
23 SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -I${SRC_INCLUDE_DIR}")
25 INCLUDE(FindPkgConfig)
26 pkg_check_modules(pkgs REQUIRED glib-2.0 capi-base-common vconf dlog db-util icu-i18n)
28 FOREACH(flag ${pkgs_CFLAGS})
29 SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
32 SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -fvisibility=hidden")
34 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fPIC")
35 #SET(CMAKE_C_FLAGS_DEBUG "-O0 -g")
36 #SET(CMAKE_C_FLAGS_RELEASE "-mabi=aapcs-linux -march=armv7-a -msoft-float -O2")
38 ADD_DEFINITIONS("-DPREFIX=\"${PREFIX}\"")
40 # Install notification files
41 FILE(GLOB NOTI_FILES ${CMAKE_SOURCE_DIR}/res/.CONTACTS_SVC_*)
42 INSTALL(FILES ${NOTI_FILES} DESTINATION /opt/usr/data/contacts-svc
43 PERMISSIONS OWNER_WRITE OWNER_READ GROUP_WRITE GROUP_READ)
45 # Install directory for image
46 INSTALL(DIRECTORY DESTINATION /opt/usr/data/contacts-svc/img/vcard)
47 INSTALL(DIRECTORY DESTINATION /opt/usr/data/contacts-svc/img/my)
48 INSTALL(DIRECTORY DESTINATION /opt/usr/data/contacts-svc/img/group)
49 INSTALL(DIRECTORY DESTINATION /opt/usr/data/contacts-svc/img/logo)
52 FILE(GLOB HEADER_FILES ${CMAKE_CURRENT_SOURCE_DIR}/include/*.h)
54 INSTALL(FILES ${HEADER_FILES} DESTINATION ${DEST_INCLUDE_DIR})
57 FILE(GLOB DB_FILES ${CMAKE_CURRENT_SOURCE_DIR}/build-util/.contacts-svc.db*)
58 INSTALL(FILES ${DB_FILES} DESTINATION /opt/usr/dbspace)
60 ADD_SUBDIRECTORY(native)
61 ADD_SUBDIRECTORY(client)
62 ADD_SUBDIRECTORY(server)