Update change log and spec for wrt-plugins-tizen_0.4.21
[platform/framework/web/wrt-plugins-tizen.git] / CMakeLists.txt
1 CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
2 PROJECT(wrt-plugins-tizen)
3
4 # -----------------------------------------------------------------------------
5 # Required platform modules
6 # -----------------------------------------------------------------------------
7 INCLUDE(FindPkgConfig)
8
9 PKG_CHECK_MODULES(webkit2 REQUIRED ewebkit2)
10 PKG_CHECK_MODULES(dpl REQUIRED dpl-efl)
11 PKG_CHECK_MODULES(dpl-event REQUIRED dpl-event-efl)
12 PKG_CHECK_MODULES(wrt-plugins-types REQUIRED wrt-plugins-types)
13 PKG_CHECK_MODULES(wrt-deviceapis-commons REQUIRED wrt-plugins-commons)
14 PKG_CHECK_MODULES(wrt-deviceapis-commons-javascript REQUIRED wrt-plugins-commons-javascript)
15 PKG_CHECK_MODULES(wrt-plugins-widgetdb REQUIRED wrt-plugins-widgetdb)
16
17 INCLUDE_DIRECTORIES(
18   ${webkit2_INCLUDE_DIRS}
19   ${dpl_INCLUDE_DIRS}
20   ${wrt-plugins-types_INCLUDE_DIRS}
21   ${wrt-deviceapis-commons_INCLUDE_DIRS}
22   ${wrt-deviceapis-commons-javascript_INCLUDE_DIRS}
23 )
24
25 # -----------------------------------------------------------------------------
26 # Determine the log option
27 # -----------------------------------------------------------------------------
28
29 OPTION(DPL_LOG "DPL logs status" ON)
30
31 IF(DPL_LOG)
32     MESSAGE(STATUS "Logging enabled for DPL")
33     ADD_DEFINITIONS("-DDPL_LOGS_ENABLED")
34 ELSE(DPL_LOG)
35     MESSAGE(STATUS "Logging disabled for DPL")
36 ENDIF(DPL_LOG)
37
38 # -----------------------------------------------------------------------------
39 # Determine the time tracing option
40 # -----------------------------------------------------------------------------
41
42 OPTION(ENABLE_TIME_TRACER "TIME TRACING" OFF)
43
44 IF(ENABLE_TIME_TRACER)
45     MESSAGE(STATUS "Time tracer enabled")
46     ADD_DEFINITIONS("-DENABLE_TIME_TRACER")
47 ELSE(ENABLE_TIME_TRACER)
48     MESSAGE(STATUS "Time tracer disabled")
49 ENDIF(ENABLE_TIME_TRACER)
50
51 # -----------------------------------------------------------------------------
52 # Set build type (Release by default)
53 # -----------------------------------------------------------------------------
54 IF("${CMAKE_BUILD_TYPE}" STREQUAL "")
55      SET(CMAKE_BUILD_TYPE Release)
56 ENDIF("${CMAKE_BUILD_TYPE}" STREQUAL "")
57
58 MESSAGE("Build type: ${CMAKE_BUILD_TYPE}")
59
60 # -----------------------------------------------------------------------------
61 # CFlags
62 # -----------------------------------------------------------------------------
63 SET(CMAKE_C_FLAGS_PROFILING    "-O0 -g -pg")
64 SET(CMAKE_CXX_FLAGS_PROFILING  "-O0 -std=c++0x -g -pg")
65 SET(CMAKE_C_FLAGS_DEBUG        "-O0 -g")
66 SET(CMAKE_CXX_FLAGS_DEBUG      "-O0 -std=c++0x -g")
67 SET(CMAKE_C_FLAGS_RELEASE      "-O2 -g")
68 SET(CMAKE_CXX_FLAGS_RELEASE    "-O2 -std=c++0x -g")
69 ADD_DEFINITIONS("-DCLIENT_IPC_THREAD")
70 ADD_DEFINITIONS("-DEXPORT_API=")
71 ADD_DEFINITIONS("-Wall")
72 ADD_DEFINITIONS("-D_FILE_OFFSET_BITS=64")
73 #ADD_DEFINITIONS("-Werror")
74 #ADD_DEFINITIONS("-Wextra")
75 ADD_DEFINITIONS("-DAPPLICATION_API_BACKWARD_COMPATIBILITY")
76
77
78 # -----------------------------------------------------------------------------
79 # Schema of plugin's configuration file
80 # -----------------------------------------------------------------------------
81 SET(COMMON_CONFIG_DTD ${CMAKE_CURRENT_SOURCE_DIR}/config.dtd)
82 SET(COMMON_CONFIG_DTD_DST /usr/etc/tizen-apis)
83 INSTALL(FILES ${COMMON_CONFIG_DTD} DESTINATION ${COMMON_CONFIG_DTD_DST})
84
85 # -----------------------------------------------------------------------------
86 # Global variables
87 # -----------------------------------------------------------------------------
88
89 SET(DESTINATION_LIB_PREFIX lib/wrt-plugins)
90
91 SET(DESTINATION_HEADER_PREFIX include/${PROJECT_NAME})
92
93 SET(TOP ${CMAKE_SOURCE_DIR}/src)
94
95 SET(INCLUDE_COMMON ${TOP}/Common ${TOP}/Common/TimeTracer)
96
97 SET(LIBS_COMMON
98     ${dpl_LDFLAGS}
99     ${dpl-event_LDFLAGS}
100     ${webkit2_LDFLAGS}
101     ${wrt-deviceapis-commons_LDFLAGS}
102     ${wrt-deviceapis-commons-javascript_LDFLAGS}
103 )
104
105 SET(CMAKE_INSTALL_RPATH ${wrt-deviceapis-commons_LIBRARY_DIRS})
106
107 SET(LIBS_WIDGETDB ${wrt-plugins-widgetdb_LIBRARIES})
108
109 # -----------------------------------------------------------------------------
110 # Macros for pkgconfig
111 # -----------------------------------------------------------------------------
112 SET(PKGCONFIG_DIR ${CMAKE_SOURCE_DIR}/pkgconfigs)
113
114 MACRO(configure_and_install_pkg PKG_FILE)
115     CONFIGURE_FILE(${PKGCONFIG_DIR}/${PKG_FILE}.in
116                ${PKGCONFIG_DIR}/${PKG_FILE} @ONLY)
117     INSTALL(FILES ${PKGCONFIG_DIR}/${PKG_FILE} DESTINATION lib/pkgconfig)
118 ENDMACRO(configure_and_install_pkg)
119
120 # -----------------------------------------------------------------------------
121 # Functions used for plugins
122 # -----------------------------------------------------------------------------
123
124 FUNCTION(set_target NAME)
125   STRING(TOLOWER ${NAME} LOWER_NAME)
126   SET(${LOWER_NAME}_dest tizen-${LOWER_NAME} PARENT_SCOPE)
127   SET(${LOWER_NAME}_target wrt-plugins-tizen-${LOWER_NAME} PARENT_SCOPE)
128   SET(${LOWER_NAME}_impl wrt-plugins-tizen-${LOWER_NAME}-impl PARENT_SCOPE)
129   SET(${LOWER_NAME}_config wrt-plugins-tizen-${LOWER_NAME}-config PARENT_SCOPE)
130   configure_and_install_pkg(wrt-plugins-tizen-${LOWER_NAME}.pc)
131 ENDFUNCTION()
132
133
134 FUNCTION(add_subdir NAME)
135   MESSAGE(STATUS "Building: ${CMAKE_CURRENT_SOURCE_DIR}/${NAME}")
136   ADD_SUBDIRECTORY(${NAME})
137 ENDFUNCTION()
138
139
140 FUNCTION(add_plugin)
141   FOREACH(VALUE ${ARGN})
142     set_target(${VALUE})
143   ENDFOREACH(VALUE)
144   FOREACH(VALUE ${ARGN})
145       add_subdir(${VALUE})
146   ENDFOREACH(VALUE)
147 ENDFUNCTION()
148
149 ADD_SUBDIRECTORY(src)