1 CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
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")
20 src/network-statistics.c
24 src/wifi-background-scan.c
28 src/dbus/netsupplicant.c
31 src/utils/mdm-private.c
35 IF("${CMAKE_BUILD_TYPE}" STREQUAL "")
36 SET(CMAKE_BUILD_TYPE "Release")
37 ENDIF("${CMAKE_BUILD_TYPE}" STREQUAL "")
38 MESSAGE("Build type: ${CMAKE_BUILD_TYPE}")
41 ADD_DEFINITIONS(-DTIZEN_P2P_ENABLE)
42 ENDIF(TIZEN_P2P_ENABLE)
44 INCLUDE(FindPkgConfig)
45 PKG_CHECK_MODULES(pkgs REQUIRED
50 capi-network-wifi-direct
54 FOREACH(flag ${pkgs_CFLAGS})
55 SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
58 SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -fvisibility=hidden -Wall")
59 SET(CMAKE_C_FLAGS "-I${CMAKE_SOURCE_DIR}/include ${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}")
60 SET(CMAKE_C_FLAGS_DEBUG "-O0 -g")
61 SET(CMAKE_C_FLAGS_RELEASE "-O2")
63 FIND_PROGRAM(UNAME NAMES uname)
64 EXEC_PROGRAM("${UNAME}" ARGS "-m"
65 OUTPUT_VARIABLE "ARCH")
66 IF("${ARCH}" STREQUAL "arm")
67 ADD_DEFINITIONS("-DEMBEDDED_TARGET")
68 MESSAGE("add -DEMBEDDED_TARGET")
69 ENDIF("${ARCH}" STREQUAL "arm")
71 ADD_DEFINITIONS("-DPACKAGE=\"${PACKAGE}\"")
72 ADD_DEFINITIONS("-DPREFIX=\"${PREFIX}\"")
74 SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed")
76 ADD_EXECUTABLE(${PROJECT_NAME} ${SRCS})
77 TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_LDFLAGS})
79 ADD_CUSTOM_TARGET(netconfig-iface-network-state-glue.h
80 COMMAND dbus-binding-tool --mode=glib-server --prefix=netconfig_iface_network_state
81 --output=${CMAKE_SOURCE_DIR}/include/netconfig-iface-network-state-glue.h
82 ${CMAKE_SOURCE_DIR}/interfaces/netconfig-iface-network-state.xml
83 DEPENDS ${CMAKE_SOURCE_DIR}/interfaces/netconfig-iface-network-state.xml
85 ADD_CUSTOM_TARGET(netconfig-iface-network-statistics-glue.h
86 COMMAND dbus-binding-tool --mode=glib-server --prefix=netconfig_iface_network_statistics
87 --output=${CMAKE_SOURCE_DIR}/include/netconfig-iface-network-statistics-glue.h
88 ${CMAKE_SOURCE_DIR}/interfaces/netconfig-iface-network-statistics.xml
89 DEPENDS ${CMAKE_SOURCE_DIR}/interfaces/netconfig-iface-network-statistics.xml
91 ADD_CUSTOM_TARGET(netconfig-iface-wifi-glue.h
92 COMMAND dbus-binding-tool --mode=glib-server --prefix=netconfig_iface_wifi
93 --output=${CMAKE_SOURCE_DIR}/include/netconfig-iface-wifi-glue.h
94 ${CMAKE_SOURCE_DIR}/interfaces/netconfig-iface-wifi.xml
95 DEPENDS ${CMAKE_SOURCE_DIR}/interfaces/netconfig-iface-wifi.xml
98 ADD_DEPENDENCIES(${PROJECT_NAME} netconfig-iface-network-state-glue.h)
99 ADD_DEPENDENCIES(${PROJECT_NAME} netconfig-iface-network-statistics-glue.h)
100 ADD_DEPENDENCIES(${PROJECT_NAME} netconfig-iface-wifi-glue.h)
102 INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${BINDIR})