"res" directory houses resources like images, models and videos.
Change-Id: I7af9c4b1cf3aac06feb06113104c7f8fbc48867d
SET(dali-demo_VERSION_MINOR 0)
SET(ROOT_SRC_DIR ${CMAKE_SOURCE_DIR}/../..)
+SET(DEMO_SHARED ${CMAKE_SOURCE_DIR}/../../shared)
SET(PREFIX ${CMAKE_INSTALL_PREFIX})
IF(DEFINED DALI_APP_DIR)
- SET(APP_DATA_DIR ${DALI_APP_DIR})
- SET(BINDIR ${APP_DATA_DIR}/bin)
+ SET(BINDIR ${DALI_APP_DIR}/bin)
ELSE()
- SET(APP_DATA_DIR ${PREFIX}/share/com.samsung.dali-demo)
SET(BINDIR ${PREFIX}/bin)
ENDIF()
+IF(DEFINED DALI_APP_RES_DIR)
+ SET(APP_DATA_RES_DIR ${DALI_APP_RES_DIR})
+ELSE()
+ SET(APP_DATA_RES_DIR ${PREFIX}/share/com.samsung.dali-demo/res)
+ENDIF()
+
MESSAGE( STATUS "CMAKE_BUILD_TYPE: " ${CMAKE_BUILD_TYPE} )
if(CMAKE_BUILD_TYPE MATCHES Debug)
MESSAGE("Setting variable: DEBUG_ENABLED")
SET(LOCAL_STYLE_DIR ${RESOURCE_DIR}/style)
ENDIF()
-SET(IMAGES_DIR ${APP_DATA_DIR}/images/)
-SET(VIDEOS_DIR ${APP_DATA_DIR}/videos/)
-SET(MODELS_DIR ${APP_DATA_DIR}/models/)
-SET(SCRIPTS_DIR ${APP_DATA_DIR}/scripts/)
-SET(STYLE_DIR ${APP_DATA_DIR}style/)
+SET(IMAGES_DIR ${APP_DATA_RES_DIR}/images/)
+SET(VIDEOS_DIR ${APP_DATA_RES_DIR}/videos/)
+SET(MODELS_DIR ${APP_DATA_RES_DIR}/models/)
+SET(SCRIPTS_DIR ${APP_DATA_RES_DIR}/scripts/)
+SET(STYLE_DIR ${APP_DATA_RES_DIR}/style/)
IF(NOT DEFINED LOCALE_DIR)
SET(LOCALE_DIR ${PREFIX}/share/locale)
INSTALL(FILES ${LOCAL_SCRIPTS_DIR}/${flag} DESTINATION ${SCRIPTS_DIR})
ENDFOREACH(flag)
+#Create resources location file
+CONFIGURE_FILE( resources-location.in ${DEMO_SHARED}/resources-location.cpp )
+
#Replace @DEMO_STYLE_IMAGE_DIR@ in following files
CONFIGURE_FILE( ${LOCAL_STYLE_DIR}/demo-theme.json.in ${LOCAL_STYLE_DIR}/demo-theme.json )
CONFIGURE_FILE( ${LOCAL_STYLE_DIR}/style-example-theme-one.json.in ${LOCAL_STYLE_DIR}/style-example-theme-one.json )
AUX_SOURCE_DIRECTORY(${DEMO_SRC_DIR} DEMO_SRCS)
+
+IF(NOT DEFINED DALI_APP_RES_DIR)
+ message([STATUS] "Setting application resource path from resource-location file")
+ SET( DEMO_SRCS ${DEMO_SRCS} "${ROOT_SRC_DIR}/shared/resources-location.cpp")
+ENDIF()
+
ADD_EXECUTABLE(${PROJECT_NAME} ${DEMO_SRCS})
TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${REQUIRED_PKGS_LDFLAGS} -pie)
FOREACH(EXAMPLE ${SUBDIRS})
FILE(GLOB SRCS "${EXAMPLES_SRC_DIR}/${EXAMPLE}/*.cpp")
+ IF(NOT DEFINED DALI_APP_RES_DIR)
+ SET( DEMO_SRCS ${DEMO_SRCS} "${ROOT_SRC_DIR}/shared/resources-location.cpp")
+ ENDIF()
ADD_EXECUTABLE(${EXAMPLE}.example ${SRCS})
TARGET_LINK_LIBRARIES(${EXAMPLE}.example ${REQUIRED_PKGS_LDFLAGS} -pie)
INSTALL(TARGETS ${EXAMPLE}.example DESTINATION ${BINDIR})
--- /dev/null
+/**
+ * This file defines the location dali-demo resources
+ It is used exclusively for Ubuntu builds where an application resource directory is explicity defined.
+ */
+
+#include <cstdlib>
+
+int dali_demo_RESOURCE_DIR = setenv("DALI_APPLICATION_PACKAGE", "@APP_DATA_RES_DIR@" , 1);
%define smack_rule_dir %TZ_SYS_SMACK/accesses2.d/
%endif
+%define dali_app_res_dir %{dali_app_ro_dir}/res/
%define dali_app_exe_dir %{dali_app_ro_dir}/bin/
-%define locale_dir %{dali_app_ro_dir}/res/locale
+%define locale_dir %{dali_app_res_dir}/locale
%define local_style_dir ../../resources/style/mobile
##############################
cmake -DDALI_APP_DIR=%{dali_app_ro_dir} \
-DLOCALE_DIR=%{locale_dir} \
+ -DDALI_APP_RES_DIR=%{dali_app_res_dir} \
%if 0%{?enable_debug}
-DCMAKE_BUILD_TYPE=Debug \
%endif
rm -rf %{buildroot}
cd build/tizen
%make_install DALI_APP_DIR=%{dali_app_ro_dir}
+%make_install DDALI_APP_RES_DIR=%{dali_app_res_dir}
mkdir -p %{buildroot}%{dali_xml_file_dir}
cp -f %{_builddir}/%{name}-%{version}/%{name}.xml %{buildroot}%{dali_xml_file_dir}
mkdir -p %{buildroot}%{dali_icon_dir}
-mv %{buildroot}/%{dali_app_ro_dir}/images/%{name}.png %{buildroot}%{dali_icon_dir}
+mv %{buildroot}/%{dali_app_res_dir}/images/%{name}.png %{buildroot}%{dali_icon_dir}
%if 0%{?enable_dali_smack_rules} && !%{with wayland}
mkdir -p %{buildroot}%{smack_rule_dir}
%{dali_app_exe_dir}/dali-demo
%{dali_app_exe_dir}/*.example
%{dali_app_exe_dir}/dali-builder
-%{dali_app_ro_dir}/images/*
-%{dali_app_ro_dir}/videos/*
-%{dali_app_ro_dir}/models/*
-%{dali_app_ro_dir}/scripts/*
-%{dali_app_ro_dir}/style/*
-%{dali_app_ro_dir}/style/images/*
+%{dali_app_res_dir}/images/*
+%{dali_app_res_dir}/videos/*
+%{dali_app_res_dir}/models/*
+%{dali_app_res_dir}/scripts/*
+%{dali_app_res_dir}/style/*
+%{dali_app_res_dir}/style/images/*
%{dali_xml_file_dir}/%{name}.xml
%{dali_icon_dir}/*
%{locale_dir}/*
*/
{
- "constants":
- {
- "DEMO_IMAGE_DIR":"@DEMO_STYLE_IMAGE_DIR@"
- },
-
"styles":
{
"confirmationpopup":{
- "popupBackgroundImage":"{DEMO_IMAGE_DIR}00_popup_bg.9.png"
+ "popupBackgroundImage":"{APPLICATION_RESOURCE_PATH}/images/00_popup_bg.9.png"
},
"textlabel-Rosemary":
{
"constants":
{
- "DEMO_IMAGE_DIR":"@DEMO_STYLE_IMAGE_DIR@"
+ "STYLE_DIR":"{APPLICATION_RESOURCE_PATH}/style"
},
"styles":
{
// Change an icon size, see if it gets properly re-sized
"radiobutton":{
- "unselectedStateImage":"{DEMO_IMAGE_DIR}/radio-button-unselected.png",
- "selectedStateImage":"{DEMO_IMAGE_DIR}/radio-button-selected.png",
- "disabledStateImage":"{DEMO_IMAGE_DIR}/radio-button-unselected-disabled.png",
+ "unselectedStateImage":"{STYLE_DIR}/images/radio-button-unselected.png",
+ "selectedStateImage":"{STYLE_DIR}/images/radio-button-selected.png",
+ "disabledStateImage":"{STYLE_DIR}/images/radio-button-unselected-disabled.png",
"imageLabelGap":10,
"label":{
"textColor": [0.1,1,1,1]
"colorSlider1":{
"styles":["thinslider"],
"progressVisual":{
- "url":"{DEMO_IMAGE_DIR}/slider-skin-progress-red.9.png"
+ "url":"{STYLE_DIR}/images/slider-skin-progress-red.9.png"
}
},
"colorSlider2":{
"styles":["thinslider"],
"progressVisual":{
- "url":"{DEMO_IMAGE_DIR}/slider-skin-progress-green.9.png"
+ "url":"{STYLE_DIR}/images/slider-skin-progress-green.9.png"
}
},
"colorSlider3":{
"styles":["thinslider"],
"progressVisual":{
- "url":"{DEMO_IMAGE_DIR}/slider-skin-progress-blue.9.png"
+ "url":"{STYLE_DIR}/images/slider-skin-progress-blue.9.png"
}
}
}