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