# Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # cmake_minimum_required(VERSION 2.6) IF("${CMAKE_PROJECT_NAME}" STREQUAL "") SET(CMAKE_PROJECT_NAME wrt-plugins-common) ENDIF("${CMAKE_PROJECT_NAME}" STREQUAL "") set(PACKAGE_NAME ${CMAKE_PROJECT_NAME}) project(${CMAKE_PROJECT_NAME}) ################################################################################ # Required platform modules include(FindPkgConfig) pkg_search_module(dpl REQUIRED dpl-efl>=1.0.0) include_directories( ${dpl_INCLUDE_DIRS} ) # # 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("-fvisibility=default") # mark all exported symbols as visible ADD_DEFINITIONS("-DEXPORT_API=") ADD_DEFINITIONS("-Wall") ADD_DEFINITIONS("-Werror") ADD_DEFINITIONS("-Wextra") ADD_DEFINITIONS("-Wno-deprecated") #disable default singleton implementation ADD_DEFINITIONS("-DSEPARATED_SINGLETON_IMPLEMENTATION") ################################################################################ # Miscellaneous variables set(CONFIG_FILE_NAME "config.cmake") set(LIBS_COMMONS ${dpl_LDFLAGS} ) set(DESTINATION_LIB_PREFIX lib) set(DESTINATION_HEADER_PREFIX include/${PROJECT_NAME}) set(DESTINATION_HEADERS_NON_JS ${DESTINATION_HEADER_PREFIX}/Commons) set(DESTINATION_HEADERS_JS ${DESTINATION_HEADER_PREFIX}/CommonsJavaScript) ################################################################################ # Target platform if (NOT DEFINED PLATFORM) set(PLATFORM "tizen") endif () ################################################################################ # 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) add_subdirectory(tests) ################################################################################ # PKGCONFIG set(PKGCONFIG_DIR ${PROJECT_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) configure_and_install_pkg(wrt-plugins-commons-javascript.pc) configure_and_install_pkg(wrt-plugins-commons.pc) configure_and_install_pkg(wrt-plugins-filesystem.pc) configure_and_install_pkg(wrt-plugins-camera.pc) configure_and_install_pkg(wrt-plugins-messaging.pc) configure_and_install_pkg(wrt-plugins-calendar.pc) configure_and_install_pkg(wrt-plugins-haptics.pc) configure_and_install_pkg(wrt-plugins-contact.pc) configure_and_install_pkg(wrt-plugins-mmplayer.pc) configure_and_install_pkg(wrt-plugins-widget.pc) configure_and_install_pkg(wrt-plugins-cpu.pc) configure_and_install_pkg(wrt-plugins-accelerometer.pc) configure_and_install_pkg(wrt-plugins-task.pc) configure_and_install_pkg(wrt-plugins-orientation.pc) configure_and_install_pkg(wrt-plugins-radio.pc) configure_and_install_pkg(wrt-plugins-power.pc) configure_and_install_pkg(wrt-plugins-profile.pc) configure_and_install_pkg(wrt-plugins-localstorage.pc) configure_and_install_pkg(wrt-plugins-systeminfo.pc) configure_and_install_pkg(wrt-plugins-widget_interface_dao.pc) configure_and_install_pkg(wrt-plugins-storageevent.pc) configure_and_install_pkg(wrt-plugins-widgetdb.pc) configure_and_install_pkg(wrt-plugins-plugin-manager.pc) ################################################################################ # 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}")