BaSyx / Download / Cpp Setup
How to build the BaSyx C++ SDK
The BaSyx C++ SDK is now using CMake to generate and control its building process. This article will detail on how to build the C++ SDK from a fresh checkout.
The BaSyx C++ SDK requires the following dependencies to successfully build:
- A C++11 compiler (GCC, Clang, etc.)
- CMake (version >=3.11.0) (https://cmake.org)
BaSyx C++ SDK Build Switches
The following switches can be applied during the generation step to control the building process of the BaSyx C++ SDK:
BASYX_BUILD_TESTS [ON/OFF] (default=ON): Specifies if unit tests are to be build
BASYX_UTILITY_PROJECTS [ON/OFF] (default=OFF): Specifies if BaSyx utility targets for (if installed) cppcheck and clang-tidy static code analysis are to be generated.
Generating Build Files
The following section describes the different approaches on how to generate the build files.
Command Line Client
This section describes how to generate and build the BaSyx C++ SDK from a fresh checkout using the command line.
For this apporach an out-of-source build is recommended, but not necessary.
From a command line invoke the following commands:
git clone basyx
mkdir build && cd build
This will generate and create the systems default build files (e.g. Makefiles on UNIX systems) in the previously created build folder.
The C++ SDK can then be built using (in the case of UNIX Makefiles):
or in a more general, platform agnostic way using:
cmake --build .
Build switches can be supplied during the generation step on the command line like this:
cmake ../basyx/sdks/c++/basys.sdk.cc -DBASYX_BUILD_TESTS=OFF -DBASYX_UTILITY_PROJECTS=ON
The -G flag can be used to specify the build system for which the build files are generated. An example generating Makefiles for MinGW from the command line looks like this:
cmake -G"MinGW Makefiles" ../basyx/sdks/c++/basys.sdk.cc
For more information regarding the different generators and CMake in general refer to https://cmake.org/cmake/help/latest/
CMake Graphical User Interface
Integration in Eclipse CDT IDE
Cross-compilation with Toolchain File
The BaSyx C++ SDK was successfully tested and built using the following compilers:
- GCC (version 8.2.1 20181127)
- Clang (version 7.0.1)
- MinGW (v?.??)