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 ${CMAKE_SOURCE_DIR}/include
19 ${CMAKE_SOURCE_DIR}/oem
24 ${CMAKE_SOURCE_DIR}/prd/include
26 ENDIF(TIZEN_ENABLE_PRD)
28 AUX_SOURCE_DIRECTORY(./ SRCS)
29 SET(SRCS ${SRCS} ${CMAKE_SOURCE_DIR}/oem/wifi-direct-oem.c)
31 SET(SRCS ${SRCS} ${CMAKE_SOURCE_DIR}/prd/src/wifi-direct-prd.c)
32 ENDIF(TIZEN_ENABLE_PRD)
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})
38 FOREACH(flag ${daemon_pkgs_CFLAGS})
39 SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
42 INCLUDE_DIRECTORIES($(daemon_pkgs_INCLUDE_DIRS))
43 LINK_DIRECTORIES($(daemon_pkgs_LIBRARY_DIRS))
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")
49 SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -pie")
51 ADD_EXECUTABLE(${DAEMON} ${SRCS})
53 TARGET_LINK_LIBRARIES(${DAEMON} ${daemon_pkgs_LDFLAGS} -ldl)
54 INSTALL(TARGETS ${DAEMON} DESTINATION bin)