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