Using CMake for Wind River vxWorks Cross-Compile

Prerequisites

It is assumed that the Wind River vxWorks development environment is installed on your machine and available in the path to be found by the CMake tool.

A VSB corresponding to the RaimaDB target libraries needs to be generated. See VxWorks Source Build (VSB) section for instructions.

Prebuilt RaimaDB Cross Targets

The available cross-targets in the RaimaDB installation package can be found in the root directory of the installed package. For example, the Linux hosted vxWorks cross-target installer contains one or more targets, as show below:

The cross-target directories will typically be named similar to the intended target architecture and will not be one of the directories already described in the Installation Directory Layout.

All cross-targets will contain an identical layout of a bin and lib directory. The lib/cmake/RDM directory contains the toolchain.cmake for building as well as CMake support files. The preset.json file contains information on how the RaimaDB libraries for this target were built.

The following also assumes that you are running in a Wind River environment shell. For example:

$ ./WindRiver/wrenv.sh -p vxworks/23.03

Building the GettingStarted/c-core/core01Example

The following steps can be applied to any of the C or C++ examples.

The following also assumes that you are running in a Wind River environment shell:

  1. Create a "build" directory and make the new directory the current directory.
$ mkdir mybuild
$ cd mybuild
  1. Run the CMake configuration for the cross-target of your choice. This is done by using the predefined toolchain.cmake for
$ cmake -G "Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE=/opt/Raima/rdm-<package>-16.0//<cross-target-directory>/lib/cmake/RDM/toolchain.cmake /opt/Raima/rdm-<package>-16.0//share/RDM/GettingStarted/c-core/core01Example

For example, the following will build the core01Example example for a 64bit ARM using the rdm_enterprise package.

  1. Assuming no errors on the CMake configuration, the executable can be generated with:
$ make

or

$ cmake --build .

Below is the console out put from building the QNX aarch64 configuration from above:

The default for RaimaDB cross-targets is STATIC builds. The resulting executable from the build can be copied to the target hardware and executed without needing to copy additional libraries.