Added ntp enable feature when profile is ivi
[platform/core/connectivity/net-config.git] / CMakeLists.txt
1 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
2 PROJECT(net-config C)
3 SET(PACKAGE ${PROJECT_NAME})
4 SET(PREFIX ${CMAKE_INSTALL_PREFIX})
5 SET(BINDIR "${PREFIX}/sbin")
6 SET(DATADIR "${PREFIX}/share")
7 SET(LIBDIR "${PREFIX}/lib")
8 SET(INTERFACES "${CMAKE_SOURCE_DIR}/interfaces")
9
10 SET(SRCS
11         src/main.c
12         src/wifi-tdls.c
13         src/wifi.c
14         src/neterror.c
15         src/wifi-eap.c
16         src/wifi-wps.c
17         src/wifi-agent.c
18         src/wifi-power.c
19         src/wifi-state.c
20         src/cellular-state.c
21         src/wifi-passpoint.c
22         src/utils/log.c
23         src/utils/util.c
24         src/vpnsvc.c
25         src/vpnsvc-internal.c
26         src/dbus/netdbus.c
27         src/network-clock.c
28         src/network-state.c
29         src/network-dpm.c
30         src/network-monitor.c
31         src/wifi-firmware.c
32         src/wifi-indicator.c
33         src/signal-handler.c
34         src/wifi-ssid-scan.c
35         src/utils/emulator.c
36         src/wifi-eap-config.c
37         src/network-statistics.c
38         src/dbus/netsupplicant.c
39         src/wifi-background-scan.c
40         src/wifi-tel-intf.c
41         src/wifi-config.c
42         )
43
44 IF("${CMAKE_BUILD_TYPE}" STREQUAL "")
45         SET(CMAKE_BUILD_TYPE "Release")
46 ENDIF("${CMAKE_BUILD_TYPE}" STREQUAL "")
47 MESSAGE("Build type: ${CMAKE_BUILD_TYPE}")
48
49 IF(TIZEN_WLAN_PASSPOINT)
50         ADD_DEFINITIONS(-DTIZEN_WLAN_PASSPOINT)
51 ENDIF(TIZEN_WLAN_PASSPOINT)
52
53 IF(TIZEN_WLAN_USE_P2P_INTERFACE)
54         ADD_DEFINITIONS(-DTIZEN_WLAN_USE_P2P_INTERFACE)
55 ENDIF(TIZEN_WLAN_USE_P2P_INTERFACE)
56
57 IF(TIZEN_P2P_ENABLE)
58         ADD_DEFINITIONS(-DTIZEN_P2P_ENABLE)
59         SET(P2P_REQUIRED_PKGS "capi-network-wifi-direct")
60 ENDIF(TIZEN_P2P_ENABLE)
61
62 IF(TIZEN_TETHERING_ENABLE)
63         ADD_DEFINITIONS(-DTIZEN_TETHERING_ENABLE)
64 ENDIF(TIZEN_TETHERING_ENABLE)
65
66 IF(TIZEN_CAPTIVE_PORTAL)
67         ADD_DEFINITIONS(-DTIZEN_CAPTIVE_PORTAL)
68         SET(SRCS ${SRCS} src/utils/network-accessibility.c)
69 ENDIF(TIZEN_CAPTIVE_PORTAL)
70
71 IF(TIZEN_TV)
72        ADD_DEFINITIONS(-DTIZEN_TV)
73 ENDIF(TIZEN_TV)
74
75 IF(TIZEN_WEARABLE)
76         ADD_DEFINITIONS(-DTIZEN_WEARABLE)
77 ENDIF(TIZEN_WEARABLE)
78
79 IF(TIZEN_TELEPHONY_ENABLE)
80         ADD_DEFINITIONS(-DTIZEN_TELEPHONY_ENABLE)
81 ENDIF(TIZEN_TELEPHONY_ENABLE)
82
83 IF(TIZEN_NTP_ENABLE)
84         ADD_DEFINITIONS(-DTIZEN_NTP_ENABLE)
85 ENDIF(TIZEN_NTP_ENABLE)
86
87 IF(TIZEN_WLAN_BOARD_SPRD)
88         ADD_DEFINITIONS(-DTIZEN_WLAN_BOARD_SPRD)
89 ENDIF(TIZEN_WLAN_BOARD_SPRD)
90
91 INCLUDE(FindPkgConfig)
92 PKG_CHECK_MODULES(pkgs REQUIRED
93         dlog
94         tapi
95         vconf
96         bundle
97         gio-2.0
98         glib-2.0
99         gio-unix-2.0
100         eventsystem
101         alarm-service
102         syspopup-caller
103         capi-system-info
104         capi-appfw-application
105         ${P2P_REQUIRED_PKGS}
106         ${WEARABLE_REQUIRED_PKGS}
107         )
108
109 FOREACH(flag ${pkgs_CFLAGS})
110         SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
111 ENDFOREACH(flag)
112
113 SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -Wall -Werror -fvisibility=hidden")
114 SET(EXTRA_CXXFLAGS "${EXTRA_CXXFLAGS} -Wall -Werror -fvisibility=hidden -fvisibility-inlines-hidden")
115 SET(CMAKE_C_FLAGS "-I${CMAKE_SOURCE_DIR} -I${CMAKE_SOURCE_DIR}/include ${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fPIE")
116 SET(CMAKE_C_FLAGS_DEBUG "-O0 -g -fPIE")
117 SET(CMAKE_C_FLAGS_RELEASE "-O2 -fPIE")
118
119 IF(WLAN_CONCURRENT_MODE)
120         ADD_DEFINITIONS(-DWLAN_CONCURRENT_MODE)
121 ENDIF(WLAN_CONCURRENT_MODE)
122
123 FIND_PROGRAM(UNAME NAMES uname)
124 EXEC_PROGRAM("${UNAME}" ARGS "-m"
125 OUTPUT_VARIABLE "ARCH")
126 IF("${ARCH}" STREQUAL "arm")
127         ADD_DEFINITIONS("-DTARGET_ARM")
128         MESSAGE("add -DTARGET_ARM")
129 ENDIF("${ARCH}" STREQUAL "arm")
130
131 ADD_DEFINITIONS("-DPACKAGE=\"${PACKAGE}\"")
132 ADD_DEFINITIONS("-DPREFIX=\"${PREFIX}\"")
133
134 SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -pie")
135
136 ADD_CUSTOM_COMMAND(
137         WORKING_DIRECTORY
138         OUTPUT ${CMAKE_SOURCE_DIR}/generated-code.c
139         COMMAND gdbus-codegen --interface-prefix net.netconfig.
140                         --generate-c-code generated-code
141                         --c-generate-object-manager
142                         --generate-docbook generated-code-docs
143                         ${INTERFACES}/netconfig-iface-network-state.xml ${INTERFACES}/netconfig-iface-network-statistics.xml ${INTERFACES}/netconfig-iface-wifi.xml ${INTERFACES}/netconfig-iface-vpnsvc.xml
144                         COMMENT "Generating GDBus .c/.h")
145
146 ADD_EXECUTABLE(${PROJECT_NAME} ${SRCS} ${CMAKE_SOURCE_DIR}/generated-code.c)
147
148 TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_LDFLAGS} ${PCAP_LIB})
149
150 INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${BINDIR})