Skip to content

Commit

Permalink
feat: Add instructions for build on Windows
Browse files Browse the repository at this point in the history
Signed-off-by: jdsika <[email protected]>
  • Loading branch information
jdsika committed Dec 11, 2024
1 parent 8941fbe commit a2dbe40
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 9 deletions.
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
43 changes: 35 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,38 @@ 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. 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)
- [pkg-config](https://stackoverflow.com/a/25605631/2883130)
- [gtest](https://google.github.io/googletest/)

> **_NOTE:_** 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 protobuf[zlib] protobuf[zlib]:x64-windows
> vcpkg install lz4
> vcpkg install zstd
> vcpkg install gtest
```

### 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 +70,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

0 comments on commit a2dbe40

Please sign in to comment.