Fix for proc/<pid>/status line extraction crash
[platform/core/security/security-manager.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
17 # @brief
18 #
19
20 ############################# Check minimum CMake version #####################
21
22 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
23 PROJECT("security-server")
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              "-g")
36 SET(CMAKE_CXX_FLAGS            "-g -std=c++0x")
37 SET(CMAKE_C_FLAGS_PROFILING    "-O0 -pg")
38 SET(CMAKE_CXX_FLAGS_PROFILING  "-O0 -pg")
39 SET(CMAKE_C_FLAGS_DEBUG        "-O0 -ggdb")
40 SET(CMAKE_CXX_FLAGS_DEBUG      "-O0 -ggdb")
41 SET(CMAKE_C_FLAGS_RELEASE      "-O2")
42 SET(CMAKE_CXX_FLAGS_RELEASE    "-O2")
43 SET(CMAKE_C_FLAGS_CCOV         "-O2 --coverage")
44 SET(CMAKE_CXX_FLAGS_CCOV       "-O2 --coverage")
45
46 # If supported for the target machine, emit position-independent code,suitable
47 # for dynamic linking and avoiding any limit on the size of the global offset
48 # table. This option makes a difference on the m68k, PowerPC and SPARC.
49 # (BJ: our ARM too?)
50 ADD_DEFINITIONS("-fPIC")
51
52
53 # Set compiler warning flags
54 ADD_DEFINITIONS("-Werror")                      # Make all warnings into errors.
55 ADD_DEFINITIONS("-Wall")                        # Generate all warnings
56 ADD_DEFINITIONS("-Wextra")                      # Generate even more extra warnings
57
58 STRING(REGEX MATCH "([^.]*)" API_VERSION "${VERSION}")
59 ADD_DEFINITIONS("-DAPI_VERSION=\"$(API_VERSION)\"")
60 ADD_DEFINITIONS("-DSMACK_ENABLED")
61 ADD_DEFINITIONS("-DDPL_LOGS_ENABLED")           # Enable LOGS in security-server2
62 #ADD_DEFINITIONS("-DUSE_SEC_SRV1_FOR_CHECK_PRIVILEGE_BY_PID") #use old security-server 1.0 for check-privilege-by-pid API
63
64 SET(TARGET_SECURITY_SERVER "security-server")
65 SET(TARGET_SECURITY_CLIENT "security-server-client")
66 SET(TARGET_SERVER_COMMON "security-server-commons")
67
68 INSTALL(FILES
69     ${CMAKE_SOURCE_DIR}/packaging/libsecurity-server-client.manifest
70     ${CMAKE_SOURCE_DIR}/packaging/security-server.manifest
71     DESTINATION
72     /usr/share
73 )
74
75 ADD_SUBDIRECTORY(src)
76 ADD_SUBDIRECTORY(build)
77 ADD_SUBDIRECTORY(systemd)