You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|[cmakebox](https://github.com/willat343/cppbox)| >= 0.0.1 | CMake Functions and Utilities |
11
+
12
+
There are several ways to include `cppbox` within your project:
13
+
-[Preferred] Via `FetchContent` allowing `cppbox` to be built as a submodule.
14
+
- Via `find_package`, requiring `cppbox` to be installed to the system, locally, or to a catkin workspace.
15
+
16
+
## Include via FetchContent
17
+
18
+
It is recommended to leverage the functionality of [cmakebox](https://github.com/willat343/cppbox) by including the following lines in the `CMakeLists.txt` (replace `X.Y.Z` with version):
Include with the following lines in the`CMakeLists.txt`:
88
+
```CMake
27
89
find_package(cppbox REQUIRED)
28
-
target_link_libraries(<target> PUBLIC ${cppbox_LIBRARIES})
90
+
target_link_libraries(<target> PUBLIC cppbox::cppbox)
29
91
```
30
92
31
-
The `cppbox` provides CMake targets in `${cppbox_LIBRARIES}` which contain the properties (include directories, link libraries, compile options, compile flags, link flags, etc.) needed by the downstream project, and hence only `target_link_libraries()` is required.
93
+
### Uninstall
32
94
33
-
## Catkin Support
95
+
```bash
96
+
sudo cmake --build build --target uninstall
97
+
```
98
+
99
+
## Include in Catkin Workspace
34
100
35
101
A `package.xml` is supplied to facilitate an isolated installation within a catkin workspace (e.g. for ROS applications).
36
102
37
-
### Installation
103
+
### Clone
38
104
39
-
Either:
40
-
```bash
41
-
ln -s /path/to/cppbox /path/to/catkin_ws/src
42
-
```
43
-
Or:
44
105
```bash
45
106
cd /path/to/catkin_ws/src
46
107
git clone git@github.com:willat343/cppbox.git
47
108
```
48
109
49
-
Then:
110
+
### Build
111
+
50
112
```bash
51
113
cd /path/to/catkin_ws
52
114
catkin build cppbox
@@ -59,11 +121,15 @@ cd /path/to/catkin_ws
59
121
catkin clean cppbox
60
122
```
61
123
62
-
### Include in Downstream Project
124
+
### Include
63
125
64
126
To use the package in a downstream project, one should add to their `package.xml`:
65
127
```xml
66
128
<depend>cppbox</depend>
67
129
```
68
-
One can then either use the workspace's isolated installation or use the system installation otherwise.
69
-
Importing the dependency is then exactly the same as it would be in a non-catkin package as described above (do NOT rely on the `catkin` variables like `catkin_LIBRARIES` and `catkin_INCLUDE_DIRS`).
130
+
131
+
One can then include `cppbox` package by includeing in the `CMakeLists.txt`:
132
+
```CMake
133
+
find_package(cppbox REQUIRED)
134
+
target_link_libraries(<target> PUBLIC cppbox::cppbox)
0 commit comments