1 # Copyright (c) 2014-2015 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
18 ############################# Check minimum CMake version #####################
20 CMAKE_MINIMUM_REQUIRED(VERSION 2.8.3)
21 PROJECT(capi-network-asp)
23 ############################# cmake packages ##################################
25 INCLUDE(FindPkgConfig)
27 ########################## search for packages ################################
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")
33 PKG_CHECK_MODULES(ASP_DEPS REQUIRED ${COMMON_DEPS})
35 ######################## directory configuration ############################
37 ############################# compiler flags ##################################
38 FOREACH(flag ${ASP_DEPS_CFLAGS})
39 SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
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")
47 # Don't export symbols by default
48 ADD_DEFINITIONS("-fvisibility=hidden")
49 ADD_DEFINITIONS("-DUSE_DLOG")
51 SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -Wl,--rpath=${LIBDIR}")
54 SET(TARGET_ASP_TEST "asp-test")
57 ADD_SUBDIRECTORY(include)