Skip to content

Commit c5bc9f0

Browse files
committed
Add more up-to-date installation instructions
Signed-off-by: Pierre R. Mai <pmai@pmsf.de>
1 parent 47201aa commit c5bc9f0

File tree

1 file changed

+81
-2
lines changed

1 file changed

+81
-2
lines changed

README.md

Lines changed: 81 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,93 @@ This C++ package provides C++ bindings for the [ASAM Open Simulation Interface](
55

66
For more information on OSI see the [official documentation](https://opensimulationinterface.github.io/osi-antora-generator/asamosi/latest/specification/index.html) or the [class list](https://opensimulationinterface.github.io/osi-antora-generator/asamosi/latest/gen/annotated.html) for defined protobuf messages.
77

8-
## Usage
8+
Usage
9+
-----
10+
911
For usage examples, please refer to the official documentation:
1012
- [OSMP examples](https://opensimulationinterface.github.io/osi-antora-generator/asamosi/latest/sensor-model/setup/build_install_example.html), including the code found at [osi-sensor-model-packaging](https://github.com/OpenSimulationInterface/osi-sensor-model-packaging):
1113
- [OSMPDummySource](https://github.com/OpenSimulationInterface/osi-sensor-model-packaging/tree/master/examples/OSMPDummySource)
1214
- [OSMPDummySensor](https://github.com/OpenSimulationInterface/osi-sensor-model-packaging/tree/master/examples/OSMPDummySensor)
1315
- [OSMPCNetworkProxy](https://github.com/OpenSimulationInterface/osi-sensor-model-packaging/tree/master/examples/OSMPCNetworkProxy)
1416

15-
## Installation
17+
Installation
18+
------------
19+
20+
### Checkout the repository with submodules
21+
22+
- Open a terminal.
23+
- Clone the osi-cpp repository, including sub-modules:
24+
25+
```console
26+
git clone --recurse-submodules https://github.com/PMSFIT/osi-cpp.git
27+
```
28+
29+
- Switch to the repository directory:
30+
31+
```console
32+
cd osi-cpp
33+
```
34+
35+
### Using vcpkg for dependencies
36+
37+
Especially for building on Windows, the use of [vcpkg](https://vcpkg.io/) to handle dependencies is recommended.
38+
This can be achieved easily through the use of the CMake `vcpkg` preset when configuring:
39+
40+
In order to use the preset the environment variable `VCPKG_ROOT` has to be set to the root of your vcpkg installation.
41+
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:
42+
43+
```json
44+
{
45+
"version": 3,
46+
"configurePresets": [
47+
{
48+
"name": "default",
49+
"inherits": "vcpkg",
50+
"environment": {
51+
"VCPKG_ROOT": "C:\\vcpkg"
52+
}
53+
}
54+
]
55+
}
56+
```
57+
58+
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.
59+
60+
The build can then be performed in the following manner:
61+
62+
- Configure the build:
63+
64+
```console
65+
cmake --preset default
66+
```
67+
68+
- Perform the build:
69+
70+
```console
71+
cmake --build build
72+
```
73+
74+
See the [vcpkg documentation](https://vcpkg.io/) for further information on the use of vcpkg in combination with CMake in various build environments.
75+
76+
### Building without vcpkg
77+
78+
To build without the use of vcpkg to handle dependencies, you have to ensure that necessary prerequisites are installed and detectable by CMake.
79+
80+
Once this has been achieved, the build can be performed in the following manner:
81+
82+
- Configure the build:
83+
84+
```console
85+
cmake -B build
86+
```
87+
88+
- Perform the build:
89+
90+
```console
91+
cmake --build build
92+
```
93+
94+
### Further information
1695

1796
For detailed installation instructions, please refer to the official documentation:
1897
- [Setting up OSI](https://opensimulationinterface.github.io/osi-antora-generator/asamosi/latest/interface/setup/setting_up_osi.html)

0 commit comments

Comments
 (0)