summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
blob: e3a235aa67d254fe8c86711e5da0006c53af60b5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
PROJECT(contacts-service C CXX)

#IF("${CMAKE_BUILD_TYPE}" STREQUAL "")
#	SET(CMAKE_BUILD_TYPE "Release")
#ENDIF("${CMAKE_BUILD_TYPE}" STREQUAL "")
#MESSAGE("Build type: ${CMAKE_BUILD_TYPE}")

SET(DEST_INCLUDE_DIR "include/contacts-svc")
SET(SRC_INCLUDE_DIR "${CMAKE_SOURCE_DIR}/include")

SET(PREFIX ${CMAKE_INSTALL_PREFIX})
SET(EXEC_PREFIX "\${prefix}")
SET(LIBDIR "\${prefix}/lib")
SET(INCLUDEDIR "\${prefix}/${DEST_INCLUDE_DIR}")

EXECUTE_PROCESS(COMMAND build-util/generator.sh)

#INCLUDE_DIRECTORIES(${SRC_INCLUDE_DIR})
SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -I${SRC_INCLUDE_DIR}")

INCLUDE(FindPkgConfig)
pkg_check_modules(pkgs REQUIRED glib-2.0 pims-ipc capi-base-common vconf dlog db-util security-server vasum gobject-2.0 icu-uc)

FOREACH(flag ${pkgs_CFLAGS})
	SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
ENDFOREACH(flag)

SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -fvisibility=hidden -fdata-sections -ffunction-sections -Wl,--gc-sections")

SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fPIC")
#SET(CMAKE_C_FLAGS_DEBUG "-O0 -g")
#SET(CMAKE_C_FLAGS_RELEASE "-mabi=aapcs-linux -march=armv7-a -msoft-float -O2")

ADD_DEFINITIONS("-DPREFIX=\"${PREFIX}\"")

# for tizen open build test
IF(ENABLE_LOG_FEATURE)
	ADD_DEFINITIONS("-DENABLE_LOG_FEATURE")
ENDIF(ENABLE_LOG_FEATURE)


# Install notification files
FILE(GLOB NOTI_FILES ${CMAKE_SOURCE_DIR}/res/.CONTACTS_SVC_*)
INSTALL(FILES ${NOTI_FILES} DESTINATION /opt/usr/data/contacts-svc
		PERMISSIONS OWNER_WRITE OWNER_READ GROUP_WRITE GROUP_READ)

# Install directory for image
INSTALL(DIRECTORY DESTINATION /opt/usr/data/contacts-svc/img/contact)	# contact, my profile
INSTALL(DIRECTORY DESTINATION /opt/usr/data/contacts-svc/img/group)		# group
INSTALL(DIRECTORY DESTINATION /opt/usr/data/contacts-svc/img/logo)		# company logo
INSTALL(DIRECTORY DESTINATION /opt/usr/data/contacts-svc/img/vcard)		# vcard

# Install header file
FILE(GLOB HEADER_FILES ${CMAKE_CURRENT_SOURCE_DIR}/include/*.h)
INSTALL(FILES ${HEADER_FILES} DESTINATION ${DEST_INCLUDE_DIR})

# Install DB file
FILE(GLOB DB_FILES ${CMAKE_CURRENT_SOURCE_DIR}/build-util/.contacts-svc.db*)
INSTALL(FILES ${DB_FILES} DESTINATION /opt/usr/dbspace)

ADD_SUBDIRECTORY(client)
ADD_SUBDIRECTORY(server)