summaryrefslogtreecommitdiffstats
path: root/docs/usage.md
blob: 22918295001760fad393de73ba51e5375ce66a9b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# Usage

## Installation

The afb-helpers library is integrated by default in the AGL SDK since the Guppy
version (>=7) and is also available as a package for the AGL supported linux
distributions.

You could find the SDK build from Yocto which embed the afb-helpers library
here:

* For the [releases](https://download.automotivelinux.org/AGL/release/) >= Guppy
 in the latest machine's deploy directory. (e.g for Guppy in
 `latest/<yourmachine>/deploy/sdk` directory)
* For the [master](https://download.automotivelinux.org/AGL/snapshots/master/)
 development branch, in the latest machine's deploy directory. (e.g in
 `latest/<yourmachine>/deploy/sdk` directory)

To install the native package please refer to [this chapter](../host-configuration/docs/1_Prerequisites.md)
in the AGL documentation to install the AGL repository for your distribution.

Then use your package manager to install the library.

### OpenSuse

```bash
sudo zypper ref
sudo zypper install agl-libafb-helpers-devel
```

### Fedora

```bash
sudo dnf ref
sudo dnf install agl-libafb-helpers-devel
```

### Ubuntu/Debian

```bash
sudo apt-get update
sudo apt-get install agl-libafb-helpers-dev
```

## (Optionnal) Remove the git submodule version

If you already use the afb-helpers component but using the submodule version
then you have to get rid of it to be sure to link and use the library version.
To do so, you have to do the following:

* Deinitialize the submodule using `git`

```bash
# This example assumes that the git submodule is named app-afb-helpers-submodule
# and is located at your root project repository.
git submodule deinit app-afb-helpers-submodule
```

* Remove the submodule relatives lines from the `.gitmodules` file

```bash
vim .gitmodules
```

* Remove the `afb-helpers` target link from any CMake target you specified.
 Those lines look like:

```bash
TARGET_LINK_LIBRARIES(${TARGET_NAME}
    afb-helpers # REMOVE THIS LINE
    ${link_libraries}
    )
```

## Add the libafb-helpers as a static library to your binding

In your `config.cmake` file, add a dependency to the controller library, i.e:

```cmake
set(PKG_REQUIRED_LIST
	json-c
	afb-daemon
	afb-helpers --> this is the afb-helpers library dependency name.
)
```

Or you can also use the [FIND_PACKAGE](https://cmake.org/cmake/help/v3.6/command/find_package.html?highlight=find_package)
CMake command to add it if you don't use the [cmake-apps-module](../cmakeafbtemplates/dev_guide/cmake-overview.html)