This C++ package provides C++ bindings for the ASAM Open Simulation Interface.
For more information on OSI see the official documentation or the class list for defined protobuf messages.
For usage examples, please refer to the official documentation:
- OSMP examples, including the code found at osi-sensor-model-packaging:
-
Open a terminal.
-
Clone the osi-cpp repository, including sub-modules:
git clone --recurse-submodules https://github.com/PMSFIT/osi-cpp.git
-
Switch to the repository directory:
cd osi-cpp
Especially for building on Windows, the use of vcpkg to handle dependencies is recommended.
This can be achieved easily through the use of the CMake vcpkg
preset when configuring:
In order to use the preset the environment variable VCPKG_ROOT
has to be set to the root of your vcpkg installation.
This can either be done manually, or through a CMake User preset that inherits from the vcpkg preset, i.e. by providing a CMakeUserPresets.json
file with the following content:
{
"version": 3,
"configurePresets": [
{
"name": "default",
"inherits": "vcpkg",
"environment": {
"VCPKG_ROOT": "C:\\vcpkg"
}
}
]
}
When building on windows for inclusion into a DLL, e.g. for FMU generation, you can inherit from the vcpkg-windows
preset instead of the vcpkg
preset to build for static linking into a DLL.
The build can then be performed in the following manner:
-
Configure the build:
cmake --preset default
-
Perform the build:
cmake --build build
See the vcpkg documentation for further information on the use of vcpkg in combination with CMake in various build environments.
To build without the use of vcpkg to handle dependencies, you have to ensure that necessary prerequisites are installed and detectable by CMake.
Once this has been achieved, the build can be performed in the following manner:
-
Configure the build:
cmake -B build
-
Perform the build:
cmake --build build
For detailed installation instructions, please refer to the official documentation: