1 # Copyright (c) 2012-2015 Samsung Electronics Co., Ltd All Rights Reserved
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
7 # http://www.apache.org/licenses/LICENSE-2.0
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.
15 # @file CMakeLists.txt
16 # @author Bartlomiej Grzelewski (b.grzelewski@samsung.com)
17 # @author Pawel Polawski (p.polawski@partner.samsung.com)
21 ############################# Check minimum CMake version #####################
23 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
24 PROJECT("security-tests")
26 ############################# cmake packages ##################################
28 INCLUDE(FindPkgConfig)
30 ############################# compilation defines #############################
34 ############################# compiler flags ##################################
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")
47 OPTION(DPL_LOG "DPL logs status" ON)
48 OPTION(DPL_WITH_DLOG "DPL DLOG backend" OFF)
50 MESSAGE(STATUS "Logging enabled for DPL")
51 ADD_DEFINITIONS("-DDPL_LOGS_ENABLED")
53 MESSAGE(STATUS "Enable DLOG backend")
54 ADD_DEFINITIONS("-DDPL_DLOG_ENABLED")
57 MESSAGE(STATUS "Logging disabled for DPL")
60 OPTION(BUILD_ALL_TESTS "Build all tests" ON)
67 ENDIF(BUILD_ALL_TESTS)
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.
73 ADD_DEFINITIONS("-fPIC")
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")
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}\"")
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")
94 ADD_DEFINITIONS("-DWRT_SMACK_ENABLED")
97 IF(NOT DEFINED SHARE_INSTALL_PREFIX)
98 SET(SHARE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}/share")
99 ENDIF(NOT DEFINED SHARE_INSTALL_PREFIX)
101 ############################# Targets names ###################################
103 SET(TARGET_CKM_TESTS "ckm-tests")
104 SET(TARGET_CKMI_TESTS "ckm-integration-tests")
105 SET(COMMON_TARGET_TEST "tests-common")
107 ############################# subdirectories ##################################
109 ADD_SUBDIRECTORY(src)
112 ADD_SUBDIRECTORY(tests)
113 ENDIF(BUILD_ALL_TESTS)