Skip to content

Commit 95d1c0e

Browse files
committed
explain c++ and python repo split in documentation
Signed-off-by: Timm Ruppert <timm.ruppert@persival.de>
1 parent 78b5229 commit 95d1c0e

10 files changed

+130
-323
lines changed

doc/open-simulation-interface_user_guide.adoc

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -79,21 +79,10 @@ include::./architecture/formatting_script.adoc[leveloffset=+3]
7979
// Setting up OSI
8080
include::./setup/setting_up_osi.adoc[leveloffset=+1]
8181

82-
include::./setup/installing_prerequisites.adoc[leveloffset=+2]
82+
include::./setup/setting_up_osi_cpp.adoc[leveloffset=+2]
8383

84-
include::./setup/installing_linux_cpp.adoc[leveloffset=+2]
84+
include::./setup/setting_up_osi_python.adoc[leveloffset=+2]
8585

86-
include::./setup/installing_linux_python.adoc[leveloffset=+2]
87-
88-
include::./setup/installing_windows_cpp.adoc[leveloffset=+2]
89-
90-
include::./setup/installing_windows_python.adoc[leveloffset=+2]
91-
92-
//include::./setup/installing_macos.adoc[leveloffset=+2]
93-
94-
//include::./setup/using_osi_support_tools.adoc[leveloffset=+2]
95-
96-
//include::./setup/including_osi_dev_projects.adoc[leveloffset=+2]
9786

9887
//== Example use cases for OSI
9988

doc/setup/including_osi_dev_projects.adoc

Lines changed: 0 additions & 21 deletions
This file was deleted.

doc/setup/installing_linux_cpp.adoc

Lines changed: 0 additions & 56 deletions
This file was deleted.

doc/setup/installing_linux_python.adoc

Lines changed: 0 additions & 66 deletions
This file was deleted.

doc/setup/installing_macos.adoc

Lines changed: 0 additions & 21 deletions
This file was deleted.

doc/setup/installing_windows_cpp.adoc

Lines changed: 0 additions & 57 deletions
This file was deleted.

doc/setup/installing_windows_python.adoc

Lines changed: 0 additions & 60 deletions
This file was deleted.

doc/setup/installing_prerequisites.adoc renamed to doc/setup/setting_up_osi_cpp.adoc

Lines changed: 54 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,64 @@ ifndef::include-only-once[]
22
:root-path: ../
33
include::{root-path}_config.adoc[]
44
endif::[]
5-
[#top-installing-osi-prerequisits]
6-
= Installing protobuf for static / dynamic linking
5+
= Open Simulation Interface (OSI) C++ Bindings
6+
7+
This section explains how to integrate OSI into your own C++ project.
8+
The C++ bindings are available in the separate https://github.com/OpenSimulationInterface/osi-cpp.git[osi-cpp] repository.
9+
10+
You can refer to an example application in the examples of the
11+
https://github.com/OpenSimulationInterface/osi-sensor-model-packaging/tree/master/examples[OSI Sensor Model Packaging] repository.
712

813
== Prerequisites
14+
- cmake (version 3.10.2 or higher)
15+
- git
16+
17+
== Checkout the repository with submodules
18+
19+
. Open a terminal in your project.
20+
. Clone the osi-cpp repository, including sub-modules:
21+
+
22+
----
23+
git clone --recurse-submodules https://github.com/OpenSimulationInterface/osi-cpp.git
24+
----
25+
26+
27+
== Using vcpkg for dependencies (Recommended)
28+
29+
Especially for building on Windows, the use of **vcpkg** to handle dependencies is recommended.
30+
31+
Prerequisites::
32+
* The environment variable `VCPKG_ROOT` must be set to the root of your vcpkg installation.
33+
* For Windows static linking, the static-md triplet is recommended (see also <<static_dynamic_linking, Static/Dynamic Linking>> explained below)
34+
35+
Steps::
36+
. Configure the build using the vcpkg preset:
37+
+
38+
----
39+
cmake --preset default
40+
----
41+
. Perform the build:
42+
+
43+
----
44+
cmake --build build
45+
----
46+
47+
48+
== Building without vcpkg
49+
50+
To build without vcpkg, you must ensure necessary prerequisites are installed and detectable by CMake. It is then usually enough to include the `osi-cpp` repository in your main `CMakeLists.txt`:
51+
----
52+
set(LINK_WITH_SHARED_OSI OFF) # Check linking explaination below
53+
add_subdirectory(lib/osi-cpp)
54+
target_link_libraries(YourTarget open_simulation_interface_pic)
55+
56+
----
957

10-
* You have installed _cmake_ (version 3.10.2 or higher)
11-
* You must have superuser privileges
58+
== Static/Dynamic Linking [[static_dynamic_linking]]
1259

13-
Static linking is the recommended way to package OSI FMUs for sharing with others to be integrated in a co-simulation: They should have minimal external dependencies in order to ensure maximum portability.
14-
For other use cases like first trials to get started with OSI, dynamic linking could be an option as well.
60+
Static linking is the recommended way to package OSI FMUs for sharing with others to be integrated in a co-simulation: They should have minimal external dependencies in order to ensure maximum portability. For other use cases dynamic linking could be an option and is thus explained below.
1561

16-
== Windows
62+
=== Windows
1763

1864
Dynamic Linking (NOT RECOMMENDED)::
1965

@@ -46,7 +92,7 @@ Now the protobuf libraries can be built automatically using:
4692
vcpkg install --triplet=x64-windows-static-md protobuf
4793
----
4894

49-
== Linux
95+
=== Linux
5096

5197
Dynamic linking (NOT RECOMMENDED)::
5298

0 commit comments

Comments
 (0)