Update wrt-security_0.0.42
[framework/web/wrt-security.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-security")
24
25 ############################# cmake packages ##################################
26
27 INCLUDE(FindPkgConfig)
28
29 ############################# compilation defines #############################
30
31 # EMPTY
32
33 ############################# compiler flags ##################################
34
35 SET(CMAKE_C_FLAGS_PROFILING    "-O0 -g -pg")
36 SET(CMAKE_CXX_FLAGS_PROFILING  "-O0 -std=c++0x -g -pg")
37 SET(CMAKE_C_FLAGS_DEBUG        "-O0 -g")
38 SET(CMAKE_CXX_FLAGS_DEBUG      "-O0 -std=c++0x -g")
39 SET(CMAKE_C_FLAGS_RELEASE      "-O2 -g")
40 SET(CMAKE_CXX_FLAGS_RELEASE    "-O2 -std=c++0x -g")
41
42 #SET(SMACK_ENABLE ON)
43
44 OPTION(DPL_LOG "DPL logs status" ON)
45 IF(DPL_LOG)
46     MESSAGE(STATUS "Logging enabled for DPL")
47     ADD_DEFINITIONS("-DDPL_LOGS_ENABLED")
48 ELSE(DPL_LOG)
49     MESSAGE(STATUS "Logging disabled for DPL")
50 ENDIF(DPL_LOG)
51
52 # If supported for the target machine, emit position-independent code,suitable
53 # for dynamic linking and avoiding any limit on the size of the global offset
54 # table. This option makes a difference on the m68k, PowerPC and SPARC.
55 # (BJ: our ARM too?)
56 ADD_DEFINITIONS("-fPIC")
57
58 # Set the default ELF image symbol visibility to hidden - all symbols will be
59 # marked with this unless overridden within the code.
60 #ADD_DEFINITIONS("-fvisibility=hidden")
61
62 # Set compiler warning flags
63 #ADD_DEFINITIONS("-Werror")                      # Make all warnings into errors.
64 ADD_DEFINITIONS("-Wall")                        # Generate all warnings
65 ADD_DEFINITIONS("-Wextra")                      # Generate even more extra warnings
66 ADD_DEFINITIONS("-Wno-variadic-macros")         # Inhibit variadic macros warnings (needed for ORM)
67 ADD_DEFINITIONS("-Wno-deprecated")               # No warnings about deprecated features
68 ADD_DEFINITIONS("-std=c++0x")               # No warnings about deprecated features
69 STRING(REGEX MATCH "([^.]*)" API_VERSION "${VERSION}")
70 ADD_DEFINITIONS("-DAPI_VERSION=\"$(API_VERSION)\"")
71
72 IF(SMACK_ENABLE)
73     ADD_DEFINITIONS("-DWRT_SMACK_ENABLED")
74 ENDIF(SMACK_ENABLE)
75
76 ############################# Targets names ###################################
77
78 SET(TARGET_DAEMON "wrt-security-daemon")
79 SET(TARGET_VCORE_LIB "vcore")
80 SET(TARGET_ACE_DAO_RO_LIB "ace-dao-ro")
81 SET(TARGET_ACE_DAO_RW_LIB "ace-dao-rw")
82 SET(TARGET_ACE_LIB "ace")
83 SET(TARGET_ACE_CLIENT_LIB "ace-client")
84 SET(TARGET_ACE_SETTINGS_LIB "ace-settings")
85 SET(TARGET_ACE_INSTALL_LIB "ace-install")
86 SET(TARGET_ACE_POPUP_VALIDATION_LIB "ace-popup-validation")
87 SET(TARGET_WRT_POPUP "wrt-popup")
88
89 ############################# subdirectories ##################################
90
91 ADD_SUBDIRECTORY(vcore)
92 ADD_SUBDIRECTORY(ace)
93 ADD_SUBDIRECTORY(ace_client)
94 ADD_SUBDIRECTORY(ace_common)
95 ADD_SUBDIRECTORY(ace_install)
96 ADD_SUBDIRECTORY(ace_settings)
97 ADD_SUBDIRECTORY(ace_popup_validation)
98 ADD_SUBDIRECTORY(popup_process)
99 ADD_SUBDIRECTORY(src)
100 ADD_SUBDIRECTORY(build)
101 ADD_SUBDIRECTORY(tests)
102 ADD_SUBDIRECTORY(etc)
103