1 # Copyright (c) 2011 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
20 ############################# Check minimum CMake version #####################
22 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
23 PROJECT("security-server")
25 ############################# cmake packages ##################################
27 INCLUDE(FindPkgConfig)
29 ############################# compilation defines #############################
33 ############################# compiler flags ##################################
35 SET(CMAKE_C_FLAGS_PROFILING "-O0 -g -pg")
36 SET(CMAKE_CXX_FLAGS_PROFILING "-O0 -std=c++0x -g -pg")
37 SET(CMAKE_C_FLAGS_DEBUG "-O0 -g")
38 SET(CMAKE_CXX_FLAGS_DEBUG "-O0 -std=c++0x -g")
39 SET(CMAKE_C_FLAGS_RELEASE "-O2 -g")
40 SET(CMAKE_CXX_FLAGS_RELEASE "-O2 -std=c++0x -g")
41 SET(CMAKE_C_FLAGS_CCOV "-O2 -g --coverage")
42 SET(CMAKE_CXX_FLAGS_CCOV "-O2 -std=c++0x -g --coverage")
44 # If supported for the target machine, emit position-independent code,suitable
45 # for dynamic linking and avoiding any limit on the size of the global offset
46 # table. This option makes a difference on the m68k, PowerPC and SPARC.
48 ADD_DEFINITIONS("-fPIC")
51 # Set compiler warning flags
52 ADD_DEFINITIONS("-Wall") # Generate all warnings
53 ADD_DEFINITIONS("-Wextra") # Generate even more extra warnings
55 STRING(REGEX MATCH "([^.]*)" API_VERSION "${VERSION}")
56 ADD_DEFINITIONS("-DAPI_VERSION=\"$(API_VERSION)\"")
58 SET(TARGET_SECURITY_SERVER "security-server")
59 SET(TARGET_SECURITY_CLIENT "security-server-client")
62 ADD_SUBDIRECTORY(build)