Skip to content

Commit a57c651

Browse files
committed
[README.md] Make it clearer how to import using fetch.
1 parent 76a0abb commit a57c651

1 file changed

Lines changed: 21 additions & 25 deletions

File tree

README.md

Lines changed: 21 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,27 @@
1111
- `scripts/` — example Python scripts.
1212
- `src/examples/` — C++ example programs and test nodes.
1313

14+
## Using as a non-ROS2 dependency (CMake FetchContent)
15+
16+
To include `sas_core_pure` in a plain CMake project (no ROS2/ament required):
17+
18+
```cmake
19+
include(FetchContent)
20+
FetchContent_Declare(
21+
sas_core
22+
GIT_REPOSITORY https://github.com/SmartArmStack/sas_core.git
23+
GIT_TAG jazzy
24+
)
25+
26+
set(ROS2_BUILD OFF CACHE BOOL "" FORCE)
27+
FetchContent_MakeAvailable(sas_core)
28+
29+
target_link_libraries(your_target PRIVATE sas_core_pure)
30+
```
31+
32+
The library depends on **Eigen3** and **dqrobotics**; make sure both are
33+
available on your system.
34+
1435
## Examples
1536

1637
Testing on a docker container.
@@ -36,28 +57,3 @@ The `scripts/sas_robot_driver_subclass_example_py.py` file demonstrates how to
3657
subclass `sas_core.RobotDriver` in Python and contains a minimal working
3758
example.
3859

39-
## Using as a non-ROS2 dependency (CMake FetchContent)
40-
41-
To include `sas_core_pure` in a plain CMake project (no ROS2/ament required):
42-
43-
```cmake
44-
include(FetchContent)
45-
FetchContent_Declare(
46-
sas_core
47-
GIT_REPOSITORY https://github.com/SmartArmStack/sas_core.git
48-
GIT_TAG jazzy
49-
)
50-
FetchContent_MakeAvailable(sas_core)
51-
52-
target_link_libraries(your_target PRIVATE sas_core_pure)
53-
```
54-
55-
The `ROS2_BUILD` option defaults to `ON`. Disable it before calling
56-
`FetchContent_MakeAvailable` if your toolchain does not provide ament:
57-
58-
```cmake
59-
set(ROS2_BUILD OFF CACHE BOOL "" FORCE)
60-
```
61-
62-
The library depends on **Eigen3** and **dqrobotics**; make sure both are
63-
available on your system.

0 commit comments

Comments
 (0)