2 cmake_minimum_required(VERSION 2.8)
4 ########## Defines ###########
5 SET(PREFIX ${CMAKE_INSTALL_PREFIX})
6 SET(BINDIR "${PREFIX}/bin")
7 SET(RESDIR "${PREFIX}/res" CACHE STRING "The path of resources")
8 SET(WEBKITDIR "/opt/usr/data/webkit" CACHE STRING "The path of web engine")
9 SET(EDJE_DIR "${RESDIR}/edje/")
10 SET(CERTS_DIR "${RESDIR}/certs/")
11 SET(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
12 SET(GCC_COVERAGE_COMPILE_FLAGS "-fprofile-arcs -ftest-coverage")
14 if(NOT DEFINED PACKAGE_NAME)
15 SET(PACKAGE_NAME "org.tizen.browser")
16 endif(NOT DEFINED PACKAGE_NAME)
18 if(NOT DEFINED MANIFESTDIR)
19 SET(MANIFESTDIR "/usr/share/packages")
20 endif(NOT DEFINED MANIFESTDIR)
22 if(NOT DEFINED ICONDIR)
23 SET(ICONDIR "/usr/share/icons/default/small/")
24 endif(NOT DEFINED ICONDIR)
26 if(NOT DEFINED DEMODIR)
27 SET(DEMODIR "/usr/apps/org.tizen.browser/res/demo/")
28 endif(NOT DEFINED DEMODIR)
30 option(BUILD_UT "Build Unit tests" OFF)
31 option(TIZEN_BUILD "Build for Tizen. Default ON" ON)
32 option(DYN_INT_LIBS "Buils internal libs as dynamic" ON)
33 option(COVERAGE_STATS "Code coverage" OFF)
36 include(CheckCXXCompilerFlag)
37 CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
38 CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X)
41 if (COMPILER_SUPPORTS_CXX11)
42 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -O0 -g -ggdb3")
43 elseif(COMPILER_SUPPORTS_CXX0X)
44 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x -O0 -g -ggdb3")
46 message(FATAL_ERROR "The Compiler ${CMAKE_CXX_COMPILER} doesn't support C++11")
50 find_package(Boost 1.49.0 REQUIRED COMPONENTS
57 find_package(Boost 1.49.0 REQUIRED COMPONENTS unit_test_framework)
61 set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
62 set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib:${CMAKE_INSTALL_PREFIX}/services")
64 #disable for merge - WebView is not ready for this
65 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wno-variadic-macros -Wno-long-long")
68 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GCC_COVERAGE_COMPILE_FLAGS}")
71 set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR})
74 # set pkg-config modules
76 include(FindPkgConfig)
78 set(PLATFORM_TIZEN ON)
81 capi-appfw-application
85 pkg_check_modules(tizen_pkgs REQUIRED "${tizen_pkgs_list}")
87 FOREACH(flag ${tizen_pkgs_CFLAGS})
88 SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}")
91 message("${CMAKE_CXX_FLAGS}")
93 EXECUTE_PROCESS(COMMAND "date" "+%d-%m-%Y" OUTPUT_VARIABLE ${RESULT})
94 STRING(REGEX REPLACE "(..)-(..)-(....).*" "\\1-\\2-\\3" ${RESULT} ${${RESULT}})
100 -DBUILD_DATE=\"${BUILD_DATE}\"
101 -DVERSION=\"${VERSION}\"
103 -DM_VCS_ID=\"${VCS_ID}\"
104 -DTIZEN_BUILD=\"${TIZEN_BUILD}\"
105 -DCERTS_DIR=\"${CERTS_DIR}\"
109 ADD_DEFINITIONS(-DEDJE_DIR=\"${EDJE_DIR}\")
111 include_directories(${CMAKE_CURRENT_SOURCE_DIR})
112 include_directories(${CMAKE_CURRENT_BINARY_DIR})
115 add_subdirectory(services)
118 add_subdirectory(core)
122 #Temporary location of EDC files
124 # probably should be moved to Tizen section.
125 #to build unit tests add --define "build_unit_test ON" parameter to gbs build command
127 add_subdirectory(unit_tests)
130 configure_file(${CMAKE_SOURCE_DIR}/cmakeconfig.h.cmake ${CMAKE_BINARY_DIR}/cmakeconfig.h)
133 configure_file(${CMAKE_SOURCE_DIR}/manifest.xml.in ${CMAKE_BINARY_DIR}/${PACKAGE_NAME}.xml)
134 install(FILES ${CMAKE_BINARY_DIR}/${PACKAGE_NAME}.xml DESTINATION ${MANIFESTDIR})
135 # install desktop file & icon
136 install(FILES ${CMAKE_SOURCE_DIR}/org.tizen.browser.png DESTINATION ${ICONDIR})
137 install(FILES ${CMAKE_SOURCE_DIR}/apps_img_web_default_4x2.png DESTINATION ${ICONDIR})
139 install(FILES ${CMAKE_SOURCE_DIR}/demo/b.htm DESTINATION ${DEMODIR})
140 install(FILES ${CMAKE_SOURCE_DIR}/demo/Widget.htm DESTINATION ${DEMODIR})
141 install(FILES ${CMAKE_SOURCE_DIR}/demo/header.jpg DESTINATION ${DEMODIR})
142 install(FILES ${CMAKE_SOURCE_DIR}/demo/main_bg.jpg DESTINATION ${DEMODIR})
144 INSTALL(DIRECTORY ${CMAKE_SOURCE_DIR}/certs/ DESTINATION ${CERTS_DIR})
147 message(STATUS "------------------------------------------")
148 message(STATUS "Build for Tizen (TIZEN_BUILD) :" ${TIZEN_BUILD})
149 message(STATUS "Interal libs are dynamic (DYN_INT_LIBS) :" ${DYN_INT_LIBS})
150 message(STATUS "Building Unit tests (BUILD_UT) :" ${BUILD_UT})
151 message(STATUS "Code Coverage statistics (COVERAGE_STATS) :" ${COVERAGE_STATS})
152 message(STATUS "------------------------------------------")