1 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
4 #SET(PREFIX $(CMAKE_INSTALL_PREFIX))
6 SET(EXEC_PREFIX "\${prefix}")
7 SET(LIBDIR "\${prefix}/lib")
8 SET(INCLUDEDIR "\${prefix}/include")
10 INCLUDE(FindPkgConfig)
11 pkg_check_modules(pkgs REQUIRED capi-network-wifi-direct glib-2.0 gio-2.0 gobject-2.0 dlog libnl-2.0 capi-appfw-application vconf cynara-client cynara-creds-socket cynara-session aul${MDM_REQUIRED_PKGS})
12 FOREACH(flag ${pkgs_CFLAGS})
13 SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
16 INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include
17 ${CMAKE_SOURCE_DIR}/oem
20 SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -g -Werror -fPIE")
21 SET(CMAKE_C_FLAGS_DEBUG "O0 -g -fPIE")
22 SET(CMAKE_C_FLAGS_RELEASE "O2 -fPIE")
24 SET(ARCH "${ARCHITECTURE}")
26 ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"")
27 ADD_DEFINITIONS("-DUSE_DLOG")
29 IF(TIZEN_WLAN_BOARD_SPRD)
30 ADD_DEFINITIONS(-DTIZEN_WLAN_BOARD_SPRD)
31 ENDIF(TIZEN_WLAN_BOARD_SPRD)
32 IF(TIZEN_TETHERING_ENABLE)
33 ADD_DEFINITIONS(-DTIZEN_TETHERING_ENABLE)
34 ENDIF(TIZEN_TETHERING_ENABLE)
35 IF(TIZEN_FEATURE_DEFAULT_CONNECTION_AGENT)
36 ADD_DEFINITIONS(-DTIZEN_FEATURE_DEFAULT_CONNECTION_AGENT)
37 ENDIF(TIZEN_FEATURE_DEFAULT_CONNECTION_AGENT)
38 IF(TIZEN_FEATURE_SERVICE_DISCOVERY)
39 ADD_DEFINITIONS(-DTIZEN_FEATURE_SERVICE_DISCOVERY)
40 ENDIF(TIZEN_FEATURE_SERVICE_DISCOVERY)
41 IF(TIZEN_FEATURE_WIFI_DISPLAY)
42 ADD_DEFINITIONS(-DTIZEN_FEATURE_WIFI_DISPLAY)
43 ENDIF(TIZEN_FEATURE_WIFI_DISPLAY)
44 IF(TIZEN_WLAN_CONCURRENT_ENABLE)
45 ADD_DEFINITIONS(-DTIZEN_WLAN_CONCURRENT_ENABLE)
46 ENDIF(TIZEN_WLAN_CONCURRENT_ENABLE)
49 ADD_DEFINITIONS(-DTIZEN_ARCH_64)
53 ADD_DEFINITIONS(-DTIZEN_MOBILE)
57 ADD_DEFINITIONS(-DTIZEN_TV)
60 IF(TIZEN_WIFI_MODULE_BUNDLE)
61 ADD_DEFINITIONS(-DTIZEN_WIFI_MODULE_BUNDLE)
62 ENDIF(TIZEN_WIFI_MODULE_BUNDLE)
64 IF(TIZEN_TV_BOARD_PRD)
65 ADD_DEFINITIONS(-DTIZEN_TV_BOARD_PRD)
66 ENDIF(TIZEN_TV_BOARD_PRD)
69 ADD_DEFINITIONS(-DCTRL_IFACE_DBUS)
70 ENDIF(CTRL_IFACE_DBUS)
73 ${CMAKE_SOURCE_DIR}/src/wifi-direct-manager.c
74 ${CMAKE_SOURCE_DIR}/src/wifi-direct-state.c
75 ${CMAKE_SOURCE_DIR}/src/wifi-direct-client.c
76 ${CMAKE_SOURCE_DIR}/src/wifi-direct-peer.c
77 ${CMAKE_SOURCE_DIR}/src/wifi-direct-group.c
78 ${CMAKE_SOURCE_DIR}/src/wifi-direct-session.c
79 ${CMAKE_SOURCE_DIR}/src/wifi-direct-event.c
80 ${CMAKE_SOURCE_DIR}/src/wifi-direct-util.c
81 ${CMAKE_SOURCE_DIR}/oem/wifi-direct-oem.c
84 IF(TIZEN_FEATURE_SERVICE_DISCOVERY)
85 SET(SRCS ${SRCS} ${CMAKE_SOURCE_DIR}/src/wifi-direct-service.c)
86 ENDIF(TIZEN_FEATURE_SERVICE_DISCOVERY)
88 ADD_EXECUTABLE(${PROJECT_NAME} ${SRCS})
89 SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -pie")
90 TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_LDFLAGS} -ldl)
92 INSTALL(TARGETS ${PROJECT_NAME} DESTINATION bin)
93 INSTALL(FILES ${CMAKE_SOURCE_DIR}/files/common/udhcp_script.non-autoip DESTINATION etc/wifi-direct)
94 INSTALL(FILES ${CMAKE_SOURCE_DIR}/files/common/wifi-direct-server.sh DESTINATION bin)
95 INSTALL(FILES ${CMAKE_SOURCE_DIR}/files/common/p2p_supp.sh DESTINATION sbin)
96 INSTALL(FILES ${CMAKE_SOURCE_DIR}/files/common/ccode.conf DESTINATION etc/wifi-direct)
97 INSTALL(FILES ${CMAKE_SOURCE_DIR}/files/common/persistent-peer DESTINATION /opt/etc)
98 IF(TIZEN_WIFI_MODULE_BUNDLE)
99 INSTALL(FILES ${CMAKE_SOURCE_DIR}/files/bundle/p2p_supp.conf DESTINATION etc/wifi-direct)
100 INSTALL(FILES ${CMAKE_SOURCE_DIR}/files/bundle/p2p_supp.conf DESTINATION /opt/etc)
101 INSTALL(FILES ${CMAKE_SOURCE_DIR}/files/bundle/dhcpd.wlan.conf DESTINATION etc/wifi-direct)
102 INSTALL(FILES ${CMAKE_SOURCE_DIR}/files/bundle/dhcpd-notify.sh DESTINATION bin)
103 INSTALL(FILES ${CMAKE_SOURCE_DIR}/files/bundle/wifi-direct-dhcp.sh DESTINATION bin)
104 ELSE(TIZEN_WIFI_MODULE_BUNDLE)
105 INSTALL(FILES ${CMAKE_SOURCE_DIR}/files/common/dhcpd-notify.sh DESTINATION bin)
106 IF(TIZEN_WLAN_BOARD_SPRD)
107 INSTALL(FILES ${CMAKE_SOURCE_DIR}/files/TM1/p2p_supp.conf DESTINATION etc/wifi-direct)
108 INSTALL(FILES ${CMAKE_SOURCE_DIR}/files/TM1/p2p_supp.conf DESTINATION /opt/etc)
109 INSTALL(FILES ${CMAKE_SOURCE_DIR}/files/TM1/dhcpd.p2p.conf DESTINATION etc/wifi-direct)
110 INSTALL(FILES ${CMAKE_SOURCE_DIR}/files/TM1/wifi-direct-dhcp.sh DESTINATION bin)
111 ELSE(TIZEN_WLAN_BOARD_SPRD)
112 IF(TIZEN_TV_BOARD_PRD)
113 INSTALL(FILES ${CMAKE_SOURCE_DIR}/files/tv/p2p_supp.conf DESTINATION etc/wifi-direct)
114 INSTALL(FILES ${CMAKE_SOURCE_DIR}/files/tv/p2p_supp.conf DESTINATION /opt/etc)
115 INSTALL(FILES ${CMAKE_SOURCE_DIR}/files/tv/dhcpd.p2p.conf DESTINATION etc/wifi-direct)
116 INSTALL(FILES ${CMAKE_SOURCE_DIR}/files/tv/wifi-direct-dhcp.sh DESTINATION bin)
117 ELSE(TIZEN_TV_BOARD_PRD)
118 INSTALL(FILES ${CMAKE_SOURCE_DIR}/files/common/p2p_supp.conf DESTINATION etc/wifi-direct)
119 INSTALL(FILES ${CMAKE_SOURCE_DIR}/files/common/p2p_supp.conf DESTINATION /opt/etc)
120 INSTALL(FILES ${CMAKE_SOURCE_DIR}/files/common/dhcpd.p2p.conf DESTINATION etc/wifi-direct)
121 INSTALL(FILES ${CMAKE_SOURCE_DIR}/files/common/wifi-direct-dhcp.sh DESTINATION bin)
122 ENDIF(TIZEN_WLAN_BOARD_SPRD)
123 ENDIF(TIZEN_WIFI_MODULE_BUNDLE)
124 ENDIF(TIZEN_TV_BOARD_PRD)
126 IF("${ARCH}" MATCHES "^arm.*|.*86.*")
128 ADD_SUBDIRECTORY(plugin/wpasupplicant/ctrl_iface_dbus)
129 ELSE(CTRL_IFACE_DBUS)
130 ADD_SUBDIRECTORY(plugin/wpasupplicant/ctrl_iface_sock)
131 ENDIF(CTRL_IFACE_DBUS)
133 ADD_SUBDIRECTORY(plugin/wpasupplicant/emul)