2.3.4 Installing OSI for C++ on Windows
- Prerequisites
-
-
You have installed everything described in Section 2.3.1, "Installing protobuf for static / dynamic linking".
-
- Steps
-
-
Open a terminal as administrator.
-
Clone the Open Simulation repository.
git clone https://github.com/OpenSimulationInterface/open-simulation-interface.git
-
Switch to the repository directory.
cd open-simulation-interface
-
Create a new directory for the build.
mkdir build
-
Switch to the new directory.
cd build
-
Run cmake. To build a 64-bit target, add
Win64
to the generator name. In this case, protobuf and protoc.exe must be in 64-bit mode too.cmake .. [-G <generator>] [-DCMAKE_INSTALL_PREFIX=<osi-install-directory>]
If you used vcpkg to install protobuf, then provide the target and toolchain file information, as follows
cmake .. -DVCPKG_TARGET_TRIPLET=x64-windows-static-md -DCMAKE_TOOLCHAIN_FILE=C:/path/to/vcpkg/scripts/buildsystems/vcpkg.cmake -A x64 [-G <generator>] [-DCMAKE_INSTALL_PREFIX=<osi-install-directory>]
-
Build and install OSI.
cmake --build . [--config Release] cmake --build . --target install
-