Fixing issues found by prevent
[framework/web/wrt-installer.git] / CMakeLists.txt
1 # Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
2 #
3 #    Licensed under the Apache License, Version 2.0 (the "License");
4 #    you may not use this file except in compliance with the License.
5 #    You may obtain a copy of the License at
6 #
7 #        http://www.apache.org/licenses/LICENSE-2.0
8 #
9 #    Unless required by applicable law or agreed to in writing, software
10 #    distributed under the License is distributed on an "AS IS" BASIS,
11 #    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 #    See the License for the specific language governing permissions and
13 #    limitations under the License.
14 #
15 # @file        CMakeLists.txt
16 # @author      Bartlomiej Grzelewski (b.grzelewski@samsung.com)
17 # @brief
18 #
19
20 ############################# Check minimum CMake version #####################
21
22 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
23 PROJECT("wrt-installer")
24
25 ############################# cmake packages ##################################
26
27 INCLUDE(FindPkgConfig)
28
29 ############################# build type ######################################
30
31 IF(NOT CMAKE_BUILD_TYPE)
32     SET(CMAKE_BUILD_TYPE "Release")
33 ENDIF(NOT CMAKE_BUILD_TYPE)
34
35 ############################# compilation defines #############################
36
37
38 #csp from .xml parsing enabled
39 OPTION(CSP_SUPPORT "Support for csp policy" OFF)
40
41 IF(CSP_SUPPORT)
42     ADD_DEFINITIONS("-DCSP_ENABLED")
43 ENDIF(CSP_SUPPORT)
44
45 ############################# compiler flags ##################################
46
47 SET(CMAKE_C_FLAGS_PROFILING    "-O2")
48 SET(CMAKE_CXX_FLAGS_PROFILING  "-O2 -std=c++0x")
49 SET(CMAKE_C_FLAGS_DEBUG        "-O0 -g")
50 SET(CMAKE_CXX_FLAGS_DEBUG      "-O0 -std=c++0x -g")
51 SET(CMAKE_C_FLAGS_RELEASE      "-O2 -g")
52 SET(CMAKE_CXX_FLAGS_RELEASE    "-O2 -std=c++0x -g")
53 SET(CMAKE_CXX_FLAGS_CCOV       "-O0 -std=c++0x -g --coverage")
54
55 OPTION(DPL_LOG "DPL logs status" ON)
56 OPTION(WITH_TESTS "Build tests" OFF)
57 OPTION(MULTIPROCESS_SERVICE_SUPPORT "Process per service" OFF)
58 OPTION(MULTIPROCESS_SERVICE_SUPPORT_INLINE "Process per service - inline mode support" OFF)
59 IF(DPL_LOG AND NOT CMAKE_BUILD_TYPE MATCHES "profiling")
60     MESSAGE(STATUS "Logging enabled for DPL")
61     ADD_DEFINITIONS("-DDPL_LOGS_ENABLED")
62 ELSE(DPL_LOG AND NOT CMAKE_BUILD_TYPE MATCHES "profiling")
63     MESSAGE(STATUS "Logging disabled for DPL")
64 ENDIF(DPL_LOG AND NOT CMAKE_BUILD_TYPE MATCHES "profiling")
65 MESSAGE(STATUS "WITH_TESTS: " ${WITH_TESTS})
66 IF(MULTIPROCESS_SERVICE_SUPPORT)
67     ADD_DEFINITIONS("-DMULTIPROCESS_SERVICE_SUPPORT")
68     IF (MULTIPROCESS_SERVICE_SUPPORT_INLINE)
69         ADD_DEFINITIONS("-DMULTIPROCESS_SERVICE_SUPPORT_INLINE")
70     ENDIF(MULTIPROCESS_SERVICE_SUPPORT_INLINE)
71 ENDIF(MULTIPROCESS_SERVICE_SUPPORT)
72
73 # If supported for the target machine, emit position-independent code,suitable
74 # for dynamic linking and avoiding any limit on the size of the global offset
75 # table. This option makes a difference on the m68k, PowerPC and SPARC.
76 # (BJ: our ARM too?)
77 ADD_DEFINITIONS("-fPIC")
78
79 # Set the default ELF image symbol visibility to hidden - all symbols will be
80 # marked with this unless overridden within the code.
81 #ADD_DEFINITIONS("-fvisibility=hidden")
82
83 # Set compiler warning flags
84 #ADD_DEFINITIONS("-Werror")             # Make all warnings into errors.
85 ADD_DEFINITIONS("-Wall")                # Generate all warnings
86 ADD_DEFINITIONS("-Wextra")              # Generate even more extra warnings
87 ADD_DEFINITIONS("-Wno-variadic-macros") # Inhibit variadic macros warnings (needed for ORM)
88 ADD_DEFINITIONS("-Wno-deprecated")      # No warnings about deprecated features
89 ADD_DEFINITIONS("-std=c++0x")           # accept C++11x standard
90 #ADD_DEFINITIONS("-DWRT_SMACK_ENABLED")
91
92 ############################# Targets names ###################################
93
94 SET(TARGET_INSTALLER_STATIC "wrt-installer_static")
95 SET(TARGET_INSTALLER "wrt-installer")
96 SET(TARGET_BACKEND_LIB "wgt")
97
98 ADD_CUSTOM_COMMAND(
99     OUTPUT ${PROJECT_SOURCE_DIR}/data/widget_install_popup.edj
100     COMMAND edje_cc
101     ARGS  ${PROJECT_SOURCE_DIR}/data/widget_install_popup.edc
102           ${PROJECT_SOURCE_DIR}/data/widget_install_popup.edj
103     DEPENDS ${PROJECT_SOURCE_DIR}/data/widget_install_popup.edc
104     )
105 ADD_CUSTOM_TARGET(widget_install_popup ALL DEPENDS
106     ${PROJECT_SOURCE_DIR}/data/widget_install_popup.edj
107     )
108 INSTALL(FILES   ${PROJECT_SOURCE_DIR}/data/widget_install_popup.edj
109     DESTINATION share/edje/wrt
110     )
111
112 ############################# subdirectories ##################################
113 ADD_SUBDIRECTORY(src)
114 ADD_SUBDIRECTORY(etc)
115
116 IF(WITH_TESTS)
117     ADD_SUBDIRECTORY(tests)
118 ENDIF(WITH_TESTS)