1 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
2 PROJECT(msg-server CXX)
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 "")
9 MESSAGE("Build type: ${CMAKE_BUILD_TYPE}")
11 SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -O0 -g -Wall")
13 #########################################################
14 # Define Plugin Manager
15 ##########################################################
17 SET(PLUGIN-MANAGER-SRCS
18 ${CMAKE_SOURCE_DIR}/framework/plugin-manager/MsgPluginManager.cpp
22 ${CMAKE_SOURCE_DIR}/include/mapi
23 ${CMAKE_SOURCE_DIR}/include/common
24 ${CMAKE_SOURCE_DIR}/include/framework
25 ${CMAKE_SOURCE_DIR}/include/utils
28 INCLUDE(FindPkgConfig)
29 pkg_check_modules(plugin_manager_pkgs REQUIRED glib-2.0 dlog vconf)
31 FOREACH(flag ${plugin_manager_pkgs_CFLAGS})
32 SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
35 SET(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}")
37 ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"")
39 SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed")
41 ADD_LIBRARY(${PLUGIN-MANAGER-LIB} SHARED ${PLUGIN-MANAGER-SRCS})
42 TARGET_LINK_LIBRARIES(${PLUGIN-MANAGER-LIB} ${plugin_manager_pkgs_LDFLAGS} ${UTILS-LIB} dl)
44 INSTALL(TARGETS ${PLUGIN-MANAGER-LIB} LIBRARY DESTINATION ${LIBDIR})
46 ##########################################################
47 # Define Messaging Framework Handler
48 ##########################################################
51 ${CMAKE_SOURCE_DIR}/framework/setting-handler/MsgSettingHandler.cpp
52 ${CMAKE_SOURCE_DIR}/framework/storage-handler/MsgStorageManager.cpp
53 ${CMAKE_SOURCE_DIR}/framework/storage-handler/MsgStorageMessage.cpp
54 ${CMAKE_SOURCE_DIR}/framework/storage-handler/MsgStorageMms.cpp
55 ${CMAKE_SOURCE_DIR}/framework/storage-handler/MsgStorageFolder.cpp
56 ${CMAKE_SOURCE_DIR}/framework/storage-handler/MsgStorageFilter.cpp
57 ${CMAKE_SOURCE_DIR}/framework/storage-handler/MsgStorageSim.cpp
58 ${CMAKE_SOURCE_DIR}/framework/storage-handler/MsgStorageUtil.cpp
59 ${CMAKE_SOURCE_DIR}/framework/submit-handler/MsgSubmitHandler.cpp
60 ${CMAKE_SOURCE_DIR}/framework/deliver-handler/MsgDeliverHandler.cpp
64 ${CMAKE_SOURCE_DIR}/include/mapi
65 ${CMAKE_SOURCE_DIR}/include/common
66 ${CMAKE_SOURCE_DIR}/include/framework
67 ${CMAKE_SOURCE_DIR}/include/utils
68 ${CMAKE_SOURCE_DIR}/include/externals
69 ${CMAKE_SOURCE_DIR}/vobject-engine/include
72 INCLUDE(FindPkgConfig)
73 pkg_check_modules(fw_handler_pkgs REQUIRED glib-2.0 gio-2.0 dlog vconf capi-appfw-application)
75 FOREACH(flag ${fw_handler_pkgs_CFLAGS})
76 SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag} -std=c++0x")
79 SET(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}")
81 ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"")
83 SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed")
85 ADD_LIBRARY(${FW-HANDLER-LIB} SHARED ${FW-HANDLER-SRCS})
86 TARGET_LINK_LIBRARIES(${FW-HANDLER-LIB} ${fw_handler_pkgs_LDFLAGS} ${UTILS-LIB} ${EXTERNALS-LIB} ${PLUGIN-MANAGER-LIB})
88 INSTALL(TARGETS ${FW-HANDLER-LIB} DESTINATION ${LIBDIR} COMPONENT RuntimeLibraries)
90 ##########################################################
91 # Define Transaction Manager
92 ##########################################################
94 SET(TRANS-MANAGER-SRCS
95 ${CMAKE_SOURCE_DIR}/framework/transaction-manager/MsgCmdHandlerSetting.cpp
96 ${CMAKE_SOURCE_DIR}/framework/transaction-manager/MsgCmdHandlerStorage.cpp
97 ${CMAKE_SOURCE_DIR}/framework/transaction-manager/MsgCmdHandlerTransport.cpp
98 ${CMAKE_SOURCE_DIR}/framework/transaction-manager/MsgCmdHandlerFilter.cpp
99 ${CMAKE_SOURCE_DIR}/framework/transaction-manager/MsgTransManager.cpp
103 ${CMAKE_SOURCE_DIR}/include/mapi
104 ${CMAKE_SOURCE_DIR}/include/common
105 ${CMAKE_SOURCE_DIR}/include/framework
106 ${CMAKE_SOURCE_DIR}/include/externals
107 ${CMAKE_SOURCE_DIR}/include/utils
110 INCLUDE(FindPkgConfig)
111 pkg_check_modules(trans_manager_pkgs REQUIRED glib-2.0 security-server dlog vconf)
113 FOREACH(flag ${trans_manager_pkgs_CFLAGS})
114 SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
117 SET(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}")
119 ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"")
121 SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed")
123 ADD_LIBRARY(${TRANS-MANAGER-LIB} SHARED ${TRANS-MANAGER-SRCS})
124 TARGET_LINK_LIBRARIES(${TRANS-MANAGER-LIB} ${trans_manager_pkgs_LDFLAGS} ${UTILS-LIB} ${EXTERNALS-LIB} ${FW-HANDLER-LIB})
126 INSTALL(TARGETS ${TRANS-MANAGER-LIB} DESTINATION ${LIBDIR} COMPONENT RuntimeLibraries)
128 ##########################################################
129 # Define Execute File
130 ##########################################################
133 ${CMAKE_SOURCE_DIR}/framework/main.cpp
137 ${CMAKE_SOURCE_DIR}/include/mapi
138 ${CMAKE_SOURCE_DIR}/include/common
139 ${CMAKE_SOURCE_DIR}/include/framework
140 ${CMAKE_SOURCE_DIR}/include/externals
141 ${CMAKE_SOURCE_DIR}/include/utils
144 INCLUDE(FindPkgConfig)
145 pkg_check_modules(main_pkgs REQUIRED glib-2.0 dbus-glib-1 dlog vconf db-util)
147 FOREACH(flag ${main_pkgs_CFLAGS})
148 SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
151 SET(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}")
152 SET(server_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIE")
154 ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"")
156 SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -pie")
158 ADD_EXECUTABLE(${PROJECT_NAME} ${MAIN-SRCS})
159 TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${main_pkgs_LDFLAGS} ${UTILS-LIB} ${EXTERNALS-LIB} ${PLUGIN-MANAGER-LIB} ${TRANS-MANAGER-LIB} ${FW-HANDLER-LIB})
161 SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "${server_CXX_FLAGS}")
163 INSTALL(TARGETS ${PROJECT_NAME} DESTINATION bin)