From 575331f803045f761afa4e2586713e3e64e64e5f Mon Sep 17 00:00:00 2001 From: Youngjae Shin Date: Wed, 29 Jul 2020 10:43:55 +0900 Subject: [PATCH] revise build scripts and packaging Change-Id: Ib4a46f739b2038ec9650163eaa87d2c5ef3eccd2 --- CMakeLists.txt | 48 +++++---------- common/common_eap_connect.c | 1 - common/common_ip_info.c | 11 ++-- common/common_pswd_popup.c | 1 - common/common_utils.c | 1 - common/wlan_manager.c | 1 - packaging/wifi-efl-ug.spec | 62 +++++++++---------- res/po/CMakeLists.txt | 7 +-- ui-gadget/CMakeLists.txt | 126 ++++++++------------------------------- ui-gadget/edc/CMakeLists.txt | 19 ++++++ ui-gadget/ug_wifi.h | 6 +- wifi-syspopup/CMakeLists.txt | 90 +++++++++------------------- wifi-syspopup/edc/CMakeLists.txt | 17 ++++++ wifi-syspopup/wifi-syspopup.h | 6 +- 14 files changed, 149 insertions(+), 247 deletions(-) create mode 100644 ui-gadget/edc/CMakeLists.txt create mode 100644 wifi-syspopup/edc/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index 5ae01b6..2244a64 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,8 +1,9 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.6) +PROJECT(wifi-efl C) -ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"") - -SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wmissing-declarations") +SET(EXTRA_FLAGS "-Wall -Werror -fvisibility=hidden") +SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_FLAGS}") +SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pie") IF(TIZEN_TETHERING_ENABLE) ADD_DEFINITIONS(-DTIZEN_TETHERING_ENABLE) @@ -13,36 +14,19 @@ IF(MODEL_BUILD_FEATURE_WLAN_CONCURRENT_MODE) ENDIF(MODEL_BUILD_FEATURE_WLAN_CONCURRENT_MODE) INCLUDE(FindPkgConfig) -pkg_check_modules(pkgs REQUIRED - ecore - ecore-imf - ecore-input - appcore-efl - elementary - capi-ui-efl-util - glib-2.0 - ui-gadget-1 - capi-network-connection - capi-network-wifi-manager - capi-system-info - sensor - openssl1.1 - cert-svc-vcore - efl-extension - aul -#syspopup -#syspopup-caller - feedback -#setting-common-lite-internal - ${TETHERING_REQUIRED_PKGS}) - -INCLUDE_DIRECTORIES( - ${CMAKE_CURRENT_SOURCE_DIR}/ui-gadget - ${CMAKE_CURRENT_SOURCE_DIR}/ui-gadget/viewers-layout - ${CMAKE_CURRENT_SOURCE_DIR}/wifi-syspopup - ${CMAKE_CURRENT_SOURCE_DIR}/wifi-syspopup/viewer-popups - ${CMAKE_CURRENT_SOURCE_DIR}/common +pkg_check_modules(pkgs REQUIRED ecore ecore-imf ecore-input appcore-efl elementary + capi-ui-efl-util glib-2.0 ui-gadget-1 capi-network-connection efl-extension + capi-network-wifi-manager capi-system-info sensor openssl1.1 cert-svc-vcore + aul feedback ${TETHERING_REQUIRED_PKGS} ) +INCLUDE_DIRECTORIES(${pkgs_INCLUDE_DIRS}) +LINK_DIRECTORIES(${pkgs_LIBRARY_DIRS}) + +SET(WIFI_UG "ug-wifi-efl-UG") +SET(WIFI_POPUP "wifi-qs") + +SET(COMMON_SRC_DIR ${CMAKE_SOURCE_DIR}/common) +INCLUDE_DIRECTORIES(${COMMON_SRC_DIR}) IF(TIZEN_MOBILE) ADD_SUBDIRECTORY(res/po) diff --git a/common/common_eap_connect.c b/common/common_eap_connect.c index 6f28826..e12b2a7 100644 --- a/common/common_eap_connect.c +++ b/common/common_eap_connect.c @@ -27,7 +27,6 @@ #include #include "common.h" -#include "ug_wifi.h" #include "common_eap_connect.h" #include "i18nmanager.h" #include "common_utils.h" diff --git a/common/common_ip_info.c b/common/common_ip_info.c index 850ea10..df677b9 100644 --- a/common/common_ip_info.c +++ b/common/common_ip_info.c @@ -22,16 +22,15 @@ #include "common.h" #include "common_utils.h" -#include "ug_wifi.h" #include "common_ip_info.h" #include "i18nmanager.h" -#define DEFAULT_PROXY_ADDR "0.0.0.0:80" -#define IPV4_DEFAULT_ADDR "0.0.0.0" -#define IPV6_DEFAULT_ADDR "::" +#define DEFAULT_PROXY_ADDR "0.0.0.0:80" +#define IPV4_DEFAULT_ADDR "0.0.0.0" +#define IPV6_DEFAULT_ADDR "::" -#define MAX_PORT_NUMBER 65535 -#define MAX_LABEL_LENGTH 512 +#define MAX_PORT_NUMBER 65535 +#define MAX_LABEL_LENGTH 512 typedef struct { char* title; diff --git a/common/common_pswd_popup.c b/common/common_pswd_popup.c index 2b83101..298acb6 100644 --- a/common/common_pswd_popup.c +++ b/common/common_pswd_popup.c @@ -24,7 +24,6 @@ #include "common_pswd_popup.h" #include "common_generate_pin.h" #include "i18nmanager.h" -#include "ug_wifi.h" #define EDJ_GRP_POPUP_PBC_BUTTON_LAYOUT "popup_pbc_button_layout" #define EDJ_GRP_POPUP_WPS_PIN_LAYOUT "popup_wps_pin_layout" diff --git a/common/common_utils.c b/common/common_utils.c index 2cc5a5e..fcf7736 100644 --- a/common/common_utils.c +++ b/common/common_utils.c @@ -28,7 +28,6 @@ #include #include "common.h" -#include "ug_wifi.h" #include "common_utils.h" #include "i18nmanager.h" diff --git a/common/wlan_manager.c b/common/wlan_manager.c index 579006c..a8e398b 100644 --- a/common/wlan_manager.c +++ b/common/wlan_manager.c @@ -24,7 +24,6 @@ #include "wlan_manager.h" #include "common_utils.h" #include "wlan_connection.h" -#include "wifi-engine-callback.h" typedef enum { WLAN_MANAGER_REQ_TYPE_ACTIVATE, diff --git a/packaging/wifi-efl-ug.spec b/packaging/wifi-efl-ug.spec index 186b52a..7ee0fa9 100644 --- a/packaging/wifi-efl-ug.spec +++ b/packaging/wifi-efl-ug.spec @@ -7,30 +7,28 @@ License: Flora-1.1 Source0: %{name}-%{version}.tar.gz Source1001: %{name}.manifest +BuildRequires: cmake +BuildRequires: edje-tools +BuildRequires: gettext-tools +BuildRequires: pkgconfig(appcore-efl) +BuildRequires: pkgconfig(aul) +BuildRequires: pkgconfig(capi-network-connection) +BuildRequires: pkgconfig(capi-network-tethering) +BuildRequires: pkgconfig(capi-network-wifi-manager) +BuildRequires: pkgconfig(capi-system-info) +BuildRequires: pkgconfig(capi-ui-efl-util) +BuildRequires: pkgconfig(cert-svc-vcore) BuildRequires: pkgconfig(ecore) BuildRequires: pkgconfig(ecore-imf) BuildRequires: pkgconfig(ecore-input) -BuildRequires: pkgconfig(appcore-efl) +BuildRequires: pkgconfig(efl-extension) BuildRequires: pkgconfig(elementary) +BuildRequires: pkgconfig(feedback) BuildRequires: pkgconfig(glib-2.0) +BuildRequires: pkgconfig(libxml-2.0) BuildRequires: pkgconfig(openssl1.1) -BuildRequires: pkgconfig(cert-svc-vcore) -BuildRequires: pkgconfig(ui-gadget-1) BuildRequires: pkgconfig(sensor) -BuildRequires: pkgconfig(capi-network-wifi-manager) -BuildRequires: pkgconfig(capi-network-connection) -BuildRequires: pkgconfig(capi-network-tethering) -BuildRequires: pkgconfig(capi-ui-efl-util) -BuildRequires: pkgconfig(feedback) -BuildRequires: pkgconfig(efl-extension) -BuildRequires: pkgconfig(aul) -BuildRequires: pkgconfig(capi-system-info) -#BuildRequires: pkgconfig(setting-common-internal) -#BuildRequires: pkgconfig(setting-lite-common-internal) -BuildRequires: cmake -BuildRequires: gettext-tools -BuildRequires: edje-tools -BuildRequires: pkgconfig(libxml-2.0) +BuildRequires: pkgconfig(ui-gadget-1) Requires(post): /sbin/ldconfig requires(postun): /sbin/ldconfig @@ -48,41 +46,35 @@ Wi-Fi System popup for TIZEN %setup -q cp %{SOURCE1001} ./%{name}.manifest -%define PREFIX /usr/ - %build -#LDFLAGS+="-Wl,--rpath=%{PREFIX}/lib -Wl,--as-needed" -cmake -DCMAKE_INSTALL_PREFIX=%{PREFIX} \ +%cmake . -DCMAKE_VERBOSE_MAKEFILE=OFF \ + -DBIN_INSTALL_DIR:PATH=%{_bindir} \ + -DAPP_INSTALL_DIR:PATH=%{TZ_SYS_RO_APP} \ + -DUG_DIR_PREFIX:PATH=%{TZ_SYS_RO_UG} \ -DTIZEN_TETHERING_ENABLE=1 \ -DMODEL_BUILD_FEATURE_WLAN_CONCURRENT_MODE=1 \ - -DTIZEN_MOBILE=1 \ - . + -DTIZEN_MOBILE=1 make %{?_smp_mflags} - %install %make_install %post /sbin/ldconfig - -mkdir -p %{PREFIX}/bin/ -mkdir -p /usr/apps/wifi-efl-ug/bin/ -m 777 +mkdir -p %{TZ_SYS_RO_APP}/%{name}/bin/ %postun -p /sbin/ldconfig %files %manifest %{name}.manifest -%{PREFIX}/ug/lib/* -%attr(644,-,-) %{PREFIX}/ug/lib/* -%attr(755,-,-) %{PREFIX}/ug/lib/ -%{PREFIX}/apps/wifi-efl-ug/res/edje/*.edj -%{_datadir}/packages/wifi-efl-ug.xml +%{TZ_SYS_RO_UG}/lib/* +%{TZ_SYS_RO_APP}/%{name}/res/edje/*.edj +%{_datadir}/packages/%{name}.xml %{_datadir}/locale/*/LC_MESSAGES/*.mo %{_datadir}/icons/*.png -/usr/apps/wifi-efl-ug/shared/res/tables/ug-wifi-efl_ChangeableColorTable.xml -/usr/apps/wifi-efl-ug/shared/res/tables/ug-wifi-efl_FontInfoTable.xml +%{TZ_SYS_RO_APP}/%{name}/shared/res/tables/ug-wifi-efl_ChangeableColorTable.xml +%{TZ_SYS_RO_APP}/%{name}/shared/res/tables/ug-wifi-efl_FontInfoTable.xml %license LICENSE %files -n net.wifi-qs @@ -90,5 +82,5 @@ mkdir -p /usr/apps/wifi-efl-ug/bin/ -m 777 %{_bindir}/wifi-qs %{_datadir}/packages/net.wifi-qs.xml %{_datadir}/icons/*.png -%{PREFIX}/apps/net.wifi-qs/res/edje/*.edj +%{TZ_SYS_RO_APP}/net.wifi-qs/res/edje/*.edj %license LICENSE diff --git a/res/po/CMakeLists.txt b/res/po/CMakeLists.txt index 283005f..92ce346 100644 --- a/res/po/CMakeLists.txt +++ b/res/po/CMakeLists.txt @@ -9,9 +9,6 @@ SET(POFILES ar.po az.po bg.po ca.po cs.po da.po de.po el_GR.po en.po en_PH.po SET(MSGFMT "/usr/bin/msgfmt") -SET(WIFI_UG_PROJECT_NAME "ug-wifi-efl-UG") -SET(WIFI_QS_PROJECT_NAME "wifi-qs") - FOREACH(pofile ${POFILES}) SET(pofile ${CMAKE_CURRENT_SOURCE_DIR}/${pofile}) MESSAGE("PO: ${pofile}") @@ -26,11 +23,11 @@ FOREACH(pofile ${POFILES}) # install for UG INSTALL(FILES ${moFile} - DESTINATION /usr/share/locale/${lang}/LC_MESSAGES RENAME ${WIFI_UG_PROJECT_NAME}.mo) + DESTINATION ${SHARE_INSTALL_PREFIX}/locale/${lang}/LC_MESSAGES RENAME ${WIFI_UG}.mo) # install for QS INSTALL(FILES ${moFile} - DESTINATION /usr/share/locale/${lang}/LC_MESSAGES RENAME ${WIFI_QS_PROJECT_NAME}.mo) + DESTINATION ${SHARE_INSTALL_PREFIX}/locale/${lang}/LC_MESSAGES RENAME ${WIFI_POPUP}.mo) SET(moFiles ${moFiles} ${moFile}) ENDFOREACH(pofile) diff --git a/ui-gadget/CMakeLists.txt b/ui-gadget/CMakeLists.txt index 429bcd3..6d2c642 100644 --- a/ui-gadget/CMakeLists.txt +++ b/ui-gadget/CMakeLists.txt @@ -1,16 +1,6 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 2.6) -# tizen 2.4 -#PROJECT(wifi-efl-UG C) -# tizen 3.0 -PROJECT(ug-wifi-efl-UG C) -# defines -SET(PREFIX ${CMAKE_INSTALL_PREFIX}) -SET(EXEC_PREFIX "\${prefix}") -SET(LIBDIR "\${prefix}/lib") -SET(INCLUDEDIR "\${prefix}/include") -SET(VERSION 0.1.0) -SET(RESDIR "${PREFIX}/res") +ADD_DEFINITIONS("-DPACKAGE=\"${WIFI_UG}\"") + SET(TABLEDIR "/usr/apps/wifi-efl-ug/shared/res/tables") IF(TIZEN_TETHERING_ENABLE) @@ -19,17 +9,16 @@ ENDIF(TIZEN_TETHERING_ENABLE) # source files SET(SRCS - ../common/i18nmanager.c - ../common/appcoreWrapper.c - ../common/connection_manager.c - ../common/wlan_manager.c - ../common/wlan_connection.c - ../common/common_utils.c - ../common/common_ip_info.c - ../common/common_pswd_popup.c - ../common/common_eap_connect.c - ../common/common_generate_pin.c - ${ENGINE_SOURCES} + ${COMMON_SRC_DIR}/i18nmanager.c + ${COMMON_SRC_DIR}/appcoreWrapper.c + ${COMMON_SRC_DIR}/connection_manager.c + ${COMMON_SRC_DIR}/wlan_manager.c + ${COMMON_SRC_DIR}/wlan_connection.c + ${COMMON_SRC_DIR}/common_utils.c + ${COMMON_SRC_DIR}/common_ip_info.c + ${COMMON_SRC_DIR}/common_pswd_popup.c + ${COMMON_SRC_DIR}/common_eap_connect.c + ${COMMON_SRC_DIR}/common_generate_pin.c ${TETHERING_POPUP_SRCS} wifi-efl-UG.c viewer_manager.c @@ -39,83 +28,16 @@ SET(SRCS view_ime_hidden.c wifi-wlan-callbacks.c) -FOREACH(flag ${pkgs_CFLAGS}) - SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}") -ENDFOREACH(flag) - -SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS}") - # add library -ADD_LIBRARY(${PROJECT_NAME} SHARED ${SRCS}) -SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES SOVERSION 0.1.0) -TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_LDFLAGS}) - -ADD_CUSTOM_TARGET(main_layout.edj - COMMAND edje_cc -id ${CMAKE_SOURCE_DIR}/res/images - ${CMAKE_CURRENT_SOURCE_DIR}/edc/main_layout.edc - ${CMAKE_CURRENT_SOURCE_DIR}/edc/main_layout.edj - DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/edc/main_layout.edc -) - -ADD_DEPENDENCIES(${PROJECT_NAME} main_layout.edj) - -ADD_CUSTOM_TARGET(custom_editfield.edj - COMMAND edje_cc -id ${CMAKE_SOURCE_DIR}/res/images - ${CMAKE_CURRENT_SOURCE_DIR}/edc/custom_editfield.edc - ${CMAKE_CURRENT_SOURCE_DIR}/edc/custom_editfield.edj - DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/edc/custom_editfield.edc -) - -ADD_DEPENDENCIES(${PROJECT_NAME} custom_editfield.edj) - -ADD_CUSTOM_TARGET(custom_genlist.edj - COMMAND edje_cc -id ${CMAKE_SOURCE_DIR}/res/images - ${CMAKE_CURRENT_SOURCE_DIR}/edc/custom_genlist.edc - ${CMAKE_CURRENT_SOURCE_DIR}/edc/custom_genlist.edj - DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/edc/custom_genlist.edc -) - -ADD_DEPENDENCIES(${PROJECT_NAME} custom_genlist.edj) - -ADD_CUSTOM_TARGET(custom_popup.edj - COMMAND edje_cc -id ${CMAKE_SOURCE_DIR}/res/images - ${CMAKE_CURRENT_SOURCE_DIR}/edc/custom_popup.edc - ${CMAKE_CURRENT_SOURCE_DIR}/edc/custom_popup.edj - DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/edc/custom_popup.edc -) - -ADD_DEPENDENCIES(${PROJECT_NAME} custom_popup.edj) - -ADD_CUSTOM_TARGET(setup_wizard.edj - COMMAND edje_cc -id ${CMAKE_SOURCE_DIR}/res/images - ${CMAKE_CURRENT_SOURCE_DIR}/edc/setup_wizard.edc - ${CMAKE_CURRENT_SOURCE_DIR}/edc/setup_wizard.edj - DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/edc/setup_wizard.edc -) - -ADD_DEPENDENCIES(${PROJECT_NAME} setup_wizard.edj) - -ADD_CUSTOM_TARGET(oobe_buttons.edj - COMMAND edje_cc -id ${CMAKE_SOURCE_DIR}/res/images - -fd ${CMAKE_SOURCE_DIR}/res/fonts - ${CMAKE_CURRENT_SOURCE_DIR}/edc/oobe_buttons.edc - ${CMAKE_CURRENT_SOURCE_DIR}/edc/oobe_buttons.edj - DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/edc/oobe_buttons.edc -) - -ADD_DEPENDENCIES(${PROJECT_NAME} oobe_buttons.edj) - -# tizen 2.4 -#INSTALL(TARGETS ${PROJECT_NAME} DESTINATION /usr/apps/wifi-efl-ug/lib/ug/) -# tizen 3.0 -INSTALL(TARGETS ${PROJECT_NAME} DESTINATION /usr/ug/lib/) - -# install image files -INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/edc/main_layout.edj DESTINATION /usr/apps/wifi-efl-ug/res/edje) -INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/edc/custom_editfield.edj DESTINATION /usr/apps/wifi-efl-ug/res/edje) -INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/edc/custom_genlist.edj DESTINATION /usr/apps/wifi-efl-ug/res/edje) -INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/edc/custom_popup.edj DESTINATION /usr/apps/wifi-efl-ug/res/edje) -INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/edc/setup_wizard.edj DESTINATION /usr/apps/wifi-efl-ug/res/edje) -INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/edc/oobe_buttons.edj DESTINATION /usr/apps/wifi-efl-ug/res/edje) -INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/wifi-efl-ug.xml DESTINATION /usr/share/packages/) -INSTALL(DIRECTORY ${CMAKE_SOURCE_DIR}/res/tables/ DESTINATION ${TABLEDIR} FILES_MATCHING PATTERN "*.xml") +ADD_LIBRARY(${WIFI_UG} SHARED ${SRCS}) +SET_TARGET_PROPERTIES(${WIFI_UG} PROPERTIES SOVERSION 0.1.0) +TARGET_LINK_LIBRARIES(${WIFI_UG} ${pkgs_LIBRARIES}) +TARGET_COMPILE_OPTIONS(${WIFI_UG} PUBLIC ${pkgs_CFLAGS_OTHER}) +SET_TARGET_PROPERTIES(${WIFI_UG} PROPERTIES POSITION_INDEPENDENT_CODE ON) +INSTALL(TARGETS ${WIFI_UG} DESTINATION ${UG_DIR_PREFIX}/lib/) + +INSTALL(FILES wifi-efl-ug.xml DESTINATION ${SHARE_INSTALL_PREFIX}/packages/) +INSTALL(DIRECTORY ${CMAKE_SOURCE_DIR}/res/tables/ DESTINATION ${TABLEDIR} + FILES_MATCHING PATTERN "*.xml") + +ADD_SUBDIRECTORY(edc) \ No newline at end of file diff --git a/ui-gadget/edc/CMakeLists.txt b/ui-gadget/edc/CMakeLists.txt new file mode 100644 index 0000000..353d328 --- /dev/null +++ b/ui-gadget/edc/CMakeLists.txt @@ -0,0 +1,19 @@ +SET(EDC_DIR ${CMAKE_CURRENT_SOURCE_DIR}) +SET(IMAGE_DIR ${CMAKE_SOURCE_DIR}/res/images) +SET(FONT_DIR ${CMAKE_SOURCE_DIR}/res/fonts) +SET(EDC_FILES custom_editfield.edc custom_popup.edc oobe_buttons.edc custom_genlist.edc + main_layout.edc setup_wizard.edc +) + +FOREACH(edc_file ${EDC_FILES}) + GET_FILENAME_COMPONENT(FName ${edc_file} NAME_WE) + ADD_CUSTOM_TARGET(${FName}.edj + COMMAND edje_cc -id ${IMAGE_DIR} -fd ${FONT_DIR} + ${EDC_DIR}/${edc_file} ${EDC_DIR}/${FName}.edj + DEPENDS ${EDC_DIR}/${edc_file} + ) + ADD_DEPENDENCIES(${WIFI_UG} ${FName}.edj) +ENDFOREACH() + +INSTALL(DIRECTORY ${EDC_DIR}/ DESTINATION ${APP_INSTALL_DIR}/wifi-efl-ug/res/edje + FILES_MATCHING PATTERN "*.edj") \ No newline at end of file diff --git a/ui-gadget/ug_wifi.h b/ui-gadget/ug_wifi.h index 5ba888d..b57d0af 100644 --- a/ui-gadget/ug_wifi.h +++ b/ui-gadget/ug_wifi.h @@ -38,7 +38,11 @@ extern "C" #include "viewer_manager.h" #include -#define PACKAGE "ug-wifi-efl-UG" +#ifndef PACKAGE +#define PACKAGE "ug-wifi-efl-UG" +#warning "PACKAGE is redefined" +#endif + #define UG_CALLER "caller" #define UG_VIEWTYPE "viewtype" #define UG_MAIN_MESSAGE_DESTROY 1 diff --git a/wifi-syspopup/CMakeLists.txt b/wifi-syspopup/CMakeLists.txt index 3a8e5ea..690463a 100644 --- a/wifi-syspopup/CMakeLists.txt +++ b/wifi-syspopup/CMakeLists.txt @@ -1,73 +1,41 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 2.6) -PROJECT(wifi-qs C) - -# defines -SET(PREFIX ${CMAKE_INSTALL_PREFIX}) -SET(EXEC_PREFIX "\${prefix}") -SET(LIBDIR "\${prefix}/lib") -SET(INCLUDEDIR "\${prefix}/include") -SET(VERSION 0.1.0) +ADD_DEFINITIONS("-DPACKAGE=\"${WIFI_POPUP}\"") ADD_DEFINITIONS(-DTIZEN_WIFI_QS) # source files SET(SRCS - ../common/i18nmanager.c - ../common/appcoreWrapper.c - ../common/connection_manager.c - ../common/wlan_manager.c - ../common/wlan_connection.c - ../common/common_utils.c - ../common/common_ip_info.c - ../common/common_pswd_popup.c - ../common/common_eap_connect.c - ../common/common_generate_pin.c - ${ENGINE_SOURCES} + ${COMMON_SRC_DIR}/i18nmanager.c + ${COMMON_SRC_DIR}/appcoreWrapper.c + ${COMMON_SRC_DIR}/connection_manager.c + ${COMMON_SRC_DIR}/wlan_manager.c + ${COMMON_SRC_DIR}/wlan_connection.c + ${COMMON_SRC_DIR}/common_utils.c + ${COMMON_SRC_DIR}/common_ip_info.c + ${COMMON_SRC_DIR}/common_pswd_popup.c + ${COMMON_SRC_DIR}/common_eap_connect.c + ${COMMON_SRC_DIR}/common_generate_pin.c view-main.c view-alerts.c wifi-syspopup.c - wifi-syspopup-engine-callback.c) - -FOREACH(flag ${pkgs_CFLAGS}) - SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}") -ENDFOREACH(flag) - -SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fPIE") - -ADD_DEFINITIONS("-DPREFIX=\"${CMAKE_INSTALL_PREFIX}\"") - -# add executable -ADD_EXECUTABLE(${PROJECT_NAME} ${SRCS}) -SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -pie") - -TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_LDFLAGS}) - -ADD_CUSTOM_TARGET(wifi-syspopup-custom.edj - COMMAND edje_cc -id ${CMAKE_SOURCE_DIR}/res/images - ${CMAKE_CURRENT_SOURCE_DIR}/edc/wifi-syspopup-custom.edc - ${CMAKE_CURRENT_SOURCE_DIR}/edc/wifi-syspopup-custom.edj - DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/edc/wifi-syspopup-custom.edc -) - -ADD_DEPENDENCIES(${PROJECT_NAME} wifi-syspopup-custom.edj) - -ADD_CUSTOM_TARGET(wifi-syspopup-custom-editfield.edj - COMMAND edje_cc -id ${CMAKE_SOURCE_DIR}/res/images - ${CMAKE_CURRENT_SOURCE_DIR}/edc/wifi-syspopup-custom-editfield.edc - ${CMAKE_CURRENT_SOURCE_DIR}/edc/wifi-syspopup-custom-editfield.edj - DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/edc/wifi-syspopup-custom-editfield.edc + wifi-syspopup-engine-callback.c ) -ADD_DEPENDENCIES(${PROJECT_NAME} wifi-syspopup-custom-editfield.edj) - -INSTALL(TARGETS ${PROJECT_NAME} DESTINATION /usr/bin) +# add executable +ADD_EXECUTABLE(${WIFI_POPUP} ${SRCS}) +TARGET_LINK_LIBRARIES(${WIFI_POPUP} ${pkgs_LIBRARIES}) +TARGET_COMPILE_OPTIONS(${WIFI_POPUP} PUBLIC ${pkgs_CFLAGS_OTHER}) +SET_TARGET_PROPERTIES(${WIFI_POPUP} PROPERTIES POSITION_INDEPENDENT_CODE ON) +INSTALL(TARGETS ${WIFI_POPUP} DESTINATION ${BIN_INSTALL_DIR}) # install image files - -INSTALL(FILES ${CMAKE_SOURCE_DIR}/res/images/A01-3_icon_captive.png DESTINATION /usr/share/icons) -INSTALL(FILES ${CMAKE_SOURCE_DIR}/res/images/noti_wifi_in_range.png DESTINATION /usr/share/icons) -INSTALL(FILES ${CMAKE_SOURCE_DIR}/res/images/noti_wifi_in_range_ongoing.png DESTINATION /usr/share/icons) -INSTALL(FILES ${CMAKE_SOURCE_DIR}/res/images/setting_wifi.png DESTINATION /usr/share/icons) -INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/edc/wifi-syspopup-custom.edj DESTINATION /usr/apps/net.wifi-qs/res/edje) -INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/edc/wifi-syspopup-custom-editfield.edj DESTINATION /usr/apps/net.wifi-qs/res/edje) -INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/net.${PROJECT_NAME}.xml DESTINATION /usr/share/packages/) +INSTALL(FILES ${CMAKE_SOURCE_DIR}/res/images/A01-3_icon_captive.png + DESTINATION ${SHARE_INSTALL_PREFIX}/icons) +INSTALL(FILES ${CMAKE_SOURCE_DIR}/res/images/noti_wifi_in_range.png + DESTINATION ${SHARE_INSTALL_PREFIX}/icons) +INSTALL(FILES ${CMAKE_SOURCE_DIR}/res/images/noti_wifi_in_range_ongoing.png + DESTINATION ${SHARE_INSTALL_PREFIX}/icons) +INSTALL(FILES ${CMAKE_SOURCE_DIR}/res/images/setting_wifi.png + DESTINATION ${SHARE_INSTALL_PREFIX}/icons) +INSTALL(FILES net.${WIFI_POPUP}.xml DESTINATION ${SHARE_INSTALL_PREFIX}/packages/) + +ADD_SUBDIRECTORY(edc) \ No newline at end of file diff --git a/wifi-syspopup/edc/CMakeLists.txt b/wifi-syspopup/edc/CMakeLists.txt new file mode 100644 index 0000000..9afc60b --- /dev/null +++ b/wifi-syspopup/edc/CMakeLists.txt @@ -0,0 +1,17 @@ +SET(EDC_DIR ${CMAKE_CURRENT_SOURCE_DIR}) +SET(IMAGE_DIR ${CMAKE_SOURCE_DIR}/res/images) +SET(FONT_DIR ${CMAKE_SOURCE_DIR}/res/fonts) +SET(EDC_FILES wifi-syspopup-custom.edc wifi-syspopup-custom-editfield.edc) + +FOREACH(edc_file ${EDC_FILES}) + GET_FILENAME_COMPONENT(FName ${edc_file} NAME_WE) + ADD_CUSTOM_TARGET(${FName}.edj + COMMAND edje_cc -id ${IMAGE_DIR} + ${EDC_DIR}/${edc_file} ${EDC_DIR}/${FName}.edj + DEPENDS ${EDC_DIR}/${edc_file} + ) + ADD_DEPENDENCIES(${WIFI_POPUP} ${FName}.edj) +ENDFOREACH() + +INSTALL(DIRECTORY ${EDC_DIR}/ DESTINATION ${APP_INSTALL_DIR}/net.wifi-qs/res/edje + FILES_MATCHING PATTERN "*.edj") \ No newline at end of file diff --git a/wifi-syspopup/wifi-syspopup.h b/wifi-syspopup/wifi-syspopup.h index 76f37e4..3fca884 100644 --- a/wifi-syspopup/wifi-syspopup.h +++ b/wifi-syspopup/wifi-syspopup.h @@ -31,7 +31,11 @@ extern "C" #include "common_pswd_popup.h" #include "common_eap_connect.h" -#define PACKAGE "wifi-qs" +#ifndef PACKAGE +#define PACKAGE "wifi-qs" +#warning "PACKAGE is redefined" +#endif + #define LOCALEDIR "/usr/share/locale" #define WIFI_SP_ICON_PATH "/usr/share/icons" -- 2.7.4