Revert "SM : disabled ask-user policy tests"
[platform/core/test/security-tests.git] / CMakeLists.txt
1 # Copyright (c) 2012-2015 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 # @author      Pawel Polawski (p.polawski@partner.samsung.com)
18 # @brief
19 #
20
21 ############################# Check minimum CMake version #####################
22
23 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
24 PROJECT("security-tests")
25
26 ############################# cmake packages ##################################
27
28 INCLUDE(FindPkgConfig)
29
30 ############################# compilation defines #############################
31
32 # EMPTY
33
34 ############################# compiler flags ##################################
35
36 SET(CMAKE_C_FLAGS              "-g")
37 SET(CMAKE_CXX_FLAGS            "-g -std=c++0x")
38 SET(CMAKE_C_FLAGS_PROFILING    "-O0 -pg")
39 SET(CMAKE_CXX_FLAGS_PROFILING  "-O0 -pg")
40 SET(CMAKE_C_FLAGS_DEBUG        "-O0 -ggdb")
41 SET(CMAKE_CXX_FLAGS_DEBUG      "-O0 -ggdb")
42 SET(CMAKE_C_FLAGS_RELEASE      "-O2")
43 SET(CMAKE_CXX_FLAGS_RELEASE    "-O2")
44
45 SET(SMACK_ENABLE ON)
46
47 OPTION(DPL_LOG "DPL logs status" ON)
48 OPTION(DPL_WITH_DLOG "DPL DLOG backend" OFF)
49 IF(DPL_LOG)
50     MESSAGE(STATUS "Logging enabled for DPL")
51     ADD_DEFINITIONS("-DDPL_LOGS_ENABLED")
52     IF(DPL_WITH_DLOG)
53         MESSAGE(STATUS "Enable DLOG backend")
54         ADD_DEFINITIONS("-DDPL_DLOG_ENABLED")
55     ENDIF(DPL_WITH_DLOG)
56 ELSE(DPL_LOG)
57     MESSAGE(STATUS "Logging disabled for DPL")
58 ENDIF(DPL_LOG)
59
60 OPTION(BUILD_ALL_TESTS "Build all tests" ON)
61 IF(BUILD_ALL_TESTS)
62     SET(BUILD_CKM ON)
63     SET(BUILD_SM ON)
64     SET(BUILD_CYNARA ON)
65     SET(BUILD_WEB ON)
66     SET(BUILD_YACA ON)
67 ENDIF(BUILD_ALL_TESTS)
68
69 # If supported for the target machine, emit position-independent code,suitable
70 # for dynamic linking and avoiding any limit on the size of the global offset
71 # table. This option makes a difference on the m68k, PowerPC and SPARC.
72 # (BJ: our ARM too?)
73 ADD_DEFINITIONS("-fPIC")
74
75 # Set the default ELF image symbol visibility to hidden - all symbols will be
76 # marked with this unless overridden within the code.
77 #ADD_DEFINITIONS("-fvisibility=hidden")
78
79 # Set compiler warning flags
80 ADD_DEFINITIONS("-Werror")                      # Make all warnings into errors.
81 ADD_DEFINITIONS("-Wall")                        # Generate all warnings
82 ADD_DEFINITIONS("-Wextra")                      # Generate even more extra warnings
83 ADD_DEFINITIONS("-Wno-variadic-macros")         # Inhibit variadic macros warnings (needed for ORM)
84 ADD_DEFINITIONS("-Wno-deprecated")               # No warnings about deprecated features
85 ADD_DEFINITIONS("-Wno-deprecated-declarations")               # No warnings about deprecated features
86 ADD_DEFINITIONS("-DCYNARA_DB_DIR=\"${CYNARA_DB_DIR}\"")
87 ADD_DEFINITIONS("-DAPP_USER=\"${APP_USER}\"")
88
89 # Enabler for popups; this should be done on system-level somewhere, but since it isn't
90 # and we already have such definition in security-manager, lets have it also here
91 ADD_DEFINITIONS("-DASKUSER_ENABLED")
92
93 IF(SMACK_ENABLE)
94     ADD_DEFINITIONS("-DWRT_SMACK_ENABLED")
95 ENDIF(SMACK_ENABLE)
96
97 IF(NOT DEFINED SHARE_INSTALL_PREFIX)
98         SET(SHARE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}/share")
99 ENDIF(NOT DEFINED SHARE_INSTALL_PREFIX)
100
101 ############################# Targets names ###################################
102
103 SET(TARGET_CKM_TESTS "ckm-tests")
104 SET(TARGET_CKMI_TESTS "ckm-integration-tests")
105 SET(COMMON_TARGET_TEST "tests-common")
106
107 ############################# subdirectories ##################################
108
109 ADD_SUBDIRECTORY(src)
110
111 IF(BUILD_ALL_TESTS)
112     ADD_SUBDIRECTORY(tests)
113 ENDIF(BUILD_ALL_TESTS)