Remove deprecated GTest-based unit tests
[platform/core/security/askuser.git] / CMakeLists.txt
1 # Copyright (c) 2014-2020 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      Adam Malinowski <a.malinowsk2@partner.samsung.com>
17 # @author      Oskar Switalski <o.switalski@samsung.com>
18 #
19
20 ############################# Check minimum CMake version #####################
21
22 CMAKE_MINIMUM_REQUIRED(VERSION 2.8.3)
23 PROJECT("askuser")
24 SET(ASKUSER_VERSION_MAJOR 0)
25 SET(ASKUSER_VERSION ${ASKUSER_VERSION_MAJOR}.5.8)
26
27 ############################# cmake packages ##################################
28
29 INCLUDE(FindPkgConfig)
30 INCLUDE(CheckCXXCompilerFlag)
31
32 #############################  install dirs  ##################################
33
34 SET(BIN_INSTALL_DIR
35     "${CMAKE_INSTALL_PREFIX}/bin"
36     CACHE PATH
37     "Binary installation directory")
38
39 ############################# compiler flags ##################################
40
41 SET(CMAKE_CXX_FLAGS_PROFILING  "-O0 -g -pg")
42 SET(CMAKE_CXX_FLAGS_DEBUG      "-O0 -g -ggdb")
43 SET(CMAKE_CXX_FLAGS_RELEASE    "-O2 -g")
44 SET(CMAKE_CXX_FLAGS_CCOV       "-O2 -g --coverage")
45
46 # Check for C++11 support and enable proper compilation flags
47 CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
48 CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X)
49 IF(COMPILER_SUPPORTS_CXX11)
50     SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
51 ELSEIF(COMPILER_SUPPORTS_CXX0X)
52     SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
53 ELSE()
54     MESSAGE(STATUS "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler.")
55 ENDIF()
56
57 # Set compiler warning flags
58 ADD_DEFINITIONS("-Werror")                      # Make all warnings into errors.
59 ADD_DEFINITIONS("-Wall")                        # Generate all warnings
60 ADD_DEFINITIONS("-Wextra")                      # Generate even more extra warnings
61
62 # Don't export symbols by default
63 ADD_DEFINITIONS("-fvisibility=hidden")
64
65 IF (CMAKE_BUILD_TYPE MATCHES "DEBUG")
66     ADD_DEFINITIONS("-DBUILD_TYPE_DEBUG")
67 ENDIF (CMAKE_BUILD_TYPE MATCHES "DEBUG")
68
69 IF (BUILD_WITH_SYSTEMD_DAEMON)
70     ADD_DEFINITIONS("-DBUILD_WITH_SYSTEMD_DAEMON")
71 ENDIF (BUILD_WITH_SYSTEMD_DAEMON)
72
73 IF (RES_DIR)
74     ADD_DEFINITIONS("-DRES_DIR=\"${RES_DIR}\"")
75 ELSE (RES_DIR)
76     ADD_DEFINITIONS("-DRES_DIR=\"/usr/share/askuser-notification/res/\"")
77 ENDIF (RES_DIR)
78
79 SET(ASKUSER_PATH ${PROJECT_SOURCE_DIR}/src)
80
81 SET(TARGET_PLUGIN_SERVICE "askuser-plugin-service")
82 SET(TARGET_ASKUSER_NOTIFICATION "askuser-notification")
83 SET(TARGET_ASKUSER_COMMON "askuser-notification-common")
84 SET(TARGET_ASKUSER_NOTIFICATION_LIB "askuser-notification-ipc")
85 SET(TARGET_ASKUSER_NOTIFICATION_LIB_TEST "askuser-notification-test")
86 SET(TARGET_ASKUSER_NOTIFICATION_CLIENT_LIB "askuser-notification-client")
87 SET(TARGET_PRIVACY_PRIVILEGE_MANAGER_CAPI_LIB "capi-privacy-privilege-manager")
88 SET(TARGET_PRIVACY_PRIVILEGE_MANAGER_TEST "capi-privacy-privilege-manager-test")
89
90 ADD_SUBDIRECTORY(src/plugin)
91 ADD_SUBDIRECTORY(src/notification-daemon)
92 ADD_SUBDIRECTORY(src/common)
93 ADD_SUBDIRECTORY(src/ipc)
94 ADD_SUBDIRECTORY(src/client)
95 ADD_SUBDIRECTORY(src/capi)
96
97 ADD_SUBDIRECTORY(pkgconfig)
98
99 IF (BUILD_WITH_SYSTEMD_DAEMON)
100 ADD_SUBDIRECTORY(systemd)
101 ENDIF (BUILD_WITH_SYSTEMD_DAEMON)