Code clean up
[platform/framework/web/nwrt.git] / CMakeLists.txt
1 #
2 # Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
3 #
4 #    Licensed under the Apache License, Version 2.0 (the "License");
5 #    you may not use this file except in compliance with the License.
6 #    You may obtain a copy of the License at
7 #
8 #        http://www.apache.org/licenses/LICENSE-2.0
9 #
10 #    Unless required by applicable law or agreed to in writing, software
11 #   distributed under the License is distributed on an "AS IS" BASIS,
12 #  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 #    See the License for the specific language governing permissions and
14 #    limitations under the License.
15 #
16
17 # Check minimum CMake version
18 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
19
20 # Project name
21 PROJECT(wrt)
22
23 INCLUDE(FindPkgConfig)
24
25 # Options
26 OPTION(X11_SUPPORT "Support x11 for window manager" OFF)
27 OPTION(WAYLAND_SUPPORT "Support wayland for window manager" OFF)
28
29 # Compiler flags
30 IF(NOT CMAKE_BUILD_TYPE)
31     SET(CMAKE_BUILD_TYPE "Release")
32 ENDIF(NOT CMAKE_BUILD_TYPE)
33 SET(CMAKE_C_FLAGS_PROFILING    "-O2")
34 SET(CMAKE_CXX_FLAGS_PROFILING  "-O2 -std=c++0x")
35 SET(CMAKE_C_FLAGS_DEBUG        "-O0 -g")
36 SET(CMAKE_CXX_FLAGS_DEBUG      "-O0 -std=c++0x -g")
37 SET(CMAKE_C_FLAGS_RELEASE      "-Os")
38 SET(CMAKE_CXX_FLAGS_RELEASE    "-Os -std=c++0x -fvisibility-inlines-hidden")
39 SET(CMAKE_C_FLAGS_CCOV         "-O0 -g --coverage")
40 SET(CMAKE_CXX_FLAGS_CCOV       "-O0 -std=c++0x -g --coverage")
41
42 ADD_DEFINITIONS("-Wall")
43 ADD_DEFINITIONS("-Wextra")
44 ADD_DEFINITIONS("-Wno-variadic-macros")
45
46 IF(X11_SUPPORT)
47   ADD_DEFINITIONS("-DHAVE_X11")
48 ENDIF(X11_SUPPORT)
49 IF(WAYLAND_SUPPORT)
50   ADD_DEFINITIONS("-DHAVE_WAYLAND")
51 ENDIF(WAYLAND_SUPPORT)
52
53 IF(NOT EXTENSION_PATH)
54   SET(EXTENSION_PATH ${LIB_INSTALL_DIR}/tizen-extensions-crosswalk)
55 ENDIF(NOT EXTENSION_PATH)
56 ADD_DEFINITIONS("-DEXTENSION_PATH=\"${EXTENSION_PATH}\"")
57
58 # Targets names
59 SET(TARGET_RUNTIME  "wrt")
60 SET(TARGET_COMMON_STATIC "wrt-common-static")
61 SET(TARGET_EXTENSION_STATIC "wrt-extension-static")
62 SET(TARGET_INJECTED_BUNDLE "wrt-injected-bundle")
63 SET(TARGET_WIDGET_PLUGIN "widget-plugin")
64
65 # Sub Directories
66 ADD_SUBDIRECTORY(src)
67 ADD_SUBDIRECTORY(po)
68 ADD_SUBDIRECTORY(tests)