Fix: efence library inclusion
[staging/xdg-launcher.git] / README.md
1 AGL CMake template
2 ================
3
4 Files used to build an application, or binding, project with the
5 AGL Application Framework.
6
7 To build your AGL project using these templates, you have to install
8 them within your project and adjust compilation option in `config.cmake`.
9 For technical reasons, you also have to specify **cmake** target in
10 sub CMakeLists.txt installed. Make a globbing search to find source files
11 isn't recommended now to handle project build especially in a multiuser 
12 project because CMake will not be aware of new or removed source files.
13
14 You'll find simple usage example for different kind of target under the `examples` folder.
15 More advanced usage can be saw with the [CAN_signaling binding](https://github.com/iotbzh/CAN_signaling) which mix external libraries,
16 binding, and html5 hybrid demo application.
17
18 Typical project architecture
19 ----------------------------------
20
21 A typical project architecture would be :
22
23 * \<root-path\>/
24 * \<root-path\>/<libs>
25 * \<root-path\>/packaging
26 * \<root-path\>/packaging/wgt
27 * \<root-path\>/packaging/wgt/etc
28 * \<root-path\>/\<target\>/
29
30 | # | Parent | Description | Files |
31 | - | -------| ----------- | ----- |
32 | \<root-path\> | - | Path to your project | Hold master CMakeLists.txt and general files of your projects. |
33 | \<libs\> | \<root-path\> | External dependencies libraries. This isn't to be used to include header file but build and link statically specifics libraries. | Library sources files. Can be a decompressed library archive file or project fork. |
34 | \<target\> | \<root-path\> | A sub component between: tool, binding, html5, html5-hybrid type. | ----- |
35 | packaging | \<root-path\> | Contains folder by package type (rpms, deb, wgt...) | Directory for each packaging type. |
36 | wgt | packaging | Files used to build project widget that can be installed on an AGL target. | config.xml.in, icon.png.in files. |
37 | etc | wgt | Configuration files for your project. This will be installed in the application root directory under etc/ folder once installed by Application Framework. | specific project configuration files |
38
39 Installation
40 --------------
41
42 Use the `install.sh` script to help you install templates to your project. Here is the help for it :
43
44 ```bash
45 $ ./install.sh -h
46 The general script's help msg
47 Usage: ./install.sh [-b|--binding-path <arg>] [-ha|--html5-app-path <arg>] [-d|--(no-)debug] [-h|--help] <root-path>
48         <root-path>: Project root path
49         -d,--debug,--no-debug: Optional debug flag. (off by default)
50         -h,--help: Prints help
51 ```
52
53 Usage
54 --------
55
56 Once installed, use them by customize depending on your project with file
57 `\<root-path\>/etc/config.cmake`. 
58
59 Specify manually your targets, you should look at samples provided in this repository to make yours.
60 Then when you are ready to build, using 'AGLBuild' that will wrap CMake build command:
61 ./AGLBuild package
62
63 Or with the classic way : 
64 mkdir -p build && cd build
65 cmake .. && make
66
67 Macro reference
68 --------------------
69
70 ### PROJECT_TARGET_ADD
71
72 Typical usage would be to add the target to your project using macro `PROJECT_TARGET_ADD` with the name of your target as parameter. Example:
73
74 ```cmake
75 PROJECT_TARGET_ADD(low-can-demo)
76 ```
77
78 This will make available the variable `${TARGET_NAME}` set with the specificied name.
79
80 ### search_targets
81
82 This macro will search in all subfolder any `CMakeLists.txt` file. If found then it will be added to your project. This could be use in an hybrid application by example where the binding lay in a sub directory. 
83
84 Usage : 
85
86 ```cmake
87 search_targets()
88 ```
89
90 ### populate_widget
91
92 Macro use to populate widget tree. To make this works you have to specify some propertiers to your target :
93
94 - LABELS : specify *BINDING*, *HTDOCS*, *EXECUTABLE*, *DATA*
95 - PREFIX : must be empty **""** when target is a *BINDING* else default prefix *lib* will be applied
96 - OUTPUT_NAME : Name of the output file generated, useful when generated file name is different from `${TARGET_NAME}`
97
98 Always specify  `populate_widget()` macro as the last statement, especially if you use ${TARGET_NAME} variable. Else variable will be set at wrong value with the **populate_** target name.
99
100 Usage :
101
102 ```cmake
103 populate_widget()
104 ```
105
106 ### build_widget
107
108 Use at project level, to gather all populated targets in the widget tree plus widget specifics files into a **WGT** archive. Generated under your `build` directory :
109
110 Usage :
111
112 ```cmake
113 build_widget()
114 ````