1 CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
2 PROJECT(wrt-plugins-tizen)
4 # -----------------------------------------------------------------------------
5 # Required platform modules
6 # -----------------------------------------------------------------------------
9 PKG_SEARCH_MODULE(webkit2 REQUIRED ewebkit2)
10 PKG_SEARCH_MODULE(dpl REQUIRED dpl-efl)
11 PKG_SEARCH_MODULE(dpl-event REQUIRED dpl-event-efl)
12 PKG_SEARCH_MODULE(wrt-plugins-types REQUIRED wrt-plugins-types)
13 PKG_SEARCH_MODULE(wrt-deviceapis-commons REQUIRED wrt-plugins-commons)
14 PKG_SEARCH_MODULE(wrt-deviceapis-commons-javascript REQUIRED wrt-plugins-commons-javascript)
15 PKG_SEARCH_MODULE(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 # Set build type (Release by default)
40 # -----------------------------------------------------------------------------
41 IF("${CMAKE_BUILD_TYPE}" STREQUAL "")
42 SET(CMAKE_BUILD_TYPE Release)
43 ENDIF("${CMAKE_BUILD_TYPE}" STREQUAL "")
45 MESSAGE("Build type: ${CMAKE_BUILD_TYPE}")
47 # -----------------------------------------------------------------------------
49 # -----------------------------------------------------------------------------
50 SET(CMAKE_C_FLAGS_PROFILING "-O0 -g -pg")
51 SET(CMAKE_CXX_FLAGS_PROFILING "-O0 -std=c++0x -g -pg")
52 SET(CMAKE_C_FLAGS_DEBUG "-O0 -g")
53 SET(CMAKE_CXX_FLAGS_DEBUG "-O0 -std=c++0x -g")
54 SET(CMAKE_C_FLAGS_RELEASE "-O2 -g")
55 SET(CMAKE_CXX_FLAGS_RELEASE "-O2 -std=c++0x -g")
56 ADD_DEFINITIONS("-DCLIENT_IPC_THREAD")
57 ADD_DEFINITIONS("-DEXPORT_API=")
58 ADD_DEFINITIONS("-Wall")
59 #ADD_DEFINITIONS("-Werror")
60 #ADD_DEFINITIONS("-Wextra")
61 ADD_DEFINITIONS("-DAPPLICATION_API_BACKWARD_COMPATIBILITY")
64 # -----------------------------------------------------------------------------
65 # Schema of plugin's configuration file
66 # -----------------------------------------------------------------------------
67 SET(COMMON_CONFIG_DTD ${CMAKE_CURRENT_SOURCE_DIR}/config.dtd)
68 SET(COMMON_CONFIG_DTD_DST /usr/etc/tizen-apis)
69 INSTALL(FILES ${COMMON_CONFIG_DTD} DESTINATION ${COMMON_CONFIG_DTD_DST})
71 # -----------------------------------------------------------------------------
73 # -----------------------------------------------------------------------------
75 SET(DESTINATION_LIB_PREFIX lib/wrt-plugins)
77 SET(DESTINATION_HEADER_PREFIX include/${PROJECT_NAME})
79 SET(TOP ${CMAKE_SOURCE_DIR}/src)
85 ${wrt-deviceapis-commons_LDFLAGS}
86 ${wrt-deviceapis-commons-javascript_LDFLAGS}
89 SET(CMAKE_INSTALL_RPATH ${wrt-deviceapis-commons_LIBRARY_DIRS})
91 SET(LIBS_WIDGETDB ${wrt-plugins-widgetdb_LIBRARIES})
93 # -----------------------------------------------------------------------------
94 # Macros for pkgconfig
95 # -----------------------------------------------------------------------------
96 SET(PKGCONFIG_DIR ${CMAKE_SOURCE_DIR}/pkgconfigs)
98 MACRO(configure_and_install_pkg PKG_FILE)
99 CONFIGURE_FILE(${PKGCONFIG_DIR}/${PKG_FILE}.in
100 ${PKGCONFIG_DIR}/${PKG_FILE} @ONLY)
101 INSTALL(FILES ${PKGCONFIG_DIR}/${PKG_FILE} DESTINATION lib/pkgconfig)
102 ENDMACRO(configure_and_install_pkg)
104 # -----------------------------------------------------------------------------
105 # Functions used for plugins
106 # -----------------------------------------------------------------------------
108 FUNCTION(set_target NAME)
109 STRING(TOLOWER ${NAME} LOWER_NAME)
110 SET(${LOWER_NAME}_dest tizen-${LOWER_NAME} PARENT_SCOPE)
111 SET(${LOWER_NAME}_target wrt-plugins-tizen-${LOWER_NAME} PARENT_SCOPE)
112 SET(${LOWER_NAME}_impl wrt-plugins-tizen-${LOWER_NAME}-impl PARENT_SCOPE)
113 SET(${LOWER_NAME}_config wrt-plugins-tizen-${LOWER_NAME}-config PARENT_SCOPE)
114 configure_and_install_pkg(wrt-plugins-tizen-${LOWER_NAME}.pc)
118 FUNCTION(add_subdir NAME)
119 MESSAGE(STATUS "Building: ${CMAKE_CURRENT_SOURCE_DIR}/${NAME}")
120 ADD_SUBDIRECTORY(${NAME})
125 FOREACH(VALUE ${ARGN})
128 FOREACH(VALUE ${ARGN})
133 ADD_SUBDIRECTORY(src)