merge with master
[framework/osp/messaging.git] / CMakeLists.txt
1 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
2
3 SET (this_target osp-messaging)
4
5 SET(LIBRARY_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/cmake_build_tmp/output)
6
7 INCLUDE_DIRECTORIES(
8         inc
9         src
10         src/inc
11         /usr/include/appfw
12         /usr/include/glib-2.0 
13         /usr/lib/glib-2.0/include
14         /usr/include/osp
15         /usr/include/osp/app
16         /usr/include/osp/base
17         /usr/include/osp/security
18         /usr/include/msg-service
19         /usr/include/dbus-1.0
20         /usr/lib/dbus-1.0/include
21         /usr/include/email-service
22         /usr/include/libxml2
23         )
24
25 SET (${this_target}_SOURCE_FILES
26         src/FMsgEmailManager.cpp
27         src/FMsgEmailMessage.cpp
28         src/FMsgEmailAttachment.cpp
29         src/FMsgDetailedEmailMessage.cpp
30         src/FMsgMmsManager.cpp
31         src/FMsgMmsMessage.cpp
32         src/FMsgPushManager.cpp
33         src/FMsgPushMessage.cpp
34         src/FMsgWapPushManager.cpp
35         src/FMsgWapPushMessage.cpp
36         src/FMsgRecipientList.cpp
37         src/FMsgSmsManager.cpp
38         src/FMsgSmsMessage.cpp
39         src/FMsgCbsChannel.cpp
40         src/FMsgCbsMessage.cpp
41         src/FMsgEtwsPrimaryNotification.cpp
42         src/FMsg_EmailEvent.cpp
43         src/FMsg_EmailEventArg.cpp
44         src/FMsg_EmailManagerImpl.cpp
45         src/FMsg_EmailMessageImpl.cpp
46         src/FMsg_EmailAttachmentImpl.cpp
47         src/FMsg_DetailedEmailMessageImpl.cpp
48         src/FMsg_MmsEvent.cpp
49         src/FMsg_MmsEventArg.cpp
50         src/FMsg_MmsManagerImpl.cpp
51         src/FMsg_MmsMessageImpl.cpp
52         src/FMsg_PushEvent.cpp
53         src/FMsg_PushEventArg.cpp
54         src/FMsg_PushManagerImpl.cpp
55         src/FMsg_PushMessageImpl.cpp
56         src/FMsg_PushRequest.cpp
57         src/FMsg_PushSendListener.cpp
58         src/FMsg_PushUrlRequestListener.cpp
59         src/FMsg_WapPushManagerImpl.cpp
60         src/FMsg_WapPushMessageImpl.cpp
61         src/FMsg_ComposerEvent.cpp
62         src/FMsg_ComposerEventArg.cpp
63         src/FMsg_RecipientListImpl.cpp
64         src/FMsg_SmsEvent.cpp
65         src/FMsg_SmsEventArg.cpp
66         src/FMsg_SmsManagerImpl.cpp
67         src/FMsg_SmsMessageImpl.cpp
68         src/FMsg_CbsChannelImpl.cpp
69         src/FMsg_CbsMessageImpl.cpp
70         src/FMsg_EtwsPrimaryNotificationImpl.cpp
71         src/FMsg_MsgUtil.cpp
72         src/FMsg_SmsMmsCallbackHandler.cpp
73 )
74
75 SET(EXTRA_CFLAGS  "${EXTRA_CFLAGS} -Wall" )
76
77 ## SET C COMPILER FLAGS
78 SET(CMAKE_C_FLAGS "${OSP_DEBUG_FLAGS} ${OSP_OPT_FLAGS} ${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} ${OSP_COMPILER_FLAGS}")
79
80 ## SET CPP COMPILER FLAGS
81 SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden")
82 SET(CMAKE_CXX_FLAGS "${OSP_DEBUG_FLAGS} ${OSP_OPT_FLAGS} ${CMAKE_CXX_FLAGS} ${EXTRA_CFLAGS} ${OSP_COMPILER_FLAGS}")
83
84 ## Create Library
85 ADD_LIBRARY (${this_target} SHARED ${${this_target}_SOURCE_FILES})
86
87 ## SET LINKER FLAGS
88 SET(CMAKE_SHARED_LINKER_FLAGS -Wl,--no-undefined)
89
90 TARGET_LINK_LIBRARIES(${this_target} "-lchromium" )
91 TARGET_LINK_LIBRARIES(${this_target} "-L/usr/lib/osp -losp-appfw -losp-json -losp-net -losp-shell-core" )
92 TARGET_LINK_LIBRARIES(${this_target} "-lcapi-appfw-application" )
93 TARGET_LINK_LIBRARIES(${this_target} "-ldbus-1" )
94 TARGET_LINK_LIBRARIES(${this_target} "-ldbus-glib-1" )
95 TARGET_LINK_LIBRARIES(${this_target} "-lemail-api" )
96 TARGET_LINK_LIBRARIES(${this_target} "-lmsg_mapi" )
97 TARGET_LINK_LIBRARIES(${this_target} "-lpush" )
98
99
100 SET_TARGET_PROPERTIES(${this_target} 
101         PROPERTIES 
102         VERSION ${FULLVER}
103         SOVERSION ${MAJORVER}
104         CLEAN_DIRECT_OUTPUT 1
105         )
106
107 ADD_CUSTOM_COMMAND(TARGET ${this_target}
108     POST_BUILD
109                 COMMAND ${CMAKE_COMMAND} -E copy ${LIBRARY_OUTPUT_PATH}/${CMAKE_SHARED_LIBRARY_PREFIX}${this_target}${CMAKE_SHARED_LIBRARY_SUFFIX} ${LIBRARY_OUTPUT_PATH}/debug/${CMAKE_SHARED_LIBRARY_PREFIX}${this_target}${CMAKE_SHARED_LIBRARY_SUFFIX}.${FULLVER} 
110                 COMMAND ${CMAKE_COMMAND} -E create_symlink ${CMAKE_SHARED_LIBRARY_PREFIX}${this_target}${CMAKE_SHARED_LIBRARY_SUFFIX}.${FULLVER} ${LIBRARY_OUTPUT_PATH}/debug/${CMAKE_SHARED_LIBRARY_PREFIX}${this_target}${CMAKE_SHARED_LIBRARY_SUFFIX}.${MAJORVER}
111                 COMMAND ${CMAKE_STRIP} --strip-unneeded ${LIBRARY_OUTPUT_PATH}/${CMAKE_SHARED_LIBRARY_PREFIX}${this_target}${CMAKE_SHARED_LIBRARY_SUFFIX}
112     COMMENT "strip ${this_target}"
113                 )   
114
115 INSTALL(DIRECTORY ${LIBRARY_OUTPUT_PATH}/ DESTINATION lib/osp 
116                                 FILES_MATCHING PATTERN "*.so*" 
117                                 PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ                                          
118                                                                                 GROUP_EXECUTE GROUP_READ
119                                                                                 WORLD_EXECUTE WORLD_READ)
120 INSTALL(DIRECTORY ${LIBRARY_OUTPUT_PATH}/debug/ DESTINATION lib/osp/debug 
121                                 FILES_MATCHING PATTERN "*.so*" 
122                                 PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ                                          
123                                                                                 GROUP_EXECUTE GROUP_READ
124                                                                                 WORLD_EXECUTE WORLD_READ)
125
126 INSTALL(DIRECTORY ${CMAKE_SOURCE_DIR}/inc/ DESTINATION include/osp FILES_MATCHING PATTERN "*.h")
127 INSTALL(DIRECTORY ${CMAKE_SOURCE_DIR}/src/inc/ DESTINATION include/osp/messaging FILES_MATCHING PATTERN "*.h")
128
129 # pkgconfig file
130 CONFIGURE_FILE(${this_target}.pc.in ${CMAKE_SOURCE_DIR}/${this_target}.pc @ONLY)
131 INSTALL(FILES ${CMAKE_SOURCE_DIR}/${this_target}.pc DESTINATION lib/pkgconfig)