1 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
4 SET(CMAKE_SKIP_BUILD_RPATH TRUE)
6 IF("${CMAKE_BUILD_TYPE}" STREQUAL "")
7 SET(CMAKE_BUILD_TYPE "Debug")
8 ENDIF("${CMAKE_BUILD_TYPE}" STREQUAL "")
11 MESSAGE(">>> current directory: ${CMAKE_CURRENT_SOURCE_DIR}")
12 MESSAGE(">>> Build type: ${CMAKE_BUILD_TYPE}")
15 SET(VISIBILITY "-DEXPORT_API=\"__attribute__((visibility(\\\"default\\\")))\"")
16 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${VISIBILITY} -fvisibility=hidden")
18 ##########################################################
20 ##########################################################
22 SET(API-LIB "email-api")
24 ${CMAKE_SOURCE_DIR}/email-api/email-api-account.c
25 ${CMAKE_SOURCE_DIR}/email-api/email-api-mail.c
26 ${CMAKE_SOURCE_DIR}/email-api/email-api-network.c
27 ${CMAKE_SOURCE_DIR}/email-api/email-api-rule.c
28 ${CMAKE_SOURCE_DIR}/email-api/email-api-mailbox.c
29 ${CMAKE_SOURCE_DIR}/email-api/email-api-init.c
30 ${CMAKE_SOURCE_DIR}/email-api/email-api-smime.c
31 ${CMAKE_SOURCE_DIR}/email-api/email-api-etc.c
35 ${CMAKE_SOURCE_DIR}/email-daemon/include
36 ${CMAKE_SOURCE_DIR}/email-api/include
37 ${CMAKE_SOURCE_DIR}/email-api/socket/include
38 ${CMAKE_SOURCE_DIR}/email-ipc/include
39 ${CMAKE_SOURCE_DIR}/email-core/include
40 ${CMAKE_SOURCE_DIR}/email-core/email-storage/include
41 ${CMAKE_SOURCE_DIR}/email-common-use/include
44 INCLUDE(FindPkgConfig)
45 pkg_check_modules(api_pkgs REQUIRED glib-2.0 dlog dbus-1 vconf heynoti db-util contacts-service uw-imap-toolkit)
47 FOREACH(flag ${api_pkgs_CFLAGS})
48 SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
51 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}")
53 SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed")
55 ADD_LIBRARY(${API-LIB} SHARED ${API-SRCS})
57 TARGET_LINK_LIBRARIES(${API-LIB} ${api_pkgs_LDFLAGS} email-ipc email-storage email-core email-common-use email-network)
58 #${NETWORK-LIB} ${CORE-LIB} ${STORAGE-LIB} ${IPC-LIB} ${COMMON-LIB})
60 SET_TARGET_PROPERTIES(${API-LIB} PROPERTIES SOVERSION ${VERSION_MAJOR})
61 SET_TARGET_PROPERTIES(${API-LIB} PROPERTIES VERSION ${VERSION})
63 #INSTALL(TARGETS ${API-LIB} LIBRARY DESTINATION lib)
64 INSTALL(TARGETS ${API-LIB} DESTINATION lib COMPONENT RuntimeLibraries)
67 ${CMAKE_SOURCE_DIR}/email-api/include/email-api.h
68 ${CMAKE_SOURCE_DIR}/email-api/include/email-api-account.h
69 ${CMAKE_SOURCE_DIR}/email-api/include/email-api-init.h
70 ${CMAKE_SOURCE_DIR}/email-api/include/email-api-mail.h
71 ${CMAKE_SOURCE_DIR}/email-api/include/email-api-mailbox.h
72 ${CMAKE_SOURCE_DIR}/email-api/include/email-api-network.h
73 ${CMAKE_SOURCE_DIR}/email-api/include/email-api-rule.h
74 ${CMAKE_SOURCE_DIR}/email-api/include/email-api-etc.h
75 ${CMAKE_SOURCE_DIR}/email-api/include/email-api-smime.h
76 ${CMAKE_SOURCE_DIR}/email-common-use/include/email-types.h
77 ${CMAKE_SOURCE_DIR}/email-common-use/include/email-errors.h
80 INSTALL(FILES ${EMAIL-API-HEADERS} DESTINATION include/email-service)