Remove syspopup
[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
9 SET(SRCS
10         src/main.c
11         src/neterror.c
12         src/wifi.c
13         src/wifi-power.c
14         src/wifi-state.c
15         src/wifi-eap.c
16         src/wifi-passpoint.c
17         src/network-clock.c
18         src/network-state.c
19         src/network-statistics.c
20         src/wifi-indicator.c
21         src/signal-handler.c
22         src/wifi-ssid-scan.c
23         src/wifi-background-scan.c
24         src/wifi-agent.c
25         src/wifi-eap-config.c
26         src/dbus/netdbus.c
27         src/dbus/netsupplicant.c
28         src/utils/util.c
29         src/utils/emulator.c
30         src/utils/mdm-private.c
31         )
32
33 IF("${CMAKE_BUILD_TYPE}" STREQUAL "")
34         SET(CMAKE_BUILD_TYPE "Release")
35 ENDIF("${CMAKE_BUILD_TYPE}" STREQUAL "")
36 MESSAGE("Build type: ${CMAKE_BUILD_TYPE}")
37
38 INCLUDE(FindPkgConfig)
39 PKG_CHECK_MODULES(pkgs REQUIRED
40         glib-2.0
41         dbus-glib-1
42         dlog
43         vconf
44         wifi-direct
45         tapi
46         libsystemd-daemon)
47
48 FOREACH(flag ${pkgs_CFLAGS})
49         SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
50 ENDFOREACH(flag)
51
52 SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -fvisibility=hidden -Wall")
53 SET(CMAKE_C_FLAGS "-I${CMAKE_SOURCE_DIR}/include ${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}")
54 SET(CMAKE_C_FLAGS_DEBUG "-O0 -g")
55 SET(CMAKE_C_FLAGS_RELEASE "-O2")
56
57 FIND_PROGRAM(UNAME NAMES uname)
58 EXEC_PROGRAM("${UNAME}" ARGS "-m"
59 OUTPUT_VARIABLE "ARCH")
60 IF("${ARCH}" STREQUAL "arm")
61         ADD_DEFINITIONS("-DEMBEDDED_TARGET")
62         MESSAGE("add -DEMBEDDED_TARGET")
63 ENDIF("${ARCH}" STREQUAL "arm")
64
65 ADD_DEFINITIONS("-DPACKAGE=\"${PACKAGE}\"")
66 ADD_DEFINITIONS("-DPREFIX=\"${PREFIX}\"")
67
68 SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed")
69
70 ADD_EXECUTABLE(${PROJECT_NAME} ${SRCS})
71 TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_LDFLAGS})
72
73 ADD_CUSTOM_TARGET(netconfig-iface-network-state-glue.h
74         COMMAND dbus-binding-tool --mode=glib-server --prefix=netconfig_iface_network_state
75         --output=${CMAKE_SOURCE_DIR}/include/netconfig-iface-network-state-glue.h
76         ${CMAKE_SOURCE_DIR}/interfaces/netconfig-iface-network-state.xml
77         DEPENDS ${CMAKE_SOURCE_DIR}/interfaces/netconfig-iface-network-state.xml
78 )
79 ADD_CUSTOM_TARGET(netconfig-iface-network-statistics-glue.h
80         COMMAND dbus-binding-tool --mode=glib-server --prefix=netconfig_iface_network_statistics
81         --output=${CMAKE_SOURCE_DIR}/include/netconfig-iface-network-statistics-glue.h
82         ${CMAKE_SOURCE_DIR}/interfaces/netconfig-iface-network-statistics.xml
83         DEPENDS ${CMAKE_SOURCE_DIR}/interfaces/netconfig-iface-network-statistics.xml
84 )
85 ADD_CUSTOM_TARGET(netconfig-iface-wifi-glue.h
86         COMMAND dbus-binding-tool --mode=glib-server --prefix=netconfig_iface_wifi
87         --output=${CMAKE_SOURCE_DIR}/include/netconfig-iface-wifi-glue.h
88         ${CMAKE_SOURCE_DIR}/interfaces/netconfig-iface-wifi.xml
89         DEPENDS ${CMAKE_SOURCE_DIR}/interfaces/netconfig-iface-wifi.xml
90 )
91
92 ADD_DEPENDENCIES(${PROJECT_NAME} netconfig-iface-network-state-glue.h)
93 ADD_DEPENDENCIES(${PROJECT_NAME} netconfig-iface-network-statistics-glue.h)
94 ADD_DEPENDENCIES(${PROJECT_NAME} netconfig-iface-wifi-glue.h)
95
96 INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${BINDIR})