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.
17 CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
21 IF(NOT DEFINED VERSION)
23 ENDIF(NOT DEFINED VERSION)
25 INCLUDE(FindPkgConfig)
27 IF(NOT CMAKE_BUILD_TYPE)
28 SET(CMAKE_BUILD_TYPE "DEBUG")
29 ENDIF(NOT CMAKE_BUILD_TYPE)
31 SET(KRATE_API ${PROJECT_SOURCE_DIR}/api)
32 SET(KRATE_LIB ${PROJECT_SOURCE_DIR}/lib)
33 SET(KRATE_SERVER ${PROJECT_SOURCE_DIR}/server)
34 SET(KRATE_DATA ${PROJECT_SOURCE_DIR}/data)
35 SET(KRATE_TOOLS ${PROJECT_SOURCE_DIR}/tools)
36 SET(KRATE_MODULE ${PROJECT_SOURCE_DIR}/module)
37 SET(KRATE_VOLUME ${PROJECT_SOURCE_DIR}/volume)
39 IF("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.7)
45 SET(COMPILE_BASE_FLAGS "-g -fPIC -Werror -Wall -Wl,--as-needed -Wl,--no-whole-archive")
46 SET(CMAKE_C_FLAGS_PROFILING "${COMPILE_BASE_FLAGS} -O0 -pg")
47 SET(CMAKE_CXX_FLAGS_PROFILING "${COMPILE_BASE_FLAGS} -O0 -pg -std=${CXX_STD} -fno-rtti")
48 SET(CMAKE_C_FLAGS_DEBUG "${COMPILE_BASE_FLAGS} -O0 -ggdb")
49 SET(CMAKE_CXX_FLAGS_DEBUG "${COMPILE_BASE_FLAGS} -O0 -ggdb -std=${CXX_STD} -fno-rtti")
50 SET(CMAKE_C_FLAGS_RELEASE "${COMPILE_BASE_FLAGS} -O2 -DNDEBUG")
51 SET(CMAKE_CXX_FLAGS_RELEASE "${COMPILE_BASE_FLAGS} -O2 -DNDEBUG -std=${CXX_STD} -fno-rtti")
52 SET(CMAKE_C_FLAGS_CCOV "${COMPILE_BASE_FLAGS} -O0 --coverage")
53 SET(CMAKE_CXX_FLAGS_CCOV "${COMPILE_BASE_FLAGS} -O0 --coverage -std=${CXX_STD} -fno-rtti")
55 IF(NOT DEFINED LIB_DIR)
56 SET(LIB_DIR "${CMAKE_INSTALL_LIBDIR}")
57 ENDIF(NOT DEFINED LIB_DIR)
59 IF(NOT DEFINED INCLUDE_DIR)
60 SET(INCLUDE__DIR "${CMAKE_INSTALL_INCLUDEDIR}")
61 ENDIF(NOT DEFINED INCLUDE_DIR)
63 IF(NOT DEFINED RUN_DIR)
65 ENDIF(NOT DEFINED RUN_DIR)
67 IF(NOT DEFINED BIN_DIR)
68 SET(BIN_DIR "${CMAKE_INSTALL_BINDIR}")
69 ENDIF(NOT DEFINED BIN_DIR)
71 IF(NOT DEFINED HOME_DIR)
73 ENDIF(NOT DEFINED HOME_DIR)
75 IF(NOT DEFINED PAMD_DIR)
76 SET(PAMD_DIR "${SYSCONF_INSTALL_DIR}/pam.d")
77 ENDIF(NOT DEFINED PAMD_DIR)
79 IF(NOT DEFINED SYSTEMD_UNIT_DIR)
80 SET(SYSTEMD_UNIT_DIR "${CMAKE_INSTALL_PREFIX}/lib/systemd/system")
81 ENDIF(NOT DEFINED SYSTEMD_UNIT_DIR)
83 ADD_DEFINITIONS(-DUG_WAYLAND)
85 ADD_SUBDIRECTORY(${KRATE_LIB})
86 ADD_SUBDIRECTORY(${KRATE_SERVER})
87 ADD_SUBDIRECTORY(${KRATE_MODULE})
88 ADD_SUBDIRECTORY(${KRATE_VOLUME})
89 ADD_SUBDIRECTORY(${KRATE_TOOLS})