Fix C# TCT RemovePersistentGroup_CHECK_NO_EXCEPTION issue
[platform/core/connectivity/wifi-direct-manager.git] / src / 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 INCLUDE_DIRECTORIES(
18         ${CMAKE_SOURCE_DIR}/include
19         ${CMAKE_SOURCE_DIR}/oem
20         )
21
22 IF(TIZEN_ENABLE_PRD)
23 INCLUDE_DIRECTORIES(
24         ${CMAKE_SOURCE_DIR}/prd/include
25         )
26 ENDIF(TIZEN_ENABLE_PRD)
27
28 AUX_SOURCE_DIRECTORY(./ SRCS)
29 SET(SRCS ${SRCS} ${CMAKE_SOURCE_DIR}/oem/wifi-direct-oem.c)
30 IF(TIZEN_ENABLE_PRD)
31         SET(SRCS ${SRCS} ${CMAKE_SOURCE_DIR}/prd/src/wifi-direct-prd.c)
32 ENDIF(TIZEN_ENABLE_PRD)
33
34 PKG_CHECK_MODULES(daemon_pkgs REQUIRED capi-network-wifi-direct glib-2.0
35                 gio-2.0 gobject-2.0 dlog libnl-3.0 capi-appfw-application vconf aul
36                 libsystemd capi-system-info libtzplatform-config ${MDM_REQUIRED_PKGS})
37
38 FOREACH(flag ${daemon_pkgs_CFLAGS})
39         SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
40 ENDFOREACH(flag)
41
42 INCLUDE_DIRECTORIES($(daemon_pkgs_INCLUDE_DIRS))
43 LINK_DIRECTORIES($(daemon_pkgs_LIBRARY_DIRS))
44
45 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -g -Werror -fPIE")
46 SET(CMAKE_C_FLAGS_DEBUG "O0 -g -fPIE")
47 SET(CMAKE_C_FLAGS_RELEASE "O2 -fPIE")
48
49 SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -pie")
50
51 ADD_EXECUTABLE(${DAEMON} ${SRCS})
52
53 TARGET_LINK_LIBRARIES(${DAEMON} ${daemon_pkgs_LDFLAGS} -ldl)
54 INSTALL(TARGETS ${DAEMON} DESTINATION bin)