Skip to content

Commit ea6a4f8

Browse files
committed
README: document using cmake FetchContent
1 parent ced8ef7 commit ea6a4f8

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,25 @@ Streamed C++ [ULog](https://docs.px4.io/main/en/dev_log/ulog_file_format.html) r
1717
Check the [examples](examples) subdirectory.
1818

1919
## Include in a project
20+
### Using cmake FetchContent
21+
To use the library with `FetchContent` in cmake, add the following to the `CMakeLists.txt`:
22+
```cmake
23+
include(FetchContent)
24+
FetchContent_Declare(
25+
ulog_cpp
26+
GIT_REPOSITORY https://github.com/PX4/ulog_cpp.git
27+
GIT_TAG v1.0.0
28+
SYSTEM
29+
EXCLUDE_FROM_ALL)
30+
31+
FetchContent_MakeAvailable(ulog_cpp)
32+
33+
target_link_libraries(YOUR_PROJECT PUBLIC
34+
ulog_cpp::ulog_cpp
35+
)
36+
```
37+
38+
### As a submodule
2039
To add the library as a submodule with cmake, use the following steps:
2140
```shell
2241
git submodule add https://github.com/PX4/ulog_cpp.git ulog_cpp

0 commit comments

Comments
 (0)