tizen 2.4 release
[framework/web/wrt-plugins-common.git] / src / Commons / 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 MACRO(install_header_file HEADER_FILE)
16     INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${HEADER_FILE}
17         DESTINATION ${DESTINATION_HEADERS_NON_JS})
18 ENDMACRO()
19
20 MACRO(install_wrtaccess_header_file HEADER_FILE)
21     INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${HEADER_FILE}
22         DESTINATION ${DESTINATION_HEADERS_NON_JS}/WrtAccess)
23 ENDMACRO()
24
25 MACRO(install_widget_interface_header_file HEADER_FILE)
26     INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${HEADER_FILE}
27         DESTINATION ${DESTINATION_HEADERS_NON_JS}/WidgetInterface)
28 ENDMACRO()
29
30 INCLUDE_CONFIG_FILE(WrtAccess)
31
32 PKG_SEARCH_MODULE(plugin-types REQUIRED wrt-plugins-types)
33 PKG_SEARCH_MODULE(dpl-event REQUIRED dpl-event-efl)
34 PKG_SEARCH_MODULE(icu REQUIRED icu-i18n)
35 PKG_SEARCH_MODULE(pcrecpp REQUIRED libpcrecpp)
36
37 SET(WRT_COMMONS_DEPENDECIES_INCLUDES
38     ${wrt-plugin-api_INCLUDE_DIRS}
39     ${ace-client_INCLUDE_DIRS}
40     ${plugin-types_INCLUDE_DIRS}
41     ${icu_INCLUDE_DIRS}
42     )
43
44 INCLUDE_DIRECTORIES(${WRT_COMMONS_DEPENDECIES_INCLUDES})
45
46 SET(TARGET_NAME ${TARGET_COMMONS})
47
48 SET(SRCS
49   ${SRCS_WRT_ACCESS}
50   ${CMAKE_CURRENT_SOURCE_DIR}/Base64.cpp
51   ${CMAKE_CURRENT_SOURCE_DIR}/FunctionDefinition.cpp
52   ${CMAKE_CURRENT_SOURCE_DIR}/Regex.cpp
53   ${CMAKE_CURRENT_SOURCE_DIR}/RegexUtils.cpp
54   ${CMAKE_CURRENT_SOURCE_DIR}/StringBuilder.cpp
55   ${CMAKE_CURRENT_SOURCE_DIR}/StringUtils.cpp
56   ${CMAKE_CURRENT_SOURCE_DIR}/ThreadPool.cpp
57   ${CMAKE_CURRENT_SOURCE_DIR}/JSObjectDeclaration.cpp
58   ${CMAKE_CURRENT_SOURCE_DIR}/JSObject.cpp
59   #PARENT_SCOPE
60 )
61
62 ADD_LIBRARY(${TARGET_NAME} SHARED ${SRCS})
63 TARGET_LINK_LIBRARIES(${TARGET_NAME}
64   ${LIBS_COMMONS}
65   ${ace-client_LIBRARIES}
66   ${dpl-event_LIBRARIES}
67   ${icu_LIBRARIES}
68   ${pcrecpp_LIBRARIES}
69   ${TARGET_POPUP_ACE_RUNNER_LIB}
70 )
71
72 SET_TARGET_PROPERTIES(${TARGET_NAME} PROPERTIES
73     COMPILE_DEFINITIONS LOG_TAG="${LOG_TAG}")
74
75 SET_TARGET_PROPERTIES(${TARGET_NAME} PROPERTIES
76  SOVERSION ${CMAKE_PROJECT_API_VERSION}
77  VERSION ${CMAKE_PROJECT_VERSION}
78 )
79
80 INSTALL(TARGETS ${TARGET_NAME} LIBRARY DESTINATION ${DESTINATION_LIB_PREFIX})
81
82 INSTALL_HEADER_FILE(FunctionDeclaration.h)
83 INSTALL_HEADER_FILE(FunctionDefinition.h)
84 INSTALL_HEADER_FILE(Base64.h)
85 INSTALL_HEADER_FILE(Dimension.h)
86 INSTALL_HEADER_FILE(Emitters.h)
87 INSTALL_HEADER_FILE(EventListener.h)
88 INSTALL_HEADER_FILE(EventReceiver.h)
89 INSTALL_HEADER_FILE(Exception.h)
90 INSTALL_HEADER_FILE(IEvent.h)
91 INSTALL_HEADER_FILE(IExternEventCanceler.h)
92 INSTALL_HEADER_FILE(ListenerEventEmitter.h)
93 INSTALL_HEADER_FILE(ListenerEvent.h)
94 INSTALL_HEADER_FILE(Range.h)
95 INSTALL_HEADER_FILE(Regex.h)
96 INSTALL_HEADER_FILE(RegexPatterns.h)
97 INSTALL_HEADER_FILE(RegexUtils.h)
98 INSTALL_HEADER_FILE(StaticAssert.h)
99 INSTALL_HEADER_FILE(StringBuilder.h)
100 INSTALL_HEADER_FILE(StringUtils.h)
101 INSTALL_HEADER_FILE(ThreadPool.h)
102 INSTALL_HEADER_FILE(TypesDeclaration.h)
103 INSTALL_HEADER_FILE(TypeTraits.h)
104 INSTALL_HEADER_FILE(plugin_initializer_def.h)
105 INSTALL_HEADER_FILE(JSObjectDeclaration.h)
106 INSTALL_HEADER_FILE(JSObject.h)
107 INSTALL_WRTACCESS_HEADER_FILE(WrtAccess/WrtAccess.h)