[social] Fix DCM-2023
[framework/osp/social.git] / CMakeLists.txt
1 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
2
3 SET(CMAKE_INSTALL_PREFIX /usr)
4 SET(PREFIX ${CMAKE_INSTALL_PREFIX})
5
6 SET (this_target osp-social)
7
8 SET(LIBRARY_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/cmake_build_tmp/output)
9
10 #INCLUDE(FindPkgConfig)
11 #pkg_check_modules(pkgs REQUIRED calendar-service2)
12 #pkg_check_modules(pkgs REQUIRED accounts-svc)
13
14 INCLUDE_DIRECTORIES(
15         inc
16         src
17         src/inc
18         /usr/include
19         /usr/include/glib-2.0 
20         /usr/lib/glib-2.0/include
21         /usr/include/db-util
22         /usr/include/social
23         /usr/include/accounts-svc
24         /usr/include/contacts-svc
25         /usr/include/osp
26         /usr/include/osp/app
27         /usr/include/osp/base
28         /usr/include/osp/media
29         /usr/include/osp/security
30         /usr/include/calendar-service2
31         )
32
33 SET (${this_target}_SOURCE_FILES
34         src/FSclAddress.cpp
35         src/FScl_AddressImpl.cpp
36         src/FSclAddressbook.cpp
37         src/FScl_AddressbookImpl.cpp
38         src/FSclAddressbookFilter.cpp
39         src/FScl_AddressbookFilterImpl.cpp
40         src/FScl_AddressbookUtil.cpp
41         src/FSclAddressbookManager.cpp
42         src/FScl_AddressbookManagerImpl.cpp
43         src/FSclCategory.cpp
44         src/FScl_CategoryImpl.cpp
45         src/FSclContact.cpp
46         src/FScl_ContactImpl.cpp
47         src/FSclContactAppLaunchData.cpp
48         src/FScl_ContactAppLaunchDataImpl.cpp
49         src/FSclContactEvent.cpp
50         src/FScl_ContactEventImpl.cpp
51         src/FSclEmail.cpp
52         src/FScl_EmailImpl.cpp
53         src/FSclEmailContact.cpp
54         src/FScl_EmailContactImpl.cpp
55         src/FSclImAddress.cpp
56         src/FScl_ImAddressImpl.cpp
57         src/FSclPhoneNumber.cpp
58         src/FScl_PhoneNumberImpl.cpp
59         src/FSclPhoneNumberContact.cpp
60         src/FScl_PhoneNumberContactImpl.cpp
61         src/FSclRecord.cpp
62         src/FScl_RecordImpl.cpp
63         src/FSclUrl.cpp
64         src/FScl_UrlImpl.cpp
65         src/FSclCalendarbook.cpp
66         src/FScl_CalendarbookImpl.cpp
67         src/FSclReminder.cpp
68         src/FScl_ReminderImpl.cpp
69         src/FSclCalTodo.cpp
70         src/FScl_CalTodoImpl.cpp
71         src/FSclCalEvent.cpp
72         src/FScl_CalEventImpl.cpp
73         src/FSclAttendee.cpp
74         src/FSclRecurrence.cpp
75         src/FScl_RecurrenceImpl.cpp
76         src/FSclCalendar.cpp
77         src/FScl_CalendarImpl.cpp
78         src/FSclCalEventInstance.cpp
79         src/FScl_CalEventInstanceImpl.cpp
80         src/FSclCalEventChangeInfo.cpp
81         src/FScl_CalEventChangeInfoImpl.cpp
82         src/FSclCalTodoChangeInfo.cpp
83         src/FScl_CalTodoChangeInfoImpl.cpp
84         src/FSclCalendarbookFilter.cpp
85         src/FScl_CalendarbookFilterImpl.cpp
86         src/FScl_CalendarbookUtil.cpp
87         src/FScl_CalendarbookDbConnector.cpp
88         src/FScl_CalendarbookDbMonitor.cpp
89         src/FScl_CalendarbookDbChangeEvent.cpp
90         src/FScl_CalendarbookDbChangeEventArg.cpp
91         src/FScl_CalendarbookRecordRetrivalEvent.cpp
92         src/FScl_CalendarbookRecordRetrivalEventArg.cpp
93         src/FScl_CalendarbookRecordRetrivalThread.cpp
94         src/FSclContactChangeInfo.cpp
95         src/FScl_ContactChangeInfoImpl.cpp
96         src/FSclCategoryChangeInfo.cpp
97         src/FScl_CategoryChangeInfoImpl.cpp
98         src/FSclOrganization.cpp
99         src/FScl_OrganizationImpl.cpp
100         src/FSclPerson.cpp
101         src/FScl_PersonImpl.cpp
102         src/FSclRelationship.cpp
103         src/FScl_RelationshipImpl.cpp
104         src/FScl_ContactDbConnector.cpp
105         src/FScl_ContactDbMonitor.cpp
106         src/FScl_ContactDbChangeEvent.cpp
107         src/FScl_ContactDbChangeEventArg.cpp
108         src/FSclAccount.cpp
109         src/FScl_AccountImpl.cpp
110         src/FSclAccountAccessor.cpp
111         src/FScl_AccountAccessorImpl.cpp
112         src/FSclAccountManager.cpp
113         src/FScl_AccountManagerImpl.cpp
114         src/FSclAccountProvider.cpp
115         src/FScl_AccountProviderImpl.cpp
116         src/FScl_AccountManagerUtil.cpp
117         src/FScl_AccountDbChangeEvent.cpp
118         src/FScl_AccountDbChangeEventArg.cpp
119         src/FScl_AccountDbConnector.cpp
120         src/FScl_AccountDbMonitor.cpp
121         src/FSclUserProfile.cpp
122         src/FScl_UserProfileImpl.cpp
123 )
124
125 SET(EXTRA_CFLAGS  "${EXTRA_CFLAGS} -Wall" )
126
127 ## SET C COMPILER FLAGS
128 SET(CMAKE_C_FLAGS "${OSP_DEBUG_FLAGS} ${OSP_OPT_FLAGS} ${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} ${OSP_COMPILER_FLAGS}")
129
130 ## SET CPP COMPILER FLAGS
131 SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden")
132 SET(CMAKE_CXX_FLAGS "${OSP_DEBUG_FLAGS} ${OSP_OPT_FLAGS} ${CMAKE_CXX_FLAGS} ${EXTRA_CFLAGS} ${OSP_COMPILER_FLAGS}")
133
134 ## Create Library
135 ADD_LIBRARY (${this_target} SHARED ${${this_target}_SOURCE_FILES})
136
137 ## SET LINKER FLAGS
138 SET(CMAKE_SHARED_LINKER_FLAGS -Wl,--no-undefined)
139
140 TARGET_LINK_LIBRARIES(${this_target} "-L/usr/lib/osp -losp-appfw" )
141 TARGET_LINK_LIBRARIES(${this_target} "-losp-image" )
142 TARGET_LINK_LIBRARIES(${this_target} "-losp-uifw" )
143 TARGET_LINK_LIBRARIES(${this_target} "-lglib-2.0" )
144 TARGET_LINK_LIBRARIES(${this_target} "-lcalendar-service2" )
145 TARGET_LINK_LIBRARIES(${this_target} "-lcontacts-service2" )
146 TARGET_LINK_LIBRARIES(${this_target} "-laccounts-svc" )
147 TARGET_LINK_LIBRARIES(${this_target} "-lpthread" )
148
149 SET_TARGET_PROPERTIES(${this_target} 
150         PROPERTIES 
151         VERSION ${FULLVER}
152         SOVERSION ${MAJORVER}
153         CLEAN_DIRECT_OUTPUT 1
154         )
155
156 ADD_CUSTOM_COMMAND(TARGET ${this_target}
157     POST_BUILD
158                 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} 
159                 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}
160                 COMMAND ${CMAKE_STRIP} --strip-unneeded ${LIBRARY_OUTPUT_PATH}/${CMAKE_SHARED_LIBRARY_PREFIX}${this_target}${CMAKE_SHARED_LIBRARY_SUFFIX}
161     COMMENT "strip ${this_target}"
162                 )   
163
164 INSTALL(DIRECTORY ${LIBRARY_OUTPUT_PATH}/ DESTINATION lib/osp 
165                                 FILES_MATCHING PATTERN "*.so*" 
166                                 PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ                                          
167                                                                                 GROUP_EXECUTE GROUP_READ
168                                                                                 WORLD_EXECUTE WORLD_READ)
169 INSTALL(DIRECTORY ${LIBRARY_OUTPUT_PATH}/debug/ DESTINATION lib/osp/debug 
170                                 FILES_MATCHING PATTERN "*.so*" 
171                                 PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ                                          
172                                                                                 GROUP_EXECUTE GROUP_READ
173                                                                                 WORLD_EXECUTE WORLD_READ)
174
175 INSTALL(DIRECTORY ${CMAKE_SOURCE_DIR}/inc/ DESTINATION include/osp FILES_MATCHING PATTERN "*.h")
176 INSTALL(DIRECTORY ${CMAKE_SOURCE_DIR}/src/inc/ DESTINATION include/osp/social FILES_MATCHING PATTERN "*.h")
177
178 SET(PC_NAME ${this_target})
179 SET(PC_REQUIRED ${pc_requires})
180 SET(PC_LDFLAGS -l${this_target})
181
182 # pkgconfig file
183 CONFIGURE_FILE(${this_target}.pc.in ${CMAKE_SOURCE_DIR}/${this_target}.pc @ONLY)
184 INSTALL(FILES ${CMAKE_SOURCE_DIR}/${this_target}.pc DESTINATION lib/pkgconfig)
185
186 # INCLUDE FOR BUILD & INSTALL PACKAGE MANAGER .SO
187 ADD_SUBDIRECTORY(pkgmgr_account)