Merge branch 'devel/master' into tizen
[platform/core/uifw/dali-demo.git] / README.md
1 <img src="https://dalihub.github.io/images/DaliLogo320x200.png">
2
3 # Table of Contents
4
5    * [Build Instructions](#build-instructions)
6       * [1. Building for Ubuntu desktop](#1-building-for-ubuntu-desktop)
7          * [Minimum Requirements](#minimum-requirements)
8          * [Building the Repository](#building-the-repository)
9          * [DEBUG Builds](#debug-builds)
10       * [2. GBS Builds](#2-gbs-builds)
11          * [NON-SMACK Targets](#non-smack-targets)
12          * [SMACK enabled Targets](#smack-enabled-targets)
13          * [DEBUG Builds](#debug-builds-1)
14       * [3. Building for Android](#3-android-builds)
15       * [4. Building for MS Windows](#4-windows-builds)
16          * Build with the Visual Studio project.
17          * Build with CMake.
18    * [Creating an example](#creating-an-example)
19
20 # Build Instructions
21
22 ## 1. Building for Ubuntu desktop
23
24 ### Requirements
25
26  - Ubuntu 16.04 or later
27  - Environment created using dali_env script in dali-core repository
28  - GCC version 9
29  - Cmake version 3.8.2 or later
30
31 DALi requires a compiler supporting C++17 features.
32
33 ### Building the Repository
34
35 To build the repository enter the 'build/tizen' folder:
36
37          $ cd dali-demo/build/tizen
38
39 Then run the following commands:
40
41          $ cmake -DCMAKE_INSTALL_PREFIX=$DESKTOP_PREFIX .
42          $ make install -j8
43
44 ### DEBUG Builds
45
46 Specify a debug build when building for desktop by passing the following parameter to cmake:
47
48          $ cmake -DCMAKE_INSTALL_PREFIX=$DESKTOP_PREFIX -DCMAKE_BUILD_TYPE=Debug .
49
50 Before running make install as normal:
51
52          $ make install -j8
53
54 ## 2. GBS Builds
55
56 ### NON-SMACK Targets
57
58          $ gbs build -A [TARGET_ARCH]
59
60 ### SMACK enabled Targets
61
62          $ gbs build -A [TARGET_ARCH] --define "%enable_dali_smack_rules 1"
63
64 ### DEBUG Builds
65
66          $ gbs build -A [TARGET_ARCH] --define "%enable_debug 1"
67
68 # Creating an example
69
70  - Make a directory in the "examples" directory. Only one example will be created per directory.
71  - The executable installed will have a ".example" appended to it, e.g. a "blocks" directory produces "blocks.example".
72  - Add all source files for the required example in this directory.
73  - Modify "com.samsung.dali-demo.xml" to include your example so that it can be launched on target.
74  - No changes are required to the make system as long as the above is followed, your example will be automatically built & installed.
75
76 ## 3. Building for Android
77
78 ### Requirements
79
80  - Ubuntu 16.04 or later
81  - Android DALi dependencies
82  - If you are behind a proxy, please set up the "http_proxy" and "https_proxy" environment variables appropriately
83  - Clone dali-core, dali-adaptor, dali-toolkit & android-dependencies to the same folder as dali-demo
84    - Android dependencies can be cloned from: https://github.com/dalihub/android-dependencies
85
86 ### Building the Repository
87 To build the repository enter the 'build/android' folder:
88
89          $ cd dali-demo/build/android
90
91 Then run the following command:
92
93          $ ./build.sh
94
95 For debug build:
96
97          $ DEBUG=1 ./build.sh
98
99 To debug from Android Studio set Android DALi enviroment using setenv script in 'build/android' and launch Android Studio from the enviroment:
100
101          $ . setenv
102          $ <path/to/androidstudio>/bin/studio.sh
103
104 To clean the build:
105
106          $ ./build.sh clean
107
108 To install apks:
109
110          $ adb install -r ./app/build/outputs/apk/debug/dali-demo-debug.apk
111          $ adb install -r ./app/build/outputs/apk/release/dali-demo-release.apk
112
113 ## 4. Building for MS Windows
114
115 Third party dependencies are built using vcpkg. Instructions on how to install vcpkg can be found in the
116 vcpkg-script folder in the windows-dependencies repository.
117
118 - Download the windows-dependencies repository from DaliHub
119
120          $ git clone https://github.com/dalihub/windows-dependencies.git
121
122 - Read the windows-dependencies/vcpkg-script/Readme.md file for more instructions on how to build and install the third-party dependencies.
123
124 ### Build with the Visual Studio project
125   Read the windows-dependencies/README.md file for more instructions on how to build and run DALi for MS Windows.
126
127 ### Build with CMake
128
129   * Requirements
130     It's required the version 3.12.2 of CMake and a Git Bash Shell.
131
132   * Notes and troubleshoting:
133     It should be possible to use the MS Visual studio Developer Command Prompt (https://docs.microsoft.com/en-us/dotnet/framework/tools/developer-command-prompt-for-vs) to build DALi from the command line.
134     However, the CMake version installed with MS Visual Studio 2017 is a bit out of date and some VCPKG modules require a higher version.
135     This instructions have been tested with CMake 3.12.2 on a Git Bash shell.
136
137   * Define an environment variable to set the path to the VCPKG folder
138
139     $ export VCPKG_FOLDER=C:/Users/username/Workspace/VCPKG_TOOL
140
141   * Define an environment variable to set the path where DALi is going to be installed.
142
143     $ export DALI_ENV_FOLDER=C:/Users/username/Workspace/dali-env
144
145   * Execute the following commands to create the makefiles, build and install DALi.
146
147     $ cmake -g Ninja . -DCMAKE_TOOLCHAIN_FILE=$VCPKG_FOLDER/vcpkg/scripts/buildsystems/vcpkg.cmake -DENABLE_PKG_CONFIGURE=OFF -DINTERNATIONALIZATION=OFF -DCMAKE_INSTALL_PREFIX=$DALI_ENV_FOLDER
148     $ cmake --build . --target install
149
150   * Options:
151     - CMAKE_TOOLCHAIN_FILE  ---> Needed to find packages installed by VCPKG.
152     - ENABLE_PKG_CONFIGURE  ---> Whether to install pkg configure files (not currently working on MS Windows. CMake modules used instead).
153     - INTERNATIONALIZATION  ---> Whether to generate and install internazionalization '.po' Portable Object files.
154     - CMAKE_INSTALL_PREFIX  ---> Were DALi is installed.
155     - ENABLE_DEBUG          ---> Whether to build with debug enabled.
156
157   * If dali-toolkit has been compiled with the USE_DEFAULT_RESOURCE_DIR option disabled then is needed to set global environment variables in order to find the default toolkit resources.
158
159     i.e
160     $ setx DALI_ENV_FOLDER C:/Users/username/dali-env
161     $ setx DALI_IMAGE_DIR $DALI_ENV_FOLDER/share/dali/toolkit/images/
162     $ setx DALI_SOUND_DIR $DALI_ENV_FOLDER/share/dali/toolkit/sounds/
163     $ setx DALI_STYLE_DIR $DALI_ENV_FOLDER/share/dali/toolkit/styles/
164     $ setx DALI_STYLE_IMAGE_DIR $DALI_ENV_FOLDER/share/dali/toolkit/styles/images/
165     $ setx DALI_DATA_READ_ONLY_DIR $DALI_ENV_FOLDER/share/dali/