Remove needless handle for stc
[platform/core/api/smart-traffic-control.git] / CMakeLists.txt
1 # Copyright (c) 2017 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 SET(fw_name "capi-network-stc")
22 PROJECT(${fw_name})
23
24 ############################# cmake packages ##################################
25
26 INCLUDE(FindPkgConfig)
27
28 ########################## search for packages ################################
29
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")
32
33
34 PKG_CHECK_MODULES(STC_DEPS REQUIRED ${COMMON_DEPS})
35
36 #########################  package configuration  #############################
37 SET(PC_NAME ${fw_name})
38 SET(PC_REQUIRED ${PC_DEPS})
39 SET(PC_LDFLAGS -l${fw_name})
40
41 ############################# compiler flags ##################################
42 FOREACH(flag ${STC_DEPS_CFLAGS})
43     SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
44 ENDFOREACH(flag)
45
46
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")
51
52 # Don't export symbols by default
53 ADD_DEFINITIONS("-fvisibility=hidden")
54 ADD_DEFINITIONS("-DUSE_DLOG")
55
56 SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -Wl,--rpath=${LIBDIR}")
57
58 SET(TARGET_STC "capi-network-stc")
59 SET(TARGET_STC_TEST "stc_test")
60
61 SET(STC_PATH ${PROJECT_SOURCE_DIR}/src)
62 SET(STC_INTERNAL_PATH ${PROJECT_SOURCE_DIR}/src/internal)
63
64 ADD_SUBDIRECTORY(include)
65 ADD_SUBDIRECTORY(src)
66 ADD_SUBDIRECTORY(pkgconfig)
67 ADD_SUBDIRECTORY(test)