Migrate to openssl 1.1
[platform/core/messaging/email-service.git] / email-daemon / CMakeLists.txt
1 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
2 PROJECT(email-service)
3
4 SET(CMAKE_SKIP_BUILD_RPATH TRUE)
5
6 IF("${CMAKE_BUILD_TYPE}" STREQUAL "")
7         SET(CMAKE_BUILD_TYPE "Debug")
8 ENDIF("${CMAKE_BUILD_TYPE}" STREQUAL "")
9
10 MESSAGE("")
11 MESSAGE(">>> current directory: ${CMAKE_CURRENT_SOURCE_DIR}")
12 MESSAGE(">>> Build type: ${CMAKE_BUILD_TYPE}")
13
14 ADD_DEFINITIONS("-DSSL_CERT_DIRECTORY=\"${TZ_SYS_ETC}/ssl/certs\"")
15 ADD_DEFINITIONS("-DSSL_KEY_DIRECTORY=\"${TZ_SYS_ETC}/ssl/certs\"")
16
17 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${VISIBILITY} -fvisibility=hidden")
18 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wl,--gc-sections -fPIE")
19
20
21 ##########################################################
22 # Define Execute File
23 ##########################################################
24
25 SET(MAIN-SRCS 
26         ${CMAKE_SOURCE_DIR}/email-daemon/main.c
27         ${CMAKE_SOURCE_DIR}/email-daemon/email-daemon-event.c
28         ${CMAKE_SOURCE_DIR}/email-daemon/email-daemon-init.c
29         ${CMAKE_SOURCE_DIR}/email-daemon/email-daemon-account.c
30         ${CMAKE_SOURCE_DIR}/email-daemon/email-daemon-mail.c
31         ${CMAKE_SOURCE_DIR}/email-daemon/email-daemon-mailbox.c
32         ${CMAKE_SOURCE_DIR}/email-daemon/email-daemon-etc.c
33         ${CMAKE_SOURCE_DIR}/email-daemon/email-daemon-emn.c
34         ${CMAKE_SOURCE_DIR}/email-daemon/email-daemon-auto-poll.c
35 )
36
37 INCLUDE_DIRECTORIES(
38         ${CMAKE_SOURCE_DIR}/email-common-use/include
39         ${CMAKE_SOURCE_DIR}/email-ipc/include
40         ${CMAKE_SOURCE_DIR}/email-ipc/email-ipc-api/include
41         ${CMAKE_SOURCE_DIR}/email-ipc/email-activation/include
42         ${CMAKE_SOURCE_DIR}/email-api/include
43         ${CMAKE_SOURCE_DIR}/email-core/include
44         ${CMAKE_SOURCE_DIR}/email-core/email-storage/include
45         ${CMAKE_SOURCE_DIR}/email-core/email-network/include
46         ${CMAKE_SOURCE_DIR}/email-core/email-device/include
47         ${CMAKE_SOURCE_DIR}/email-daemon/include
48 )
49
50 INCLUDE(FindPkgConfig)
51 SET(PKG_MODULES glib-2.0 dlog dbus-1 gthread-2.0 uw-imap-toolkit
52                                 vconf vconf-internal-keys contacts-service2 alarm-service
53                                 msg-service libwbxml2 libsmack notification
54                                 capi-network-connection gmime-2.6)
55
56 pkg_check_modules(main_pkgs REQUIRED ${PKG_MODULES})
57
58 FOREACH(flag ${main_pkgs_CFLAGS})
59         SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
60 ENDFOREACH(flag)
61
62 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}")
63 SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -pie")
64
65 ADD_EXECUTABLE(${PROJECT_NAME} ${MAIN-SRCS})
66 TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${main_pkgs_LDFLAGS} dl ssl email-core email-storage email-network email-ipc email-common-use email-device email-smime)
67 INSTALL(TARGETS ${PROJECT_NAME} DESTINATION bin)
68