84e75373a48dbf8b56a55e82c33f9a1f69c91f19
[platform/core/api/asp.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 #
17
18 ############################# Check minimum CMake version #####################
19
20 CMAKE_MINIMUM_REQUIRED(VERSION 2.8.3)
21 PROJECT(capi-network-asp)
22
23 ############################# cmake packages ##################################
24
25 INCLUDE(FindPkgConfig)
26
27 ########################## search for packages ################################
28
29 SET(COMMON_DEPS "dlog glib-2.0 gio-2.0 capi-base-common capi-system-info gio-unix-2.0")
30 SET(PC_DEPS "capi-base-common")
31
32
33 PKG_CHECK_MODULES(ASP_DEPS REQUIRED ${COMMON_DEPS})
34
35 ########################  directory configuration  ############################
36
37 ############################# compiler flags ##################################
38 FOREACH(flag ${ASP_DEPS_CFLAGS})
39     SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
40 ENDFOREACH(flag)
41
42
43 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fPIC -Wall")
44 SET(CMAKE_C_FLAGS_DEBUG      "-O0 -g")
45 SET(CMAKE_C_FLAGS_RELEASE    "-O2 -g")
46
47 # Don't export symbols by default
48 ADD_DEFINITIONS("-fvisibility=hidden")
49 ADD_DEFINITIONS("-DUSE_DLOG")
50
51 SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -Wl,--rpath=${LIBDIR}")
52
53 SET(TARGET_ASP "asp")
54 SET(TARGET_ASP_TEST "asp-test")
55
56
57 ADD_SUBDIRECTORY(include)