1 # Copyright (c) 2017 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 SET(fw_name "capi-network-stc")
24 ############################# cmake packages ##################################
26 INCLUDE(FindPkgConfig)
28 ########################## search for packages ################################
30 SET(COMMON_DEPS "dlog glib-2.0 gio-2.0 capi-base-common capi-system-info gio-unix-2.0 gthread-2.0")
31 SET(PC_DEPS "capi-base-common")
34 PKG_CHECK_MODULES(STC_DEPS REQUIRED ${COMMON_DEPS})
36 ######################### package configuration #############################
37 SET(PC_NAME ${fw_name})
38 SET(PC_REQUIRED ${PC_DEPS})
39 SET(PC_LDFLAGS -l${fw_name})
41 ############################# compiler flags ##################################
42 FOREACH(flag ${STC_DEPS_CFLAGS})
43 SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
47 #SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fPIC -Wall -fprofile-arcs -ftest-coverage")
48 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fPIC -Wall -Werror")
49 SET(CMAKE_C_FLAGS_DEBUG "-O0 -g")
50 SET(CMAKE_C_FLAGS_RELEASE "-O2 -g")
52 # Don't export symbols by default
53 ADD_DEFINITIONS("-fvisibility=hidden")
54 ADD_DEFINITIONS("-DUSE_DLOG")
56 SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -Wl,--rpath=${LIBDIR}")
58 SET(TARGET_STC "capi-network-stc")
59 SET(TARGET_STC_TEST "stc_test")
61 SET(STC_PATH ${PROJECT_SOURCE_DIR}/src)
62 SET(STC_INTERNAL_PATH ${PROJECT_SOURCE_DIR}/src/internal)
64 ADD_SUBDIRECTORY(include)
66 ADD_SUBDIRECTORY(pkgconfig)
67 ADD_SUBDIRECTORY(test)