Add internal popup implementation
[platform/core/security/askuser.git] / CMakeLists.txt
1 # Copyright (c) 2014-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      Adam Malinowski <a.malinowsk2@partner.samsung.com>
17 #
18
19 ############################# Check minimum CMake version #####################
20
21 CMAKE_MINIMUM_REQUIRED(VERSION 2.8.3)
22 PROJECT("askuser")
23 set(ASKUSER_VERSION 0.1.0)
24
25 ############################# cmake packages ##################################
26
27 INCLUDE(FindPkgConfig)
28 INCLUDE(CheckCXXCompilerFlag)
29
30 #############################  install dirs  ##################################
31
32 SET(BIN_INSTALL_DIR
33     "${CMAKE_INSTALL_PREFIX}/bin"
34     CACHE PATH
35     "Binary installation directory")
36
37 ############################# compiler flags ##################################
38
39 SET(CMAKE_CXX_FLAGS_PROFILING  "-O0 -g -pg")
40 SET(CMAKE_CXX_FLAGS_DEBUG      "-O0 -g -ggdb")
41 SET(CMAKE_CXX_FLAGS_RELEASE    "-O2 -g")
42 SET(CMAKE_CXX_FLAGS_CCOV       "-O2 -g --coverage")
43
44 # Check for C++11 support and enable proper compilation flags
45 CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
46 CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X)
47 IF(COMPILER_SUPPORTS_CXX11)
48     SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
49 ELSEIF(COMPILER_SUPPORTS_CXX0X)
50     SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
51 ELSE()
52     MESSAGE(STATUS "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler.")
53 ENDIF()
54
55 # Set compiler warning flags
56 ADD_DEFINITIONS("-Werror")                      # Make all warnings into errors.
57 ADD_DEFINITIONS("-Wall")                        # Generate all warnings
58 ADD_DEFINITIONS("-Wextra")                      # Generate even more extra warnings
59
60 # Don't export symbols by default
61 ADD_DEFINITIONS("-fvisibility=hidden")
62
63 # Pass project name to sources
64 ADD_DEFINITIONS("-DPROJECT_NAME=\"${PROJECT_NAME}\"")
65
66 IF (CMAKE_BUILD_TYPE MATCHES "DEBUG")
67     ADD_DEFINITIONS("-DBUILD_TYPE_DEBUG")
68 ENDIF (CMAKE_BUILD_TYPE MATCHES "DEBUG")
69
70 SET(TARGET_ASKUSER "askuser")
71 SET(TARGET_ASKUSER_COMMON "askuser-common")
72 SET(TARGET_PLUGIN_SERVICE "askuser-plugin-service")
73 SET(TARGET_PLUGIN_CLIENT "askuser-plugin-client")
74 SET(TARGET_CLIENT "askuser-test-client")
75 SET(TARGET_ASKUSER_POPUP "askuser-popup")
76
77 # Add definition for popup binary path
78 ADD_DEFINITIONS(-DPOPUP_EXEC_PATH="${BIN_INSTALL_DIR}/${TARGET_ASKUSER_POPUP}")
79
80 ADD_SUBDIRECTORY(src)
81 ADD_SUBDIRECTORY(systemd)
82 ADD_SUBDIRECTORY(test)