ENDMACRO()
GET_TREE(LOCAL_IMAGES_TREE "${LOCAL_IMAGES_DIR}")
+
+# If we try to build specific samples, we don't install some heavy things.
+# TODO : Currently, we did hard-coding.
+IF( NOT BUILD_EXAMPLE_NAME )
INSTALL_TREE_FILES(${LOCAL_IMAGES_DIR} "${LOCAL_IMAGES_TREE}" "*.png" ${IMAGES_DIR})
INSTALL_TREE_FILES(${LOCAL_IMAGES_DIR} "${LOCAL_IMAGES_TREE}" "*.jpg" ${IMAGES_DIR})
+INSTALL_TREE_FILES(${LOCAL_IMAGES_DIR} "${LOCAL_IMAGES_TREE}" "*.ico" ${IMAGES_DIR})
INSTALL_TREE_FILES(${LOCAL_IMAGES_DIR} "${LOCAL_IMAGES_TREE}" "*.gif" ${IMAGES_DIR})
INSTALL_TREE_FILES(${LOCAL_IMAGES_DIR} "${LOCAL_IMAGES_TREE}" "*.webp" ${IMAGES_DIR})
INSTALL_TREE_FILES(${LOCAL_IMAGES_DIR} "${LOCAL_IMAGES_TREE}" "*.bmp" ${IMAGES_DIR})
-INSTALL_TREE_FILES(${LOCAL_IMAGES_DIR} "${LOCAL_IMAGES_TREE}" "*.ico" ${IMAGES_DIR})
INSTALL_TREE_FILES(${LOCAL_IMAGES_DIR} "${LOCAL_IMAGES_TREE}" "*.wbmp" ${IMAGES_DIR})
INSTALL_TREE_FILES(${LOCAL_IMAGES_DIR} "${LOCAL_IMAGES_TREE}" "*.ktx" ${IMAGES_DIR})
INSTALL_TREE_FILES(${LOCAL_IMAGES_DIR} "${LOCAL_IMAGES_TREE}" "*.astc" ${IMAGES_DIR})
INSTALL_TREE_FILES(${LOCAL_IMAGES_DIR} "${LOCAL_IMAGES_TREE}" "*.svg" ${IMAGES_DIR})
INSTALL_TREE_FILES(${LOCAL_IMAGES_DIR} "${LOCAL_IMAGES_TREE}" "*.json" ${IMAGES_DIR})
+ELSE()
+INSTALL_TREE_FILES(${LOCAL_IMAGES_DIR} "${LOCAL_IMAGES_TREE}" "*com.samsung.dali-demo.png" ${IMAGES_DIR})
+INSTALL_TREE_FILES(${LOCAL_IMAGES_DIR} "${LOCAL_IMAGES_TREE}" "*dali-examples.png" ${IMAGES_DIR})
+INSTALL_TREE_FILES(${LOCAL_IMAGES_DIR} "${LOCAL_IMAGES_TREE}" "*dali-tests.png" ${IMAGES_DIR})
+ENDIF()
-FILE(GLOB LOCAL_VIDEOS_LIST RELATIVE "${LOCAL_VIDEOS_DIR}" "${LOCAL_VIDEOS_DIR}/*")
-FOREACH(flag ${LOCAL_VIDEOS_LIST})
- INSTALL(FILES ${LOCAL_VIDEOS_DIR}/${flag} DESTINATION ${VIDEOS_DIR})
+FILE(GLOB LOCAL_SHADERS_LIST RELATIVE "${LOCAL_SHADERS_DIR}" "${LOCAL_SHADERS_DIR}/*")
+FOREACH(flag ${LOCAL_SHADERS_LIST})
+ INSTALL(FILES ${LOCAL_SHADERS_DIR}/${flag} DESTINATION ${SHADERS_DIR})
ENDFOREACH(flag)
-GET_TREE(LOCAL_MODELS_TREE "${LOCAL_MODELS_DIR}")
-INSTALL_TREE_FILES(${LOCAL_MODELS_DIR} "${LOCAL_MODELS_TREE}" "*" ${MODELS_DIR})
-
FILE(GLOB LOCAL_SCRIPTS_LIST RELATIVE "${LOCAL_SCRIPTS_DIR}" "${LOCAL_SCRIPTS_DIR}/*.json")
FOREACH(flag ${LOCAL_SCRIPTS_LIST})
INSTALL(FILES ${LOCAL_SCRIPTS_DIR}/${flag} DESTINATION ${SCRIPTS_DIR})
ENDFOREACH(flag)
-FILE(GLOB LOCAL_SHADERS_LIST RELATIVE "${LOCAL_SHADERS_DIR}" "${LOCAL_SHADERS_DIR}/*")
-FOREACH(flag ${LOCAL_SHADERS_LIST})
- INSTALL(FILES ${LOCAL_SHADERS_DIR}/${flag} DESTINATION ${SHADERS_DIR})
+# If we try to build specific samples, we don't install some heavy things.
+IF( NOT BUILD_EXAMPLE_NAME )
+FILE(GLOB LOCAL_VIDEOS_LIST RELATIVE "${LOCAL_VIDEOS_DIR}" "${LOCAL_VIDEOS_DIR}/*")
+FOREACH(flag ${LOCAL_VIDEOS_LIST})
+ INSTALL(FILES ${LOCAL_VIDEOS_DIR}/${flag} DESTINATION ${VIDEOS_DIR})
ENDFOREACH(flag)
+GET_TREE(LOCAL_MODELS_TREE "${LOCAL_MODELS_DIR}")
+INSTALL_TREE_FILES(${LOCAL_MODELS_DIR} "${LOCAL_MODELS_TREE}" "*" ${MODELS_DIR})
+
FILE(GLOB LOCAL_GAME_LIST RELATIVE "${LOCAL_GAME_DIR}" "${LOCAL_GAME_DIR}/*.*")
FOREACH(flag ${LOCAL_GAME_LIST})
INSTALL(FILES ${LOCAL_GAME_DIR}/${flag} DESTINATION ${GAME_DIR})
ENDFOREACH(flag)
+ENDIF()
#Create resources location file
CONFIGURE_FILE( resources-location.in ${DEMO_SHARED}/resources-location.cpp )
SET(CURRENT_BUILD_PLATFORM "Ubuntu")
ENDIF()
+# Setup CURRENT_BUILD_EXAMPLE_NAME to use at message
+IF(NOT BUILD_EXAMPLE_NAME)
+ SET(CURRENT_BUILD_EXAMPLE_NAME "ALL EXAMPLES")
+ELSE()
+ SET(CURRENT_BUILD_EXAMPLE_NAME ${BUILD_EXAMPLE_NAME})
+ENDIF()
+
+
MESSAGE( " Folder DEMO_IMAGE_DIR : [" ${DEMO_IMAGE_DIR} "]" )
MESSAGE( " Folder DEMO_STYLE_DIR : [" ${DEMO_STYLE_DIR} "]" )
MESSAGE( " Folder DEMO_SHADER_DIR : [" ${DEMO_SHADER_DIR} "]" )
MESSAGE( " Folder DEMO_EXAMPLE_BIN : [" ${DEMO_EXAMPLE_BIN} "]" )
MESSAGE( " Folder DEMO_LANG : [" ${DEMO_LANG} "]" )
MESSAGE( " Current Build Platform : [" ${CURRENT_BUILD_PLATFORM} "]" )
-MESSAGE( " Scene3D Enabled : [" ${ENABLE_SCENE3D} "]" )
+MESSAGE( " Build example name : [" ${CURRENT_BUILD_EXAMPLE_NAME} "]" )
+MESSAGE( " Scene3D Enabled : [" ${ENABLE_SCENE3D} "]" )
MESSAGE( FATAL_ERROR "dali-shader-generator not found!" )
ENDIF()
-FOREACH(EXAMPLE ${SUBDIRS})
+FUNCTION(INSTALL_EXAMPLES EXAMPLE)
SET(PARENT_CMAKE_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../")
FILE(GLOB SRCS "${EXAMPLES_SRC_DIR}/${EXAMPLE}/*.cpp")
SET(SRCS ${SRCS} "${ROOT_SRC_DIR}/shared/resources-location.cpp")
ADD_CUSTOM_TARGET(${EXAMPLE}-generate-shaders
COMMAND ${SHADER_GENERATOR} --skip ${SHADER_SOURCE_DIR} ${SHADER_GENERATED_DIR})
SET_PROPERTY(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES
- "${SHADER_GENERATED_DIR}")
+ "${SHADER_GENERATED_DIR}")
ADD_DEPENDENCIES(${EXAMPLE}.example ${EXAMPLE}-generate-shaders)
ENDIF()
TARGET_LINK_LIBRARIES(${EXAMPLE}.example ${REQUIRED_LIBS})
INSTALL(TARGETS ${EXAMPLE}.example DESTINATION ${BINDIR})
-ENDFOREACH(EXAMPLE)
+ENDFUNCTION()
+
+IF( NOT BUILD_EXAMPLE_NAME )
+ FOREACH(EXAMPLE ${SUBDIRS})
+ INSTALL_EXAMPLES(${EXAMPLE})
+ ENDFOREACH(EXAMPLE)
+ELSE()
+ INSTALL_EXAMPLES(${BUILD_EXAMPLE_NAME})
+ENDIF()
+
-DLOCAL_STYLE_DIR=%{local_style_dir} \
-DINTERNATIONALIZATION:BOOL=OFF \
-DTIZEN:BOOL=ON \
+%if "%{?build_example_name}" != ""
+ -DBUILD_EXAMPLE_NAME=%{?build_example_name} \
+%endif
.
make %{?jobs:-j%jobs}
%{dali_app_exe_dir}/dali-tests
%{dali_app_exe_dir}/*.example
%{dali_app_exe_dir}/dali-builder
+%if "%{?build_example_name}" == ""
%{dali_app_res_dir}/images/*
%{dali_app_res_dir}/game/*
%{dali_app_res_dir}/videos/*
%{dali_app_res_dir}/models/*
+%endif
%{dali_app_res_dir}/scripts/*
%{dali_app_res_dir}/shaders/*
%{dali_xml_file_dir}/%{name}.xml