Fix building the package with GCC-4.8
[platform/framework/web/wrt-plugins-common.git] / CMakeLists.txt
index b36642f..dd78270 100644 (file)
@@ -28,9 +28,15 @@ pkg_search_module(dpl REQUIRED dpl-efl>=0.2.21)
 
 include_directories(
   ${dpl_INCLUDE_DIRS}
-)
-
-
+  ${CMAKE_CURRENT_SOURCE_DIR}/src/
+  ${CMAKE_CURRENT_SOURCE_DIR}/src/modules/API
+  ${CMAKE_CURRENT_SOURCE_DIR}/src/Commons
+  ${CMAKE_CURRENT_SOURCE_DIR}/src/CommonsJavaScript
+  ${CMAKE_CURRENT_SOURCE_DIR}/src/plugin-loading
+  ${CMAKE_CURRENT_SOURCE_DIR}/src/js-overlay
+  ${CMAKE_CURRENT_SOURCE_DIR}/src/wrt-popup/ace/popup-runner
+  ${CMAKE_CURRENT_SOURCE_DIR}/src/plugins_ipc_message
+  ${CMAKE_CURRENT_SOURCE_DIR}/src/dispatch-event)
 
 ##############################################################################
 # Build type
@@ -39,8 +45,8 @@ IF(NOT CMAKE_BUILD_TYPE)
 ENDIF(NOT 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_PROFILING    "-O2")
+SET(CMAKE_CXX_FLAGS_PROFILING  "-O2 -std=c++0x")
 SET(CMAKE_C_FLAGS_DEBUG        "-O0 -g")
 SET(CMAKE_CXX_FLAGS_DEBUG      "-O0 -std=c++0x -g")
 SET(CMAKE_C_FLAGS_RELEASE      "-O2 -g")
@@ -49,12 +55,16 @@ SET(CMAKE_CXX_FLAGS_CCOV       "-O0 -std=c++0x -g --coverage")
 ####
 
 OPTION(DPL_LOG "DPL logs status" ON)
-IF(DPL_LOG)
+OPTION(WITH_TESTS "Build tests" OFF)
+
+IF(DPL_LOG AND NOT CMAKE_BUILD_TYPE MATCHES "profiling")
     MESSAGE(STATUS "Logging enabled for DPL")
     ADD_DEFINITIONS("-DDPL_LOGS_ENABLED")
-ELSE(DPL_LOG)
+ELSE(DPL_LOG AND NOT CMAKE_BUILD_TYPE MATCHES "profiling")
     MESSAGE(STATUS "Logging disabled for DPL")
-ENDIF(DPL_LOG)
+ENDIF(DPL_LOG AND NOT CMAKE_BUILD_TYPE MATCHES "profiling")
+
+MESSAGE(STATUS "WITH_TESTS: " ${WITH_TESTS})
 
 ADD_DEFINITIONS("-fPIC")
 ADD_DEFINITIONS("-fvisibility=default")         # mark all exported symbols as visible
@@ -65,6 +75,8 @@ ADD_DEFINITIONS("-Wall")
 ADD_DEFINITIONS("-Wextra")
 ADD_DEFINITIONS("-Wno-deprecated")
 #ADD_DEFINITIONS("-DDEVPKG")
+# GCC 4.7 changes the scheme of name lookup. Guide: http://gcc.gnu.org/gcc-4.7/porting_to.html
+ADD_DEFINITIONS("-fpermissive")
 
 ##############################################################################
 # CMake flags
@@ -84,6 +96,7 @@ set(DESTINATION_HEADER_PREFIX include/${PROJECT_NAME})
 set(DESTINATION_HEADERS_NON_JS ${DESTINATION_HEADER_PREFIX}/Commons)
 set(DESTINATION_HEADERS_JS ${DESTINATION_HEADER_PREFIX}/CommonsJavaScript)
 set(DESTINATION_HEADERS_JS_OVERLAY ${DESTINATION_HEADER_PREFIX}/js-overlay)
+set(DESTINATION_HEADERS_WRT_POPUP_RUNNER ${DESTINATION_HEADER_PREFIX}/popup-runner)
 
 ################################################################################
 # Target platform
@@ -113,6 +126,10 @@ endfunction()
 
 add_subdirectory(src)
 
+IF(WITH_TESTS)
+  add_subdirectory(tests)
+ENDIF(WITH_TESTS)
+
 ################################################################################
 # PKGCONFIG
 
@@ -127,12 +144,17 @@ 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-cpu.pc)
-configure_and_install_pkg(wrt-plugins-widget-interface-dao.pc)
+configure_and_install_pkg(wrt-plugins-widget-interface.pc)
 configure_and_install_pkg(wrt-plugins-widgetdb.pc)
 configure_and_install_pkg(wrt-plugins-plugin-manager.pc)
 configure_and_install_pkg(wrt-plugin-loading.pc)
 configure_and_install_pkg(wrt-plugin-js-overlay.pc)
+configure_and_install_pkg(wrt-popup-runner.pc)
+configure_and_install_pkg(wrt-popup-ace-runner.pc)
+configure_and_install_pkg(wrt-popup-wrt-runner.pc)
+configure_and_install_pkg(wrt-plugins-api-support.pc)
+configure_and_install_pkg(wrt-plugins-ipc-message.pc)
+configure_and_install_pkg(wrt-dispatch-event.pc)
 
 ################################################################################
 # Cache
@@ -141,6 +163,14 @@ set(PLATFORM "${PLATFORM}" CACHE STRING "Target platform" FORCE)
 set(CMAKE_CONFIG_FILE_NAME "${CMAKE_CONFIG_FILE_NAME}" CACHE
     STRING "CMake configuration file name." FORCE)
 
+################################################################################
+# SMACK rule
+
+INSTALL(FILES ${CMAKE_SOURCE_DIR}/wrt-popup-ace-runtime.rule DESTINATION /etc/smack/accesses2.d)
+INSTALL(FILES ${CMAKE_SOURCE_DIR}/wrt-popup-wrt-runtime.rule DESTINATION /etc/smack/accesses2.d)
+# temp for smack branch
+INSTALL(FILES ${CMAKE_SOURCE_DIR}/accesses.d/wrt-popup-ace-runtime.rule DESTINATION /opt/etc/smack/accesses.d)
+INSTALL(FILES ${CMAKE_SOURCE_DIR}/accesses.d/wrt-popup-wrt-runtime.rule DESTINATION /opt/etc/smack/accesses.d)
 
 ################################################################################
 # Summary