1 CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
2 PROJECT(wrt-plugins-tizen)
4 # -----------------------------------------------------------------------------
5 # Required platform modules
6 # -----------------------------------------------------------------------------
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)
18 ${webkit2_INCLUDE_DIRS}
20 ${wrt-plugins-types_INCLUDE_DIRS}
21 ${wrt-deviceapis-commons_INCLUDE_DIRS}
22 ${wrt-deviceapis-commons-javascript_INCLUDE_DIRS}
25 # -----------------------------------------------------------------------------
26 # Determine the log option
27 # -----------------------------------------------------------------------------
29 OPTION(DPL_LOG "DPL logs status" ON)
32 MESSAGE(STATUS "Logging enabled for DPL")
33 ADD_DEFINITIONS("-DDPL_LOGS_ENABLED")
35 MESSAGE(STATUS "Logging disabled for DPL")
38 # -----------------------------------------------------------------------------
39 # Determine the time tracing option
40 # -----------------------------------------------------------------------------
42 OPTION(ENABLE_TIME_TRACER "TIME TRACING" OFF)
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)
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 "")
58 MESSAGE("Build type: ${CMAKE_BUILD_TYPE}")
60 # -----------------------------------------------------------------------------
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")
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})
85 # -----------------------------------------------------------------------------
87 # -----------------------------------------------------------------------------
89 SET(DESTINATION_LIB_PREFIX lib/wrt-plugins)
91 SET(DESTINATION_HEADER_PREFIX include/${PROJECT_NAME})
93 SET(TOP ${CMAKE_SOURCE_DIR}/src)
95 SET(INCLUDE_COMMON ${TOP}/Common ${TOP}/Common/TimeTracer)
101 ${wrt-deviceapis-commons_LDFLAGS}
102 ${wrt-deviceapis-commons-javascript_LDFLAGS}
105 SET(CMAKE_INSTALL_RPATH ${wrt-deviceapis-commons_LIBRARY_DIRS})
107 SET(LIBS_WIDGETDB ${wrt-plugins-widgetdb_LIBRARIES})
109 # -----------------------------------------------------------------------------
110 # Macros for pkgconfig
111 # -----------------------------------------------------------------------------
112 SET(PKGCONFIG_DIR ${CMAKE_SOURCE_DIR}/pkgconfigs)
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)
120 # -----------------------------------------------------------------------------
121 # Functions used for plugins
122 # -----------------------------------------------------------------------------
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)
134 FUNCTION(add_subdir NAME)
135 MESSAGE(STATUS "Building: ${CMAKE_CURRENT_SOURCE_DIR}/${NAME}")
136 ADD_SUBDIRECTORY(${NAME})
141 FOREACH(VALUE ${ARGN})
144 FOREACH(VALUE ${ARGN})
149 ADD_SUBDIRECTORY(src)