HOW TO CROSSCOMPILE A WS4D-PROJECT WITH CMAKE
=============================================

For Cross-Compilation of WS4D-gSOAP CMake version 2.6 or higher is
required!  Currently this feature is only tested on linux systems with
the CMake Makefile generator. It should also work on all UNIX-like
Systems like Cygwin and MacOSX.

Configure WS4D-gSOAP for Cross Compilation
------------------------------------------

To crosscompile the WS4D-gSOAP Toolkit you need a non-cross
installation of WS4D-gSOAP first!!! See INSTALL for further
instructions how to install WS4D-gSOAP. After installing WS4D-gSOAP
you can continue with the configuration of WS4D-gSOAP for cross
compilation. It is recommended to use a out-of-source configuration
for cross compilation.

A typical cross compilation configuration for WS4D-gSOAP might look
like this::

  $ ls -d ws4d-gsoap
  ws4d-gsoap/
  $ mkdir ws4d-gsoap-build-cross
  $ mkdir ws4d-gsoap-install-cross

For cross compilation with CMake you need a toolchain file to support
the development environment of yourt target plaform. How to create
such a toolchain file you can read in the CMake documentation. Some
target plattforms are already supported by WS4D-gSOAP. You can find
corresponding toolchain files in the toolchains directory.

Toolchain files may require further configuration! So look at the
toolchain file if all paths are correct or if you have to specify
further CMake variables.

Now you can run CMake to configure the build system::

  $ cd ws4d-gsoap-build-cross
  $ cmake \
    -DCMAKE_TOOLCHAIN_FILE=[absolute path to toolchain file] \
    -DGSOAP_PATH:PATH=[absolute path to gsoap installation] \
    -DDPWS_HOSTEXEC_PATH:PATH=[absolute path to non-cross toolkit installation] \
    -DCMAKE_INSTALL_PREFIX:PATH=[absolute path to cross installation directory] \
    ../ws4d-gsoap

Cross Compile  WS4D-gSOAP 
-------------------------

The WS4D-gSOAP cross compilation configuration only supports the CMake
Makefile generator. 

A typical out-of-source build for WS4D-gSOAP might look like this::

  $ ls -d ws4d-gsoap
  ws4d-gsoap/ 
  $ cd ws4d-gsoap-build-cross
  $ make install

Crosscompiling your own Project
-------------------------------

There is a sample project included in all non-cross WS4D-gSOAP
installations called airconditioner project under
share/doc/ws4d-gsoap/example. This sample is not part of WS4D-gSOAP
installation created using the steps for cross compilation described
above !!!!  

The airconditioner project also uses CMake and supports cross
compilation. For cross compilation you have to specify a toolchain
file and WS4D-gSOAP cross installation.

Toolchain files may require further configuration! So look at the
toolchain file if all paths are correct or if you have to specify
further CMake variables.

A typical out-of-source configuration for the airconditioner project
for cross compilation might look like this::

  $ mkdir airconditioner-build-cross
  $ cd airconditioner-build-cross
  $ cmake \
    -DCMAKE_TOOLCHAIN_FILE=[absolute path to toolchain file] \
    -DDPWS_PATH:PATH=[absolute path to WS4D-gSOAP cross installation] \
    [path to WS4D-gSOAP installation]/share/doc/ws4d-gsoap/example

The project uses the built in default gSOAP installation that was used to
compile WS4D-gSOAP. You can also specifiy other installations of gSOAP
with the GSOAP_PATH and DPWS_PATH variables. These
varaibles can either be specified as environment variables or as
arguments to cmake::

  $ cmake \
    -DCMAKE_TOOLCHAIN_FILE=[absolute path to toolchain file] \
    -DGSOAP_PATH:PATH=[absolute path to gsoap installation] \
    -DDPWS_PATH:PATH=[absolute path to WS4D-gSOAP cross installation] \
    [path to WS4D-gSOAP installation]/share/doc/ws4d-gsoap/example

You should always use the same gSOAP installation that was also used
to compile WS4D-gSOAP!!! WS4D-gSOAP relies on code generated by gSOAP
and won't work if you use another gSOAP version than the version you
used to compile WS4D-gSOAP!!!

A typical out-of-source build for the airconditioner project might
look like this::

  $ cd airconditioner-build
  $ make

You can find the cross compiled executables of the project under
airconditioner-build/bin.

