This repo provides a wrapper to build and install MCAP via CMake.
To build and install run:
$ cd mcap_builder
$ mkdir build && cd build
$ cmake ../ && make install
you can change the install folder by setting CMAKE_INSTALL_PREFIX
(as for any CMake project).
If you built and installed as described above, to include MCAP in your library first you need to add it to your CMake:
find_package(mcap)
target_link_libraries(<target> PUBLIC mcap)
and in your code, you can include reader.hpp
or writer.hpp
.
If you do not want to install MCAP, and you want to build it as part of your project you can, in your CMakeLists.txt
add:
include(FetchContent)
FetchContent_Declare(
mcap_builder
GIT_REPOSITORY https://github.com/olympus-robotics/mcap_builder.git
GIT_TAG main
)
FetchContent_MakeAvailable(mcap_builder)
# create your targets
target_link_libraries(<target> PUBLIC mcap)
MCAP_IMPLEMENTATION
macro, as that is handled for you by this wrapper.LZ4
and zstd
are available, and
mcap
libraryMCAP_COMPRESSION_NO_LZ4
and MCAP_COMPRESSION_NO_ZSTD
MCAP is natively a header-only library, but in this wrapper, it is built into a binary library.
This has two benefits: