summaryrefslogtreecommitdiff
path: root/CommonAPI-Examples/README
blob: 19ce46cf23744caa2109ac621935ed317f59c9e4 (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
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. That means:

- You can start the code generator in your Eclipse installation or from command line.
- Your PKG_CONFIG_PATH contains the paths to the package config files of CommnAPI, CommonAPI-DBus and your patched D-Bus.
- You have patched the DBus library with the patch in CommonAPI-D-Bus and you are sure that your LD_LIBRARY_PATH contains the path to the patched DBus library.
- Make sure dbus session bus is available ($ env |grep DBUS_SESSION_BUS_ADDRESS, output must not be empty!).
- If your platform is Windows, please read the instructions for Windows first. The following instructions assume that your are working on a Linux platform.

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:

----
$ mkdir build; cd build
$ cmake -D DBUS_PATH_LOCAL=<your_local_path_of_the_patched_dbus_library> -D PRJ_NAME=<name_of_the_example> ..
$ make
----

_name_of_the_example_ is +e01HelloWorld+ for the first example.

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 (eg /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 (eg via Window->Show View->Make Target). Set the build command to:

----
cmake -E chdir build/ cmake -D DBUS_PATH_LOCAL=
	<your_local_path_of_the_patched_dbus_library> -D PRJ_NAME=<name_of_the_example> ..
----

and leave the Make Target field empty. Finally, create in "Run Configurations" two configurations for client and service. Note that it might be necessary to start the executables with a local setting of the +LD_LIBRARY_PATH+ (eg to +/usr/local/lib+) since CommonAPI applications use a patched version of libdbus.