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
19 ${CMAKE_SOURCE_DIR}/framework/plugin-manager/MsgPluginConfig.cpp
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 lib)
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/MsgStorageSim.cpp
57 ${CMAKE_SOURCE_DIR}/framework/storage-handler/MsgStorageUtil.cpp
58 ${CMAKE_SOURCE_DIR}/framework/submit-handler/MsgSubmitHandler.cpp
59 ${CMAKE_SOURCE_DIR}/framework/deliver-handler/MsgDeliverHandler.cpp
63 ${CMAKE_SOURCE_DIR}/include/common
64 ${CMAKE_SOURCE_DIR}/include/framework
65 ${CMAKE_SOURCE_DIR}/include/utils
68 INCLUDE(FindPkgConfig)
69 pkg_check_modules(fw_handler_pkgs REQUIRED glib-2.0 dlog vconf capi-appfw-application)
71 FOREACH(flag ${fw_handler_pkgs_CFLAGS})
72 SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag} -std=c++0x")
75 SET(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}")
77 ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"")
79 SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed")
81 ADD_LIBRARY(${FW-HANDLER-LIB} SHARED ${FW-HANDLER-SRCS})
82 TARGET_LINK_LIBRARIES(${FW-HANDLER-LIB} ${fw_handler_pkgs_LDFLAGS} ${UTILS-LIB} ${PLUGIN-MANAGER-LIB})
84 INSTALL(TARGETS ${FW-HANDLER-LIB} DESTINATION lib COMPONENT RuntimeLibraries)
86 ##########################################################
87 # Define Transaction Manager
88 ##########################################################
90 SET(TRANS-MANAGER-SRCS
91 ${CMAKE_SOURCE_DIR}/framework/transaction-manager/MsgCmdHandlerSetting.cpp
92 ${CMAKE_SOURCE_DIR}/framework/transaction-manager/MsgCmdHandlerStorage.cpp
93 ${CMAKE_SOURCE_DIR}/framework/transaction-manager/MsgCmdHandlerTransport.cpp
94 ${CMAKE_SOURCE_DIR}/framework/transaction-manager/MsgTransManager.cpp
98 ${CMAKE_SOURCE_DIR}/include/common
99 ${CMAKE_SOURCE_DIR}/include/framework
100 ${CMAKE_SOURCE_DIR}/include/utils
103 INCLUDE(FindPkgConfig)
104 pkg_check_modules(trans_manager_pkgs REQUIRED glib-2.0 security-server dlog vconf)
106 FOREACH(flag ${trans_manager_pkgs_CFLAGS})
107 SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
110 SET(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}")
112 ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"")
114 SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed")
116 ADD_LIBRARY(${TRANS-MANAGER-LIB} SHARED ${TRANS-MANAGER-SRCS})
117 TARGET_LINK_LIBRARIES(${TRANS-MANAGER-LIB} ${trans_manager_pkgs_LDFLAGS} ${UTILS-LIB} ${FW-HANDLER-LIB})
119 INSTALL(TARGETS ${TRANS-MANAGER-LIB} DESTINATION lib COMPONENT RuntimeLibraries)
121 ##########################################################
122 # Define Execute File
123 ##########################################################
126 ${CMAKE_SOURCE_DIR}/framework/main.cpp
130 ${CMAKE_SOURCE_DIR}/include/common
131 ${CMAKE_SOURCE_DIR}/include/framework
132 ${CMAKE_SOURCE_DIR}/include/utils
135 INCLUDE(FindPkgConfig)
136 pkg_check_modules(main_pkgs REQUIRED glib-2.0 dbus-glib-1 dlog vconf)
138 FOREACH(flag ${main_pkgs_CFLAGS})
139 SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
142 SET(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}")
144 ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"")
146 SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed")
148 ADD_EXECUTABLE(${PROJECT_NAME} ${MAIN-SRCS})
149 TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${main_pkgs_LDFLAGS} ${UTILS-LIB} ${PLUGIN-MANAGER-LIB} ${TRANS-MANAGER-LIB} ${FW-HANDLER-LIB})
151 INSTALL(TARGETS ${PROJECT_NAME} DESTINATION bin)