summaryrefslogtreecommitdiff
path: root/CommonAPI-Examples/README
blob: 56f9b640d62184d28e61f29fd9d2718c1be2f290 (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
=== Preliminary remarks

The examples describe how some standard problems of interface design and implementation can be solved with Franca IDL and CommonAPI. Before you start make sure that your environment is properly installed as described in the integration guide. Please do not consider only the integration guide in this document but also in the binding specific tutorial.

The examples provide a more or less generic CMake file for building the executables. Two executables are needed: a service and a client program. The standard procedure to build one of these example programs is:

----
$ cd build
$ cmake -DUSE_INSTALLED_COMMONAPI=ON/OFF ..
$ make
----

Set +USE_INSTALLED_COMMONAPI+ to +ON+ if you use an installed version of CommonAPI; set it to +OFF+ if you use the working copy.

In case you are using the D-Bus binding and you have not installed the patched D-Bus library (_libdbus_) it might be necessary to set a D-Bus specific option:

----
cmake -DUSE_INSTALLED_COMMONAPI=OFF -DUSE_INSTALLED_DBUS=OFF ..
----

Please read also the chapters in the user guide about the configuration files. One possibility to specify the path to the CommonAPI configuration file is to set the environment variable:

----
export COMMONAPI_CONFIG=<path to CommonAPI-Examples>/E01HelloWorld/commonapi4dbus.ini
----

If do not specify any configuration file it is assumed that you want to use the D-Bus binding. Other environment variables you might need are:

* +LD_LIBRARY_PATH+ should contain the path to the _libdbus_ if you use the D-Bus binding with an uninstalled _libdbus_ and should contain the path to your gluecode libraries, e.g. +LD_LIBRARY_PATH=<path to libdbus>/dbus-1.8.20/dbus/.libs:<path to CommonAPI-Tools>/CommonAPI-Examples/E01HelloWorld/build+

* +VSOMEIP_CONFIGURATION_FILE+ should contain the path to your vsomeip configuration file if you are using the SOME/IP binding, e.g. +VSOMEIP_CONFIGURATION_FILE=<path to CommonAPI-Tools>/CommonAPI-Examples/E01HelloWorld/vsomeip-local.json+

Here are some hints if you want to configure your eclipse project for the CMake build:

- Install the CMakeEd plug-in which provides an editor for CMake files (http://cmakeed.sourceforge.net/eclipse/).
- Create a build directory (e.g. /build) directly in the project directory.
- Select the projects properties, then C/C++ build and set the Build Command to your make call:

----
make -C ${ProjDirPath}/build VERBOSE=1
----

The build directory must be empty. Create a make target (e.g. via _Window->Show View->Make Target_). Set the build command to:

----
cmake -E chdir build/ cmake <options> ..
----

The above described environment variables you could specify in the _Run Configuration_ of your executable files (cleint and service).