2.3.4 Installing OSI for C++ on Windows

Prerequisites
Steps
  1. Open a terminal as administrator.

  2. Clone the Open Simulation repository.

    git clone https://github.com/OpenSimulationInterface/open-simulation-interface.git
  3. Switch to the repository directory.

    cd open-simulation-interface
  4. Create a new directory for the build.

    mkdir build
  5. Switch to the new directory.

    cd build
  6. 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>]
  7. Build and install OSI.

    cmake --build . [--config Release]
    cmake --build . --target install