diff options
Diffstat (limited to 'CMakeLists.txt')
-rwxr-xr-x | CMakeLists.txt | 199 |
1 files changed, 199 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100755 index 0000000..7a94d4a --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,199 @@ +CMAKE_MINIMUM_REQUIRED(VERSION 2.8) +PROJECT(wrt-plugins-tizen) + +# ----------------------------------------------------------------------------- +# Required platform modules +# ----------------------------------------------------------------------------- +INCLUDE(FindPkgConfig) + +PKG_CHECK_MODULES(webkit2 REQUIRED ewebkit2) +PKG_CHECK_MODULES(dpl REQUIRED dpl-efl) +PKG_CHECK_MODULES(dpl-event REQUIRED dpl-event-efl) +PKG_CHECK_MODULES(wrt-plugins-types REQUIRED wrt-plugins-types) +PKG_CHECK_MODULES(wrt-deviceapis-commons REQUIRED wrt-plugins-commons) +PKG_CHECK_MODULES(wrt-deviceapis-commons-javascript REQUIRED wrt-plugins-commons-javascript) +PKG_CHECK_MODULES(wrt-plugins-widgetdb REQUIRED wrt-plugins-widgetdb) +PKG_CHECK_MODULES(glib-2.0 REQUIRED glib-2.0) + + +INCLUDE_DIRECTORIES( + ${webkit2_INCLUDE_DIRS} + ${dpl_INCLUDE_DIRS} + ${wrt-plugins-types_INCLUDE_DIRS} + ${wrt-deviceapis-commons_INCLUDE_DIRS} + ${wrt-deviceapis-commons-javascript_INCLUDE_DIRS} +) + +# ----------------------------------------------------------------------------- +# Determine the log option +# ----------------------------------------------------------------------------- + +OPTION(DPL_LOG "DPL logs status" OFF) + +IF(DPL_LOG) + MESSAGE(STATUS "Logging enabled for DPL") + ADD_DEFINITIONS("-DDPL_LOGS_ENABLED") +ELSE(DPL_LOG) + MESSAGE(STATUS "Logging disabled for DPL") +ENDIF(DPL_LOG) + +# ----------------------------------------------------------------------------- +# Determine the time tracing option +# ----------------------------------------------------------------------------- + +OPTION(ENABLE_TIME_TRACER "TIME TRACING" OFF) + +IF(ENABLE_TIME_TRACER) + MESSAGE(STATUS "Time tracer enabled") + ADD_DEFINITIONS("-DENABLE_TIME_TRACER") +ELSE(ENABLE_TIME_TRACER) + MESSAGE(STATUS "Time tracer disabled") +ENDIF(ENABLE_TIME_TRACER) + +# ----------------------------------------------------------------------------- +# Set build type (Release by default) +# ----------------------------------------------------------------------------- +IF("${CMAKE_BUILD_TYPE}" STREQUAL "") + SET(CMAKE_BUILD_TYPE Release) +ENDIF("${CMAKE_BUILD_TYPE}" STREQUAL "") + +MESSAGE("Build type: ${CMAKE_BUILD_TYPE}") + + +# ----------------------------------------------------------------------------- +# Determine the feature configuration for optional API +# ----------------------------------------------------------------------------- + +IF(ENABLE_OPTIONAL_BT) + MESSAGE(STATUS "Bluetooth API Enabled") + ADD_DEFINITIONS( -DFEATURE_OPTIONAL_BT ) +ENDIF(ENABLE_OPTIONAL_BT) + +IF(ENABLE_OPTIONAL_CALL_HISTORY) + MESSAGE(STATUS "Callhistory API Enabled") + ADD_DEFINITIONS( -DFEATURE_OPTIONAL_CALL_HISTORY ) +ENDIF(ENABLE_OPTIONAL_CALL_HISTORY) + +IF(ENABLE_OPTIONAL_NBS) + MESSAGE(STATUS "Network Bearer Selection API Enabled") + ADD_DEFINITIONS( -DFEATURE_OPTIONAL_NBS ) +ENDIF(ENABLE_OPTIONAL_NBS) + +IF(ENABLE_OPTIONAL_NFC) + MESSAGE(STATUS "NFC API Enabled") + ADD_DEFINITIONS( -DFEATURE_OPTIONAL_NFC ) +ENDIF(ENABLE_OPTIONAL_NFC) + +IF(ENABLE_OPTIONAL_PUSH) + MESSAGE(STATUS "Push API Enabled") + ADD_DEFINITIONS( -DFEATURE_OPTIONAL_PUSH ) +ENDIF(ENABLE_OPTIONAL_PUSH) + +IF(ENABLE_OPTIONAL_SE) + MESSAGE(STATUS "Secure Element API Enabled") + ADD_DEFINITIONS( -DFEATURE_OPTIONAL_SE ) +ENDIF(ENABLE_OPTIONAL_SE) + +# ----------------------------------------------------------------------------- +# CFlags +# ----------------------------------------------------------------------------- +SET(OPTIMIZATION_FLAGS "-falign-functions -falign-jumps -falign-loops -falign-labels -freorder-blocks -ftree-vect-loop-version ") +SET(GC_SECTIONS_FLAGS "-fdata-sections -ffunction-sections -Wl,--gc-sections") +SET(CMAKE_C_FLAGS_PROFILING "-O0 -g -pg") +SET(CMAKE_CXX_FLAGS_PROFILING "-O0 -std=c++0x -g -pg") +SET(CMAKE_C_FLAGS_DEBUG "-O0 -g") +SET(CMAKE_CXX_FLAGS_DEBUG "-O0 -std=c++0x -g") +SET(CMAKE_C_FLAGS_RELEASE "-Os -g ${OPTIMIZATION_FLAGS} ${GC_SECTIONS_FLAGS}") +SET(CMAKE_CXX_FLAGS_RELEASE "-Os -std=c++0x -g ${OPTIMIZATION_FLAGS} ${GC_SECTIONS_FLAGS}") +ADD_DEFINITIONS("-DCLIENT_IPC_THREAD") +ADD_DEFINITIONS("-DEXPORT_API=") +ADD_DEFINITIONS("-Wall") +ADD_DEFINITIONS("-D_FILE_OFFSET_BITS=64") +#ADD_DEFINITIONS("-Werror") +#ADD_DEFINITIONS("-Wextra") + +# ----------------------------------------------------------------------------- +# License file +# ----------------------------------------------------------------------------- +SET(LICENSE_FILE ${CMAKE_CURRENT_SOURCE_DIR}/LICENSE) +SET(LICENSE_FILE_DST_PATH /usr/share/license) +SET(LICENSE_FILE_DST_NAME wrt-plugins-tizen) + +INSTALL( + FILES ${LICENSE_FILE} + DESTINATION ${LICENSE_FILE_DST_PATH} + RENAME ${LICENSE_FILE_DST_NAME} +) + +# ----------------------------------------------------------------------------- +# Schema of plugin's configuration file +# ----------------------------------------------------------------------------- +SET(COMMON_CONFIG_DTD ${CMAKE_CURRENT_SOURCE_DIR}/config.dtd) +SET(COMMON_CONFIG_DTD_DST /usr/etc/tizen-apis) +INSTALL(FILES ${COMMON_CONFIG_DTD} DESTINATION ${COMMON_CONFIG_DTD_DST}) + +# ----------------------------------------------------------------------------- +# Global variables +# ----------------------------------------------------------------------------- + +SET(DESTINATION_LIB_PREFIX lib/wrt-plugins) + +SET(DESTINATION_HEADER_PREFIX include/${PROJECT_NAME}) + +SET(TOP ${CMAKE_SOURCE_DIR}/src) + +SET(INCLUDE_COMMON ${TOP}/Common ${TOP}/Common/TimeTracer) + +SET(LIBS_COMMON + ${dpl_LDFLAGS} + ${dpl-event_LDFLAGS} + ${webkit2_LDFLAGS} + ${wrt-deviceapis-commons_LDFLAGS} + ${wrt-deviceapis-commons-javascript_LDFLAGS} +) + +SET(CMAKE_INSTALL_RPATH ${wrt-deviceapis-commons_LIBRARY_DIRS}) + +SET(LIBS_WIDGETDB ${wrt-plugins-widgetdb_LIBRARIES}) + +# ----------------------------------------------------------------------------- +# Macros for pkgconfig +# ----------------------------------------------------------------------------- +SET(PKGCONFIG_DIR ${CMAKE_SOURCE_DIR}/pkgconfigs) + +MACRO(configure_and_install_pkg PKG_FILE) + CONFIGURE_FILE(${PKGCONFIG_DIR}/${PKG_FILE}.in + ${PKGCONFIG_DIR}/${PKG_FILE} @ONLY) + INSTALL(FILES ${PKGCONFIG_DIR}/${PKG_FILE} DESTINATION lib/pkgconfig) +ENDMACRO(configure_and_install_pkg) + +# ----------------------------------------------------------------------------- +# Functions used for plugins +# ----------------------------------------------------------------------------- + +FUNCTION(set_target NAME) + STRING(TOLOWER ${NAME} LOWER_NAME) + SET(${LOWER_NAME}_dest tizen-${LOWER_NAME} PARENT_SCOPE) + SET(${LOWER_NAME}_target wrt-plugins-tizen-${LOWER_NAME} PARENT_SCOPE) + SET(${LOWER_NAME}_impl wrt-plugins-tizen-${LOWER_NAME}-impl PARENT_SCOPE) + SET(${LOWER_NAME}_config wrt-plugins-tizen-${LOWER_NAME}-config PARENT_SCOPE) + configure_and_install_pkg(wrt-plugins-tizen-${LOWER_NAME}.pc) +ENDFUNCTION() + + +FUNCTION(add_subdir NAME) + MESSAGE(STATUS "Building: ${CMAKE_CURRENT_SOURCE_DIR}/${NAME}") + ADD_SUBDIRECTORY(${NAME}) +ENDFUNCTION() + + +FUNCTION(add_plugin) + FOREACH(VALUE ${ARGN}) + set_target(${VALUE}) + ENDFOREACH(VALUE) + FOREACH(VALUE ${ARGN}) + add_subdir(${VALUE}) + ENDFOREACH(VALUE) +ENDFUNCTION() + +ADD_SUBDIRECTORY(src) |