[TSAM-14049] fix null pointer reference
[platform/core/connectivity/net-config.git] / CMakeLists.txt
old mode 100644 (file)
new mode 100755 (executable)
index 26b1b0b..7c65574
@@ -5,28 +5,40 @@ SET(PREFIX ${CMAKE_INSTALL_PREFIX})
 SET(BINDIR "${PREFIX}/sbin")
 SET(DATADIR "${PREFIX}/share")
 SET(LIBDIR "${PREFIX}/lib")
+SET(INTERFACES "${CMAKE_SOURCE_DIR}/interfaces")
 
 SET(SRCS
        src/main.c
-       src/neterror.c
+       src/wifi-tdls.c
        src/wifi.c
+       src/neterror.c
+       src/wifi-eap.c
+       src/wifi-wps.c
+       src/wifi-agent.c
        src/wifi-power.c
        src/wifi-state.c
-       src/wifi-eap.c
+       src/cellular-state.c
+       src/wifi-passpoint.c
+       src/utils/log.c
+       src/utils/util.c
+       src/vpnsvc.c
+       src/vpnsvc-internal.c
+       src/dbus/netdbus.c
        src/network-clock.c
        src/network-state.c
-       src/network-statistics.c
+       src/network-dpm.c
+       src/network-monitor.c
+       src/wifi-firmware.c
        src/wifi-indicator.c
        src/signal-handler.c
        src/wifi-ssid-scan.c
-       src/wifi-background-scan.c
-       src/wifi-agent.c
+       src/utils/emulator.c
        src/wifi-eap-config.c
-       src/dbus/netdbus.c
+       src/network-statistics.c
        src/dbus/netsupplicant.c
-       src/utils/util.c
-       src/utils/emulator.c
-       src/utils/mdm-private.c
+       src/wifi-background-scan.c
+       src/wifi-tel-intf.c
+       src/wifi-config.c
        )
 
 IF("${CMAKE_BUILD_TYPE}" STREQUAL "")
@@ -34,63 +46,105 @@ IF("${CMAKE_BUILD_TYPE}" STREQUAL "")
 ENDIF("${CMAKE_BUILD_TYPE}" STREQUAL "")
 MESSAGE("Build type: ${CMAKE_BUILD_TYPE}")
 
+IF(TIZEN_WLAN_PASSPOINT)
+       ADD_DEFINITIONS(-DTIZEN_WLAN_PASSPOINT)
+ENDIF(TIZEN_WLAN_PASSPOINT)
+
+IF(TIZEN_WLAN_USE_P2P_INTERFACE)
+       ADD_DEFINITIONS(-DTIZEN_WLAN_USE_P2P_INTERFACE)
+ENDIF(TIZEN_WLAN_USE_P2P_INTERFACE)
+
+IF(TIZEN_P2P_ENABLE)
+       ADD_DEFINITIONS(-DTIZEN_P2P_ENABLE)
+       SET(P2P_REQUIRED_PKGS "capi-network-wifi-direct")
+ENDIF(TIZEN_P2P_ENABLE)
+
+IF(TIZEN_TETHERING_ENABLE)
+       ADD_DEFINITIONS(-DTIZEN_TETHERING_ENABLE)
+ENDIF(TIZEN_TETHERING_ENABLE)
+
+IF(TIZEN_CAPTIVE_PORTAL)
+       ADD_DEFINITIONS(-DTIZEN_CAPTIVE_PORTAL)
+       SET(SRCS ${SRCS} src/utils/network-accessibility.c)
+ENDIF(TIZEN_CAPTIVE_PORTAL)
+
+IF(TIZEN_TV)
+       ADD_DEFINITIONS(-DTIZEN_TV)
+ENDIF(TIZEN_TV)
+
+IF(TIZEN_WEARABLE)
+       ADD_DEFINITIONS(-DTIZEN_WEARABLE)
+ENDIF(TIZEN_WEARABLE)
+
+IF(TIZEN_TELEPHONY_ENABLE)
+       ADD_DEFINITIONS(-DTIZEN_TELEPHONY_ENABLE)
+ENDIF(TIZEN_TELEPHONY_ENABLE)
+
+IF(TIZEN_NTP_ENABLE)
+       ADD_DEFINITIONS(-DTIZEN_NTP_ENABLE)
+ENDIF(TIZEN_NTP_ENABLE)
+
+IF(TIZEN_WLAN_BOARD_SPRD)
+       ADD_DEFINITIONS(-DTIZEN_WLAN_BOARD_SPRD)
+ENDIF(TIZEN_WLAN_BOARD_SPRD)
+
 INCLUDE(FindPkgConfig)
 PKG_CHECK_MODULES(pkgs REQUIRED
-       glib-2.0
-       dbus-glib-1
        dlog
-       vconf
-       wifi-direct
        tapi
+       vconf
+       bundle
+       gio-2.0
+       glib-2.0
+       gio-unix-2.0
+       eventsystem
+       alarm-service
        syspopup-caller
-       libsystemd-daemon)
+       capi-system-info
+       capi-appfw-application
+       ${P2P_REQUIRED_PKGS}
+       ${WEARABLE_REQUIRED_PKGS}
+       )
 
 FOREACH(flag ${pkgs_CFLAGS})
        SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
 ENDFOREACH(flag)
 
-SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -fvisibility=hidden -Wall")
-SET(CMAKE_C_FLAGS "-I${CMAKE_SOURCE_DIR}/include ${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}")
-SET(CMAKE_C_FLAGS_DEBUG "-O0 -g")
-SET(CMAKE_C_FLAGS_RELEASE "-O2")
+SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -Wall -Werror -fvisibility=hidden")
+SET(EXTRA_CXXFLAGS "${EXTRA_CXXFLAGS} -Wall -Werror -fvisibility=hidden -fvisibility-inlines-hidden")
+SET(CMAKE_C_FLAGS "-I${CMAKE_SOURCE_DIR} -I${CMAKE_SOURCE_DIR}/include ${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fPIE")
+SET(CMAKE_C_FLAGS_DEBUG "-O0 -g -fPIE")
+SET(CMAKE_C_FLAGS_RELEASE "-O2 -fPIE")
+
+IF(WLAN_CONCURRENT_MODE)
+       ADD_DEFINITIONS(-DWLAN_CONCURRENT_MODE)
+ENDIF(WLAN_CONCURRENT_MODE)
 
 FIND_PROGRAM(UNAME NAMES uname)
 EXEC_PROGRAM("${UNAME}" ARGS "-m"
 OUTPUT_VARIABLE "ARCH")
 IF("${ARCH}" STREQUAL "arm")
-       ADD_DEFINITIONS("-DEMBEDDED_TARGET")
-       MESSAGE("add -DEMBEDDED_TARGET")
+       ADD_DEFINITIONS("-DTARGET_ARM")
+       MESSAGE("add -DTARGET_ARM")
 ENDIF("${ARCH}" STREQUAL "arm")
 
 ADD_DEFINITIONS("-DPACKAGE=\"${PACKAGE}\"")
 ADD_DEFINITIONS("-DPREFIX=\"${PREFIX}\"")
 
-SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed")
-
-ADD_EXECUTABLE(${PROJECT_NAME} ${SRCS})
-TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_LDFLAGS})
-
-ADD_CUSTOM_TARGET(netconfig-iface-network-state-glue.h
-       COMMAND dbus-binding-tool --mode=glib-server --prefix=netconfig_iface_network_state
-       --output=${CMAKE_SOURCE_DIR}/include/netconfig-iface-network-state-glue.h
-       ${CMAKE_SOURCE_DIR}/interfaces/netconfig-iface-network-state.xml
-       DEPENDS ${CMAKE_SOURCE_DIR}/interfaces/netconfig-iface-network-state.xml
-)
-ADD_CUSTOM_TARGET(netconfig-iface-network-statistics-glue.h
-       COMMAND dbus-binding-tool --mode=glib-server --prefix=netconfig_iface_network_statistics
-       --output=${CMAKE_SOURCE_DIR}/include/netconfig-iface-network-statistics-glue.h
-       ${CMAKE_SOURCE_DIR}/interfaces/netconfig-iface-network-statistics.xml
-       DEPENDS ${CMAKE_SOURCE_DIR}/interfaces/netconfig-iface-network-statistics.xml
-)
-ADD_CUSTOM_TARGET(netconfig-iface-wifi-glue.h
-       COMMAND dbus-binding-tool --mode=glib-server --prefix=netconfig_iface_wifi
-       --output=${CMAKE_SOURCE_DIR}/include/netconfig-iface-wifi-glue.h
-       ${CMAKE_SOURCE_DIR}/interfaces/netconfig-iface-wifi.xml
-       DEPENDS ${CMAKE_SOURCE_DIR}/interfaces/netconfig-iface-wifi.xml
-)
-
-ADD_DEPENDENCIES(${PROJECT_NAME} netconfig-iface-network-state-glue.h)
-ADD_DEPENDENCIES(${PROJECT_NAME} netconfig-iface-network-statistics-glue.h)
-ADD_DEPENDENCIES(${PROJECT_NAME} netconfig-iface-wifi-glue.h)
+SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -pie")
+
+ADD_CUSTOM_COMMAND(
+       WORKING_DIRECTORY
+       OUTPUT ${CMAKE_SOURCE_DIR}/generated-code.c
+       COMMAND gdbus-codegen --interface-prefix net.netconfig.
+                       --generate-c-code generated-code
+                       --c-generate-object-manager
+                       --generate-docbook generated-code-docs
+                       ${INTERFACES}/netconfig-iface-network-state.xml ${INTERFACES}/netconfig-iface-network-statistics.xml ${INTERFACES}/netconfig-iface-wifi.xml ${INTERFACES}/netconfig-iface-vpnsvc.xml
+                       COMMENT "Generating GDBus .c/.h")
+
+ADD_EXECUTABLE(${PROJECT_NAME} ${SRCS} ${CMAKE_SOURCE_DIR}/generated-code.c)
+
+TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_LDFLAGS} ${PCAP_LIB})
 
 INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${BINDIR})