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