2 # Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
8 # http://www.apache.org/licenses/LICENSE-2.0
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
16 CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
18 PROJECT(device-policy-client)
20 INCLUDE(FindPkgConfig)
22 IF(NOT CMAKE_BUILD_TYPE)
23 SET(CMAKE_BUILD_TYPE "DEBUG")
24 ENDIF(NOT CMAKE_BUILD_TYPE)
26 SET(DPM_LIBS ${PROJECT_SOURCE_DIR}/libs)
28 IF("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.7)
34 SET(COMPILE_BASE_FLAGS "-g -fPIC -Werror -Wall -Wl,--as-needed -Wl,--no-whole-archive")
35 SET(CMAKE_C_FLAGS_PROFILING "${COMPILE_BASE_FLAGS} -O0 -pg")
36 SET(CMAKE_CXX_FLAGS_PROFILING "${COMPILE_BASE_FLAGS} -O0 -pg -std=${CXX_STD} -fno-rtti")
37 SET(CMAKE_C_FLAGS_DEBUG "${COMPILE_BASE_FLAGS} -O0 -ggdb")
38 SET(CMAKE_CXX_FLAGS_DEBUG "${COMPILE_BASE_FLAGS} -O0 -ggdb -std=${CXX_STD} -fno-rtti")
39 SET(CMAKE_C_FLAGS_RELEASE "${COMPILE_BASE_FLAGS} -O2 -DNDEBUG")
40 SET(CMAKE_CXX_FLAGS_RELEASE "${COMPILE_BASE_FLAGS} -O2 -DNDEBUG -std=${CXX_STD} -fno-rtti")
41 SET(CMAKE_C_FLAGS_CCOV "${COMPILE_BASE_FLAGS} -O0 --coverage")
42 SET(CMAKE_CXX_FLAGS_CCOV "${COMPILE_BASE_FLAGS} -O0 --coverage -std=${CXX_STD} -fno-rtti")
44 IF(NOT DEFINED LIB_INSTALL_DIR)
45 SET(LIB_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}")
46 ENDIF(NOT DEFINED LIB_INSTALL_DIR)
48 IF(NOT DEFINED INCLUDE_INSTALL_DIR)
49 SET(INCLUDE_INSTALL_DIR "${CMAKE_INSTALL_INCLUDEDIR}")
50 ENDIF(NOT DEFINED INCLUDE_INSTALL_DIR)
52 IF(NOT DEFINED TEST_DATA_INSTALL_DIR)
53 SET(TEST_DATA_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/share/dpm")
54 ENDIF(NOT DEFINED TEST_DATA_INSTALL_DIR)
56 ADD_DEFINITIONS(-DUG_WAYLAND)
58 ADD_SUBDIRECTORY(${DPM_LIBS})