Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add instructions for build on Windows #8

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
# Generate compile_commands.json for clang based tools
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

set(CMAKE_POLICY_DEFAULT_CMP0135 NEW)

# Add the include folder for public headers
include_directories(${PROJECT_SOURCE_DIR}/include)

Expand Down
44 changes: 36 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@ A utility library that provides essential tools, helper functions, and implement

- Cross-platform C++ library and Python APIs
- > **_NOTE:_** Python API is planned but not yet implemented.
- > **_NOTE:_** Windows should be supported but not yet tested, contributions welcome!
- Easily integrate dealing with OSI data and trace files into your own projects
- More OSI utility features planned, feature requests and pull requests welcome!

## Build Instructions

### Install required dependencies
### Install required dependencies on Linux

- Compiler (e.g. GCC, Clang, MSVC)
- [CMake](https://cmake.org/download/)
- [Doxygen](https://www.doxygen.nl/download.html)
- [zstd](https://github.com/facebook/zstd)
- [lz4](https://github.com/lz4/lz4)
- [Protobuf](https://github.com/protocolbuffers/protobuf)
Expand All @@ -30,6 +30,39 @@ A utility library that provides essential tools, helper functions, and implement
sudo apt install build-essential cmake libzstd-dev liblz4-dev protobuf-compiler doxygen
```

### Install required dependencies on Windows

- Compiler (e.g. [MS Build Tools for Visual Studio 2022](https://visualstudio.microsoft.com/de/downloads/#build-tools-for-visual-studio-2022))
- [CMake](https://cmake.org/download/)
- [Doxygen](https://www.doxygen.nl/download.html)
- [zstd](https://github.com/facebook/zstd)
- [lz4](https://github.com/lz4/lz4)
- [Protobuf](https://github.com/protocolbuffers/protobuf)
- [pkg-config](https://stackoverflow.com/a/25605631/2883130)
- [gtest](https://google.github.io/googletest/)

> **_NOTE:_** Use the protobuf installation instructions for Windows from [OSI](https://opensimulationinterface.github.io/osi-antora-generator/asamosi/latest/interface/setup/installing_prerequisites.html#_windows) to create the triplets file. You can use [vcpkg](https://github.com/microsoft/vcpkg) and [chocolatey](https://chocolatey.org/) to install the following dependencies:

```bash
> choco install git
> choco install cmake
> choco install pkgconfiglite
>
> vcpkg install --triplet=x64-windows-static-md protobuf
> vcpkg install lz4
> vcpkg install zstd
> vcpkg install gtest
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is gtest really needed via vcpkg. Shouldn't the FetchContent_MakeAvailable be sufficient?

> vcpkg install pthreads
```

### Environment variables

Make sure that the `/bin` folders of the depedencies are added to your `$PATH`. In addition set the following variables:

```bash
CMAKE_PREFIX_PATH=C:/path/to/vcpkg/installed/x64-windows
```

### Build

Clone the repository incl. submodules
Expand All @@ -38,16 +71,11 @@ Clone the repository incl. submodules
git clone --recurse-submodules https://github.com/Lichtblick-Suite/asam-osi-utilities.git
```

Create build directory and configure using CMake
Create build directory and configure using CMake and build afterwards:

```bash
mkdir build && cd build
cmake ..
```

Build using CMake

```bash
cmake --build . -j4
```

Expand Down
2 changes: 1 addition & 1 deletion include/osi-utilities/tracefile/Writer.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ namespace osi3 {
* This class provides an interface for writing protobuf messages to trace files.
* Different implementations can support various file formats like .osi, .mcap or .txth.
*
* @Note The WriteMessage() function is intentionally omitted from this base class since it is format-specific.
* @note The WriteMessage() function is intentionally omitted from this base class since it is format-specific.
* Users should dynamically cast to the concrete implementation class to access the appropriate WriteMessage() function.
*/
class TraceFileWriter {
Expand Down
Loading