Update version 0.9.70.1
[platform/core/pim/contacts-service.git] / CMakeLists.txt
1 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
2 PROJECT(contacts-service C)
3
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}")
8
9 SET(DEST_INCLUDE_DIR "include/contacts-svc")
10 SET(SRC_INCLUDE_DIR "${CMAKE_SOURCE_DIR}/include")
11
12 SET(PREFIX ${CMAKE_INSTALL_PREFIX})
13 SET(EXEC_PREFIX "\${prefix}")
14 SET(INCLUDEDIR "\${prefix}/${DEST_INCLUDE_DIR}")
15 SET(VERSION_MAJOR 0)
16 SET(VERSION "${VERSION_MAJOR}.9.70.1")
17
18 EXECUTE_PROCESS(COMMAND build-util/generator.sh)
19
20 SET(PC_REQUIRED "capi-base-common")
21
22 #INCLUDE_DIRECTORIES(${SRC_INCLUDE_DIR})
23 SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -I${SRC_INCLUDE_DIR}")
24
25 INCLUDE(FindPkgConfig)
26 pkg_check_modules(pkgs REQUIRED glib-2.0 capi-base-common vconf dlog db-util icu-i18n)
27
28 FOREACH(flag ${pkgs_CFLAGS})
29         SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
30 ENDFOREACH(flag)
31
32 SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -fvisibility=hidden")
33
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")
37
38 ADD_DEFINITIONS("-DPREFIX=\"${PREFIX}\"")
39
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)
44
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)
50
51 # Install header file
52 FILE(GLOB HEADER_FILES ${CMAKE_CURRENT_SOURCE_DIR}/include/*.h)
53
54 INSTALL(FILES ${HEADER_FILES} DESTINATION ${DEST_INCLUDE_DIR})
55
56 # Install DB file
57 FILE(GLOB DB_FILES ${CMAKE_CURRENT_SOURCE_DIR}/build-util/.contacts-svc.db*)
58 INSTALL(FILES ${DB_FILES} DESTINATION /opt/usr/dbspace)
59
60 ADD_SUBDIRECTORY(native)
61 ADD_SUBDIRECTORY(client)
62 ADD_SUBDIRECTORY(server)
63