add Ondownloadcomplete
[framework/osp/web.git] / CMakeLists.txt
1 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
2 SET(LIBRARY_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/cmake_build_tmp/output)
3 ADD_SUBDIRECTORY(src/controls/js-bridge-plugin-deprecated)
4 ADD_SUBDIRECTORY(src/controls/js-bridge-plugin-tizen)
5
6 SET (this_target osp-web)
7
8 INCLUDE_DIRECTORIES(
9         inc
10         src
11         src/controls
12         /usr/include/appfw
13         /usr/include/glib-2.0 
14         /usr/lib/glib-2.0/include
15         /usr/include/curl
16         /usr/include/dbus-1.0
17         /usr/lib/dbus-1.0/include
18         /usr/include/e_dbus-1
19         /usr/include/ecore-1
20         /usr/include/edje-1
21         /usr/include/eet-1
22         /usr/include/efreet-1
23         /usr/include/eina-1
24         /usr/include/eina-1/eina
25         /usr/include/elementary-1
26         /usr/include/ethumb-1
27         /usr/include/evas-1
28         /usr/include/ewebkit2-0
29         /usr/include/ewebkit2-0/WebKit2
30         /usr/include/libsoup-2.4
31         /usr/include/network
32         /usr/include/osp
33         /usr/include/osp/app
34         /usr/include/osp/base
35         /usr/include/osp/io
36         /usr/include/osp/net
37         /usr/include/osp/security
38         /usr/include/osp/system
39         /usr/include/osp/graphics
40         /usr/include/osp/content
41         /usr/include/osp/ui
42         /usr/include/web
43         /usr/include/vconf
44         /usr/include/media-content
45         )
46
47 SET (${this_target}_SOURCE_FILES
48         src/FWebHistoryItem.cpp
49         src/FWeb_HistoryItemImpl.cpp
50         src/FWebWebHistory.cpp
51         src/FWeb_WebHistoryImpl.cpp
52         src/FWebBookmarkItem.cpp
53         src/FWeb_BookmarkItemImpl.cpp
54         src/FWebWebBookmark.cpp
55         src/FWeb_WebBookmarkImpl.cpp
56         src/controls/FWebCtrlWeb.cpp
57         src/controls/FWebCtrl_WebImpl.cpp
58         src/controls/FWebCtrl_AuthConfirmPopup.cpp
59         src/controls/FWebCtrl_Web.cpp
60         src/controls/FWebCtrl_EflWebkit.cpp
61         src/controls/FWebCtrl_WebEventArg.cpp
62         src/controls/FWebCtrl_WebEvent.cpp
63         src/controls/FWebCtrlPageNavigationList.cpp
64         src/controls/FWebCtrl_PageNavigationListImpl.cpp
65         src/controls/FWebCtrlWebSetting.cpp
66         src/controls/FWebCtrl_WebSettingImpl.cpp
67         src/controls/FWebCtrlHitElementResult.cpp
68         src/controls/FWebCtrl_HitElementResultImpl.cpp
69         src/controls/FWebCtrl_SelectBox.cpp
70         src/controls/FWebCtrlAuthenticationChallenge.cpp
71         src/controls/FWebCtrl_AuthenticationChallengeImpl.cpp
72         src/controls/FWebCtrl_WebMaker.cpp
73         src/controls/FWebCtrl_AppControlListener.cpp
74         src/controls/FWebCtrl_WebPresenter.cpp
75         src/controls/FWebCtrl_PromptPopup.cpp
76         src/controls/FWebCtrl_Utility.cpp
77         src/controls/FWebCtrl_GestureState.cpp
78         src/controls/FWebCtrl_WebDataHandler.cpp
79         src/controls/FWebCtrlGeolocationPermissionManager.cpp
80         src/controls/FWebCtrl_GeolocationPermissionManagerImpl.cpp
81         src/controls/FWebCtrl_InputPickerPopup.cpp
82         src/controls/FWebCtrl_UserConfirmPopup.cpp
83         src/controls/FWebCtrl_WebPopup.cpp
84         src/controls/FWebCtrl_CertificateConfirmPopup.cpp
85         src/controls/FWebCtrlWebStorageManager.cpp
86         src/controls/FWebCtrl_WebStorageManagerImpl.cpp
87         src/controls/FWebCtrl_WebNotification.cpp
88         src/controls/FWebCtrl_WebNotificationHandler.cpp
89         src/controls/FWebCtrl_FormDataWindow.cpp
90 )
91 ## Add Definitions
92 ADD_DEFINITIONS(${OSP_DEFINITIONS} -D_MODEL_RES_WVGA)
93
94 SET(EXTRA_CFLAGS  "${EXTRA_CFLAGS} -Wall" )
95
96 ## SET C COMPILER FLAGS
97 SET(CMAKE_C_FLAGS "${OSP_DEBUG_FLAGS} ${OSP_OPT_FLAGS} ${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} ${OSP_COMPILER_FLAGS}")
98
99 ## SET CPP COMPILER FLAGS
100 SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden")
101 SET(CMAKE_CXX_FLAGS "${OSP_DEBUG_FLAGS} ${OSP_OPT_FLAGS} ${CMAKE_CXX_FLAGS} ${EXTRA_CFLAGS} ${OSP_COMPILER_FLAGS}")
102
103 ## Create Library
104 ADD_LIBRARY (${this_target} SHARED ${${this_target}_SOURCE_FILES})
105
106 ## SET LINKER FLAGS
107 SET(CMAKE_SHARED_LINKER_FLAGS -Wl,--no-undefined)
108
109 TARGET_LINK_LIBRARIES(${this_target} "-L/usr/lib/osp -losp-appfw" )
110 TARGET_LINK_LIBRARIES(${this_target} "-losp-content" )
111 TARGET_LINK_LIBRARIES(${this_target} "-losp-json" )
112 TARGET_LINK_LIBRARIES(${this_target} "-losp-uifw" )
113 TARGET_LINK_LIBRARIES(${this_target} "-losp-image" )
114 TARGET_LINK_LIBRARIES(${this_target} "-losp-media" )
115 TARGET_LINK_LIBRARIES(${this_target} "-losp-net" )
116 TARGET_LINK_LIBRARIES(${this_target} "-lecore" )
117 TARGET_LINK_LIBRARIES(${this_target} "-lecore_imf" ) 
118 TARGET_LINK_LIBRARIES(${this_target} "-lecore_imf_evas" )
119 TARGET_LINK_LIBRARIES(${this_target} "-lelementary" )
120 TARGET_LINK_LIBRARIES(${this_target} "-levas" )
121 TARGET_LINK_LIBRARIES(${this_target} "-leina" )
122 TARGET_LINK_LIBRARIES(${this_target} "-lewebkit2" )
123 TARGET_LINK_LIBRARIES(${this_target} "-lcapi-web-favorites" )
124 TARGET_LINK_LIBRARIES(${this_target} "-lcapi-network-connection" )
125 TARGET_LINK_LIBRARIES(${this_target} "-lcapi-content-media-content")
126 TARGET_LINK_LIBRARIES(${this_target} "-lpthread" )
127 TARGET_LINK_LIBRARIES(${this_target} "-lvconf" )
128
129 SET_TARGET_PROPERTIES(${this_target} 
130         PROPERTIES 
131         VERSION ${FULLVER}
132         SOVERSION ${MAJORVER}
133         CLEAN_DIRECT_OUTPUT 1
134         )
135
136 ADD_CUSTOM_COMMAND(TARGET ${this_target}
137     POST_BUILD
138                 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} 
139                 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}
140                 COMMAND ${CMAKE_STRIP} --strip-unneeded ${LIBRARY_OUTPUT_PATH}/${CMAKE_SHARED_LIBRARY_PREFIX}${this_target}${CMAKE_SHARED_LIBRARY_SUFFIX}
141     COMMENT "strip ${this_target}"
142                 )   
143
144 INSTALL(DIRECTORY ${LIBRARY_OUTPUT_PATH}/ DESTINATION lib/osp 
145                                 FILES_MATCHING PATTERN "libosp-*" 
146                                 PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ                                          
147                                                                                 GROUP_EXECUTE GROUP_READ
148                                                                                 WORLD_EXECUTE WORLD_READ)
149 INSTALL(DIRECTORY ${LIBRARY_OUTPUT_PATH}/ DESTINATION lib/osp/browser-plugin 
150                                 FILES_MATCHING PATTERN "libweb-*" 
151                                 PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ                                          
152                                                                                 GROUP_EXECUTE GROUP_READ
153                                                                                 WORLD_EXECUTE WORLD_READ)
154                                                                                 
155 INSTALL(DIRECTORY ${LIBRARY_OUTPUT_PATH}/debug/ DESTINATION lib/osp/debug 
156                                 FILES_MATCHING PATTERN "libosp-*" 
157                                 PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ                                          
158                                                                                 GROUP_EXECUTE GROUP_READ
159                                                                                 WORLD_EXECUTE WORLD_READ)
160 INSTALL(DIRECTORY ${LIBRARY_OUTPUT_PATH}/debug/ DESTINATION lib/osp/browser-plugin/debug 
161                                 FILES_MATCHING PATTERN "libweb-*"
162                                 PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ                                          
163                                                                                 GROUP_EXECUTE GROUP_READ
164                                                                                 WORLD_EXECUTE WORLD_READ)
165
166
167 INSTALL(DIRECTORY ${CMAKE_SOURCE_DIR}/inc/ DESTINATION include/osp FILES_MATCHING PATTERN "*.h")
168
169 # pkgconfig file
170 CONFIGURE_FILE(${this_target}.pc.in ${CMAKE_SOURCE_DIR}/${this_target}.pc @ONLY)
171 INSTALL(FILES ${CMAKE_SOURCE_DIR}/${this_target}.pc DESTINATION lib/pkgconfig)
172