cmake_minimum_required(VERSION 2.6) project(wrt-plugins-tizen) ################################################################################ # Required platform modules include(FindPkgConfig) pkg_search_module(webkit2 REQUIRED ewebkit2) pkg_search_module(dpl REQUIRED dpl-efl) pkg_search_module(dpl-event REQUIRED dpl-event-efl) pkg_search_module(wrt-plugins-types REQUIRED wrt-plugins-types) pkg_search_module(wrt-deviceapis-commons REQUIRED wrt-plugins-commons) pkg_search_module(wrt-deviceapis-commons-javascript REQUIRED wrt-plugins-commons-javascript) include_directories( ${webkit2_INCLUDE_DIRS} ${dpl_INCLUDE_DIRS} ${wrt-plugins-types_INCLUDE_DIRS} ${wrt-deviceapis-commons_INCLUDE_DIRS} ${wrt-deviceapis-commons-javascript_INCLUDE_DIRS} ) ################################################################################ # Build options # # Logs # OPTION(DPL_LOG "DPL logs status" ON) 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) ############################################################################### # 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}") ############################################################################## # Compiler flags 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 "-O2 -g") SET(CMAKE_CXX_FLAGS_RELEASE "-O2 -std=c++0x -g") #### ADD_DEFINITIONS("-DEXPORT_API=") ADD_DEFINITIONS("-Wall") #ADD_DEFINITIONS("-Werror") #ADD_DEFINITIONS("-Wextra") ################################################################################ # Miscellaneous variables set(CONFIG_FILE_NAME "config.cmake") set(DIR_COMMONS ${CMAKE_SOURCE_DIR}/src/commons) set(LIBS_COMMON ${dpl_LDFLAGS} ${dpl-event_LDFLAGS} ${webkit2_LDFLAGS} ${wrt-deviceapis-commons_LDFLAGS} ${wrt-deviceapis-commons-javascript_LDFLAGS} ) ################################################################################ # Target platform if (NOT DEFINED PLATFORM) set(PLATFORM "Tizen") endif () include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/src ${CMAKE_CURRENT_SOURCE_DIR}/src/platform ${CMAKE_CURRENT_SOURCE_DIR}/src/platform/${PLATFORM} ${CMAKE_CURRENT_SOURCE_DIR}/src/standards ) ################################################################################ # 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}) ################################################################################ # Macros used for including plugins from AL. function(add_subdir NAME) message(STATUS "Building: ${CMAKE_CURRENT_SOURCE_DIR}/${NAME}") add_subdirectory(${NAME}) endfunction() ################################################################################ # Subdirectories add_subdirectory(src) ################################################################################ # Cache set(PLATFORM "${PLATFORM}" CACHE STRING "Target platform" FORCE) set(CMAKE_CONFIG_FILE_NAME "${CMAKE_CONFIG_FILE_NAME}" CACHE STRING "CMake configuration file name." FORCE) ################################################################################ # Summary message(STATUS "PLATFORM = ${PLATFORM}")