Fix memory leak
[platform/framework/web/wrt.git] / src / CMakeLists.txt
1 # Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
2 #
3 #    Licensed under the Apache License, Version 2.0 (the "License");
4 #    you may not use this file except in compliance with the License.
5 #    You may obtain a copy of the License at
6 #
7 #        http://www.apache.org/licenses/LICENSE-2.0
8 #
9 #    Unless required by applicable law or agreed to in writing, software
10 #    distributed under the License is distributed on an "AS IS" BASIS,
11 #    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 #    See the License for the specific language governing permissions and
13 #    limitations under the License.
14 #
15
16 # @file     CMakeLists.txt
17 # @author   Lukasz Wrzosek (l.wrzosek@samsung.com)
18 # @version     1.0
19 #
20
21 #it is here, so no INCLUDE_DIRS and DEFINITIONS are passed there
22 ADD_SUBDIRECTORY(view)
23
24
25 SET(WRT_SRC_DIR
26    ${PROJECT_SOURCE_DIR}/src
27    )
28
29 SET(WRT_CORE_BASE_SOURCES
30     ${WRT_SRC_DIR}/domain/widget_data_types.cpp
31     ${WRT_SRC_DIR}/domain/widget_deserialize_model.cpp
32     ${WRT_SRC_DIR}/domain/localization_setting.cpp
33     ${WRT_SRC_DIR}/domain/widget_model.cpp
34     ${WRT_SRC_DIR}/domain/main_thread.cpp
35     ${WRT_SRC_DIR}/domain/prepare_external_storage.cpp
36     )
37
38 SET(WRT_CORE_INCLUDES
39     ${WRT_SRC_DIR}/plugin-service
40     ${WRT_SRC_DIR}/domain
41     ${WRT_SRC_DIR}/profiling
42     ${WRT_SRC_DIR}/view
43     )
44
45 SET(WRT_PLUGIN_LOADING_DIR
46     ${WRT_SRC_DIR}/plugin-service/plugin-loading/
47    )
48
49
50 SET(PLUGIN_LOADING_INCLUDES
51   ${WRT_PLUGIN_LOADING_DIR}
52 )
53
54 SET(WRT_BASIC_DEP
55     dpl-efl
56     dpl-dbus-efl
57     dpl-event-efl
58     dpl-utils-efl
59     wrt-popup-ace-runner
60     security-core
61     security-client
62 )
63
64 IF(X11_SUPPORT)
65 SET(SYS_WRT_BASIC_DEP
66     openssl
67     libpcrecpp
68     glib-2.0
69     gthread-2.0
70     libsoup-2.4
71     libiri
72     appsvc
73     cert-svc-vcore
74     edje
75     ecore
76     ecore-x
77     evas
78     eina
79     ewebkit2
80     elementary
81     vconf
82     cert-svc
83     ui-gadget-1
84     secure-storage
85     app2sd
86 )
87 ELSE(X11_SUPPORT)
88 SET(SYS_WRT_BASIC_DEP
89     openssl
90     libpcrecpp
91     glib-2.0
92     gthread-2.0
93     libsoup-2.4
94     libiri
95     appsvc
96     cert-svc-vcore
97     edje
98     ecore
99     ecore-wayland
100     evas
101     eina
102     ewebkit2
103     elementary
104     vconf
105     cert-svc
106     ui-gadget-1
107     secure-storage
108     app2sd
109 )
110 ENDIF(X11_SUPPORT)
111
112 IF(SMACK_ENABLED)
113   LIST(APPEND SYS_WRT_BASIC_DEP libprivilege-control)
114 ENDIF(SMACK_ENABLED)
115
116
117
118 PKG_CHECK_MODULES(SYS_WRT_ENGINE_DEPS
119     ${SYS_WRT_BASIC_DEP}
120     REQUIRED
121 )
122
123 PKG_CHECK_MODULES(WRT_ENGINE_DEPS
124     ${WRT_BASIC_DEP}
125     REQUIRED
126 )
127
128 SET(WRT_ENGINE_INCLUDE_DIRS
129     ${WRT_CORE_INCLUDES}
130     ${PLUGIN_LOADING_INCLUDES}
131     ${WRT_ENGINE_DEPS_INCLUDE_DIRS}
132 )
133
134 #wrt-engine-static
135 ADD_DEFINITIONS(${SYS_WRT_ENGINE_DEPS_CFLAGS})
136 ADD_DEFINITIONS(${SYS_WRT_ENGINE_DEPS_CFLAGS_OTHER})
137 ADD_DEFINITIONS(${WRT_ENGINE_DEPS_CFLAGS})
138 ADD_DEFINITIONS(${WRT_ENGINE_DEPS_CFLAGS_OTHER})
139
140 INCLUDE_DIRECTORIES(SYSTEM ${SYS_WRT_ENGINE_DEPS_INCLUDE_DIRS})
141 INCLUDE_DIRECTORIES(${WRT_ENGINE_INCLUDE_DIRS})
142
143 ADD_LIBRARY(${TARGET_WRT_ENGINE_STATIC} STATIC
144     ${WRT_CORE_BASE_SOURCES}
145 )
146
147 SET_TARGET_PROPERTIES(${TARGET_WRT_ENGINE_STATIC} PROPERTIES
148     SOVERSION ${PROJECT_API_VERSION}
149     VERSION ${PROJECT_VERSION})
150
151 SET_TARGET_PROPERTIES(${TARGET_WRT_ENGINE_STATIC} PROPERTIES
152     COMPILE_FLAGS -fPIC)
153 SET_TARGET_PROPERTIES(${TARGET_WRT_ENGINE_STATIC} PROPERTIES
154     COMPILE_FLAGS "-include profiling_util.h")
155
156 TARGET_LINK_LIBRARIES(${TARGET_WRT_ENGINE_STATIC}
157     ${TARGET_WRT_DAO_RW_LIB}
158     ${PROF_LIB}
159     )
160
161 INSTALL(FILES
162     ${WRT_SRC_DIR}/domain/widget_model.h
163     DESTINATION include/${PROJECT_NAME}
164 )
165
166 INSTALL(FILES
167     ${WRT_SRC_DIR}/domain/widget_data_types.h
168     DESTINATION include/${PROJECT_NAME}
169 )
170
171 ADD_SUBDIRECTORY(api_new)
172 ADD_SUBDIRECTORY(wrt-client)
173 ADD_SUBDIRECTORY(wrt-launcher)
174 ADD_SUBDIRECTORY(plugin-service)
175 IF(PROFILING)
176     ADD_SUBDIRECTORY(profiling)
177 ENDIF(PROFILING)
178 ADD_SUBDIRECTORY(wrt-launchpad-daemon)